]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
Fixed bug #37893 Unused variables in tcp_out (and in udp.c/.h)
authorSimon Goldschmidt <goldsimon@gmx.de>
Mon, 14 Jan 2013 19:46:41 +0000 (20:46 +0100)
committerSimon Goldschmidt <goldsimon@gmx.de>
Mon, 14 Jan 2013 19:46:41 +0000 (20:46 +0100)
src/core/tcp_out.c
src/core/udp.c
src/include/lwip/udp.h

index 8cfb3df9c4e34a07592913b7fde1555a66016d61..10d5b3045dddd8d437560761dd4c1f6d993a8676 100644 (file)
@@ -845,8 +845,10 @@ err_t
 tcp_send_empty_ack(struct tcp_pcb *pcb)
 {
   struct pbuf *p;
-  struct tcp_hdr *tcphdr;
   u8_t optlen = 0;
+#if LWIP_TCP_TIMESTAMPS || CHECKSUM_GEN_TCP
+  struct tcp_hdr *tcphdr;
+#endif /* LWIP_TCP_TIMESTAMPS || CHECKSUM_GEN_TCP */
 
 #if LWIP_TCP_TIMESTAMPS
   if (pcb->flags & TF_TIMESTAMP) {
@@ -859,7 +861,9 @@ tcp_send_empty_ack(struct tcp_pcb *pcb)
     LWIP_DEBUGF(TCP_OUTPUT_DEBUG, ("tcp_output: (ACK) could not allocate pbuf\n"));
     return ERR_BUF;
   }
+#if LWIP_TCP_TIMESTAMPS || CHECKSUM_GEN_TCP
   tcphdr = (struct tcp_hdr *)p->payload;
+#endif /* LWIP_TCP_TIMESTAMPS || CHECKSUM_GEN_TCP */
   LWIP_DEBUGF(TCP_OUTPUT_DEBUG, 
               ("tcp_output: sending ACK for %"U32_F"\n", pcb->rcv_nxt));
   /* remove ACK flags from the PCB, as we send an empty ACK now */
index bba4a1ce298038de4f91add435397e9d27592e8b..ac0e56d192002424bb0a50823fecb2d22f2d7ded 100644 (file)
@@ -509,7 +509,7 @@ udp_send(struct udp_pcb *pcb, struct pbuf *p)
   return udp_sendto(pcb, p, ipX_2_ip(&pcb->remote_ip), pcb->remote_port);
 }
 
-#if LWIP_CHECKSUM_ON_COPY
+#if LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP
 /** Same as udp_send() but with checksum
  */
 err_t
@@ -520,7 +520,7 @@ udp_send_chksum(struct udp_pcb *pcb, struct pbuf *p,
   return udp_sendto_chksum(pcb, p, ipX_2_ip(&pcb->remote_ip), pcb->remote_port,
     have_chksum, chksum);
 }
-#endif /* LWIP_CHECKSUM_ON_COPY */
+#endif /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */
 
 /**
  * Send data to a specified address using UDP.
@@ -543,7 +543,7 @@ err_t
 udp_sendto(struct udp_pcb *pcb, struct pbuf *p,
   ip_addr_t *dst_ip, u16_t dst_port)
 {
-#if LWIP_CHECKSUM_ON_COPY
+#if LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP
   return udp_sendto_chksum(pcb, p, dst_ip, dst_port, 0, 0);
 }
 
@@ -552,7 +552,7 @@ err_t
 udp_sendto_chksum(struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *dst_ip,
                   u16_t dst_port, u8_t have_chksum, u16_t chksum)
 {
-#endif /* LWIP_CHECKSUM_ON_COPY */
+#endif /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */
   struct netif *netif;
   ipX_addr_t *dst_ip_route = ip_2_ipX(dst_ip);
 
@@ -585,11 +585,11 @@ udp_sendto_chksum(struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *dst_ip,
     UDP_STATS_INC(udp.rterr);
     return ERR_RTE;
   }
-#if LWIP_CHECKSUM_ON_COPY
+#if LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP
   return udp_sendto_if_chksum(pcb, p, dst_ip, dst_port, netif, have_chksum, chksum);
-#else /* LWIP_CHECKSUM_ON_COPY */
+#else /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */
   return udp_sendto_if(pcb, p, dst_ip, dst_port, netif);
-#endif /* LWIP_CHECKSUM_ON_COPY */
+#endif /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */
 }
 
 /**
@@ -615,7 +615,7 @@ err_t
 udp_sendto_if(struct udp_pcb *pcb, struct pbuf *p,
   ip_addr_t *dst_ip, u16_t dst_port, struct netif *netif)
 {
-#if LWIP_CHECKSUM_ON_COPY
+#if LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP
   return udp_sendto_if_chksum(pcb, p, dst_ip, dst_port, netif, 0, 0);
 }
 
@@ -625,7 +625,7 @@ udp_sendto_if_chksum(struct udp_pcb *pcb, struct pbuf *p, ip_addr_t *dst_ip,
                      u16_t dst_port, struct netif *netif, u8_t have_chksum,
                      u16_t chksum)
 {
-#endif /* LWIP_CHECKSUM_ON_COPY */
+#endif /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */
   struct udp_hdr *udphdr;
   ip_addr_t *src_ip;
   err_t err;
index aa1ad3fba99f7cef34bb1e7a037552c8b0608136..14d5c0ae7737b381a4e3a8beef6326d061038737 100644 (file)
@@ -160,7 +160,7 @@ err_t            udp_sendto     (struct udp_pcb *pcb, struct pbuf *p,
                                  ip_addr_t *dst_ip, u16_t dst_port);
 err_t            udp_send       (struct udp_pcb *pcb, struct pbuf *p);
 
-#if LWIP_CHECKSUM_ON_COPY
+#if LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP
 err_t            udp_sendto_if_chksum(struct udp_pcb *pcb, struct pbuf *p,
                                  ip_addr_t *dst_ip, u16_t dst_port,
                                  struct netif *netif, u8_t have_chksum,
@@ -170,7 +170,7 @@ err_t            udp_sendto_chksum(struct udp_pcb *pcb, struct pbuf *p,
                                  u8_t have_chksum, u16_t chksum);
 err_t            udp_send_chksum(struct udp_pcb *pcb, struct pbuf *p,
                                  u8_t have_chksum, u16_t chksum);
-#endif /* LWIP_CHECKSUM_ON_COPY */
+#endif /* LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */
 
 #define          udp_flags(pcb) ((pcb)->flags)
 #define          udp_setflags(pcb, f)  ((pcb)->flags = (f))
@@ -192,12 +192,12 @@ struct udp_pcb * udp_new_ip6(void);
                    udp_sendto(pcb, pbuf, ip6_2_ip(ip6addr), port)
 #define          udp_sendto_if_ip6(pcb, pbuf, ip6addr, port, netif) \
                    udp_sendto_if(pcb, pbuf, ip6_2_ip(ip6addr), port, netif)
-#if LWIP_CHECKSUM_ON_COPY
+#if LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP
 #define          udp_sendto_chksum_ip6(pcb, pbuf, ip6addr, port, have_chk, chksum) \
                    udp_sendto_chksum(pcb, pbuf, ip6_2_ip(ip6addr), port, have_chk, chksum)
 #define          udp_sendto_if_chksum_ip6(pcb, pbuf, ip6addr, port, netif, have_chk, chksum) \
                    udp_sendto_if_chksum(pcb, pbuf, ip6_2_ip(ip6addr), port, netif, have_chk, chksum)
-#endif /*LWIP_CHECKSUM_ON_COPY */
+#endif /*LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_UDP */
 #endif /* LWIP_IPV6 */
 
 #if UDP_DEBUG