/[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.47 by likewise, Fri Nov 14 13:17:24 2003 UTC revision 1.48 by likewise, Tue Nov 18 01:40:08 2003 UTC
# Line 450  udp_send(struct udp_pcb *pcb, struct pbu Line 450  udp_send(struct udp_pcb *pcb, struct pbu
450      q = p;      q = p;
451      LWIP_DEBUGF(UDP_DEBUG, ("udp_send: added header in given pbuf %p\n", (void *)p));      LWIP_DEBUGF(UDP_DEBUG, ("udp_send: added header in given pbuf %p\n", (void *)p));
452    }    }
453      /* { q now represents the packet to be sent */
454    udphdr = q->payload;    udphdr = q->payload;
455    udphdr->src = htons(pcb->local_port);    udphdr->src = htons(pcb->local_port);
456    udphdr->dest = htons(pcb->remote_port);    udphdr->dest = htons(pcb->remote_port);
# Line 483  udp_send(struct udp_pcb *pcb, struct pbu Line 483  udp_send(struct udp_pcb *pcb, struct pbu
483      /* chksum zero must become 0xffff, as zero means 'no checksum' */      /* chksum zero must become 0xffff, as zero means 'no checksum' */
484      if (udphdr->chksum == 0x0000) udphdr->chksum = 0xffff;      if (udphdr->chksum == 0x0000) udphdr->chksum = 0xffff;
485      /* output to IP */      /* output to IP */
486      err = ip_output_if (p, src_ip, &pcb->remote_ip, pcb->ttl, pcb->tos, IP_PROTO_UDPLITE, netif);          err = ip_output_if (q, src_ip, &pcb->remote_ip, pcb->ttl, pcb->tos, IP_PROTO_UDPLITE, netif);    
487      snmp_inc_udpoutdatagrams();      snmp_inc_udpoutdatagrams();
488    } else {    } else {
489      LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP packet length %u\n", q->tot_len));      LWIP_DEBUGF(UDP_DEBUG, ("udp_send: UDP packet length %u\n", q->tot_len));
# Line 498  udp_send(struct udp_pcb *pcb, struct pbu Line 498  udp_send(struct udp_pcb *pcb, struct pbu
498      snmp_inc_udpoutdatagrams();      snmp_inc_udpoutdatagrams();
499      LWIP_DEBUGF(UDP_DEBUG, ("udp_send: ip_output_if (,,,,IP_PROTO_UDP,)\n"));      LWIP_DEBUGF(UDP_DEBUG, ("udp_send: ip_output_if (,,,,IP_PROTO_UDP,)\n"));
500      /* output to IP */      /* output to IP */
501      err = ip_output_if(p, src_ip, &pcb->remote_ip, pcb->ttl, pcb->tos, IP_PROTO_UDP, netif);          err = ip_output_if(q, src_ip, &pcb->remote_ip, pcb->ttl, pcb->tos, IP_PROTO_UDP, netif);    
502    }    }
503    
504    /* did we chain a header earlier? */    /* did we chain a header earlier? */
505    if (q != p) {    if (q != p) {
506      /* free the header */      /* free the header */
507        /* p is also still referenced by the caller, and will live on */
508      pbuf_free(q);      pbuf_free(q);
509    }    }
510    

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.48

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