/[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.66 by likewise, Mon Jan 3 17:54:21 2005 UTC revision 1.67 by likewise, Wed Jun 8 18:35:00 2005 UTC
# Line 66  struct udp_pcb *udp_pcbs = NULL; Line 66  struct udp_pcb *udp_pcbs = NULL;
66    
67  static struct udp_pcb *pcb_cache = NULL;  static struct udp_pcb *pcb_cache = NULL;
68    
   
69  void  void
70  udp_init(void)  udp_init(void)
71  {  {
# Line 410  udp_send(struct udp_pcb *pcb, struct pbu Line 409  udp_send(struct udp_pcb *pcb, struct pbu
409        return err;        return err;
410      }      }
411    }    }
412      /* find the outgoing network interface for this packet */
413      netif = ip_route(&(pcb->remote_ip));
414      /* no outgoing network interface could be found? */
415      if (netif == NULL) {
416        LWIP_DEBUGF(UDP_DEBUG | 1, ("udp_send: No route to 0x%lx\n", pcb->remote_ip.addr));
417        UDP_STATS_INC(udp.rterr);
418        return ERR_RTE;
419      }
420    
421    /* not enough space to add an UDP header to first pbuf in given p chain? */    /* not enough space to add an UDP header to first pbuf in given p chain? */
422    if (pbuf_header(p, UDP_HLEN)) {    if (pbuf_header(p, UDP_HLEN)) {
# Line 437  udp_send(struct udp_pcb *pcb, struct pbu Line 444  udp_send(struct udp_pcb *pcb, struct pbu
444    /* in UDP, 0 checksum means 'no checksum' */    /* in UDP, 0 checksum means 'no checksum' */
445    udphdr->chksum = 0x0000;    udphdr->chksum = 0x0000;
446    
   /* find the outgoing network interface for this packet */  
   netif = ip_route(&(pcb->remote_ip));  
   /* no outgoing network interface could be found? */  
   if (netif == NULL) {  
     LWIP_DEBUGF(UDP_DEBUG | 1, ("udp_send: No route to 0x%lx\n", pcb->remote_ip.addr));  
     UDP_STATS_INC(udp.rterr);  
     return ERR_RTE;  
   }  
447    /* PCB local address is IP_ANY_ADDR? */    /* PCB local address is IP_ANY_ADDR? */
448    if (ip_addr_isany(&pcb->local_ip)) {    if (ip_addr_isany(&pcb->local_ip)) {
449      /* use outgoing network interface IP address as source address */      /* use outgoing network interface IP address as source address */

Legend:
Removed from v.1.66  
changed lines
  Added in v.1.67

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