/[lwip]/lwip/src/core/udp.c
ViewVC logotype

Diff of /lwip/src/core/udp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by jani, Wed Jan 22 16:18:05 2003 UTC revision 1.12 by jani, Thu Jan 23 16:46:01 2003 UTC
# Line 217  udp_input(struct pbuf *p, struct netif * Line 217  udp_input(struct pbuf *p, struct netif *
217    
218    
219    /* Check checksum if this is a match or if it was directed at us. */    /* Check checksum if this is a match or if it was directed at us. */
220    /*  if(pcb != NULL ||      if(pcb != NULL  || ip_addr_cmp(&inp->ip_addr, &iphdr->dest))
221        ip_addr_cmp(&inp->ip_addr, &iphdr->dest)) {*/      {
   if(pcb != NULL) {  
222      DEBUGF(UDP_DEBUG, ("udp_input: calculating checksum\n"));      DEBUGF(UDP_DEBUG, ("udp_input: calculating checksum\n"));
223      pbuf_header(p, UDP_HLEN);          pbuf_header(p, UDP_HLEN);    
224  #ifdef IPv6  #ifdef IPv6
# Line 266  udp_input(struct pbuf *p, struct netif * Line 265  udp_input(struct pbuf *p, struct netif *
265  #if LWIP_SNMP > 0  #if LWIP_SNMP > 0
266        snmp_inc_udpindatagrams();        snmp_inc_udpindatagrams();
267  #endif  #endif
268        pcb->recv(pcb->recv_arg, pcb, p, &(iphdr->src), src);        pcb->recv(pcb->recv_arg, pcb, p, &(iphdr->src), udphdr->src);
269      } else {      } else {
270        DEBUGF(UDP_DEBUG, ("udp_input: not for us.\n"));        DEBUGF(UDP_DEBUG, ("udp_input: not for us.\n"));
271                
# Line 276  udp_input(struct pbuf *p, struct netif * Line 275  udp_input(struct pbuf *p, struct netif *
275        if(!ip_addr_isbroadcast(&iphdr->dest, &inp->netmask) &&        if(!ip_addr_isbroadcast(&iphdr->dest, &inp->netmask) &&
276           !ip_addr_ismulticast(&iphdr->dest)) {           !ip_addr_ismulticast(&iphdr->dest)) {
277                    
         /* deconvert from host to network byte order */  
         udphdr->src = htons(udphdr->src);  
         udphdr->dest = htons(udphdr->dest);  
           
278          /* adjust pbuf pointer */          /* adjust pbuf pointer */
279          p->payload = iphdr;          p->payload = iphdr;
280          icmp_dest_unreach(p, ICMP_DUR_PORT);          icmp_dest_unreach(p, ICMP_DUR_PORT);

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26