/[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.64 by likewise, Sun Jul 4 23:43:38 2004 UTC revision 1.65 by likewise, Thu Nov 25 11:10:53 2004 UTC
# Line 356  udp_sendto(struct udp_pcb *pcb, struct p Line 356  udp_sendto(struct udp_pcb *pcb, struct p
356    struct ip_addr *dst_ip, u16_t dst_port)    struct ip_addr *dst_ip, u16_t dst_port)
357  {  {
358    err_t err;    err_t err;
359      /* temporary space for current PCB remote address */
360    struct ip_addr pcb_remote_ip;    struct ip_addr pcb_remote_ip;
361    u16_t pcb_remote_port;    u16_t pcb_remote_port;
362    /* remember remote peer address of PCB */    /* remember current remote peer address of PCB */
363    pcb_remote_ip.addr = pcb->remote_ip.addr;    pcb_remote_ip.addr = pcb->remote_ip.addr;
364    pcb_remote_port = pcb->remote_port;    pcb_remote_port = pcb->remote_port;
365    /* copy packet destination address to PCB remote peer address */    /* copy packet destination address to PCB remote peer address */
# Line 366  udp_sendto(struct udp_pcb *pcb, struct p Line 367  udp_sendto(struct udp_pcb *pcb, struct p
367    pcb->remote_port = dst_port;    pcb->remote_port = dst_port;
368    /* send to the packet destination address */    /* send to the packet destination address */
369    err = udp_send(pcb, p);    err = udp_send(pcb, p);
370    /* reset PCB remote peer address */    /* restore PCB remote peer address */
371    pcb->remote_ip.addr = pcb_remote_ip.addr;    pcb->remote_ip.addr = pcb_remote_ip.addr;
372    pcb->remote_port = pcb_remote_port;    pcb->remote_port = pcb_remote_port;
373    return err;    return err;
# Line 433  udp_send(struct udp_pcb *pcb, struct pbu Line 434  udp_send(struct udp_pcb *pcb, struct pbu
434    udphdr->chksum = 0x0000;    udphdr->chksum = 0x0000;
435    
436    /* find the outgoing network interface for this packet */    /* find the outgoing network interface for this packet */
437    if ((netif = ip_route(&(pcb->remote_ip))) == NULL) {    netif = ip_route(&(pcb->remote_ip));
438      /* no outgoing network interface could be found? */
439      if (netif == NULL) {
440      LWIP_DEBUGF(UDP_DEBUG | 1, ("udp_send: No route to 0x%lx\n", pcb->remote_ip.addr));      LWIP_DEBUGF(UDP_DEBUG | 1, ("udp_send: No route to 0x%lx\n", pcb->remote_ip.addr));
441      UDP_STATS_INC(udp.rterr);      UDP_STATS_INC(udp.rterr);
442      return ERR_RTE;      return ERR_RTE;

Legend:
Removed from v.1.64  
changed lines
  Added in v.1.65

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