lwip-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-members] request info on David's patch


From: leon . woestenberg
Subject: [lwip-members] request info on David's patch
Date: Mon, 10 Feb 2003 12:26:46 +0100

Hello David, others,


could you pls. clarify this patch in udp.c?

Suppose I have two redundant network links to a remote server from my
lwIP device, using the raw API. I am setting up a udp pcb to talk with the
remote server. I bind it to any local interface address IP_ADDR_ANY.

udp_connect() would force the lwIP device to only listen on one of the
interfaces, as its local address is bound to a particular interface by your
patch.

Can your functionality be solved in the netconn() instead??

Leon.


  /* Nail down local IP for netconn_addr()/getsockname() */
  if(ip_addr_isany(&pcb->local_ip) && !ip_addr_isany(&pcb->remote_ip)) {
    struct netif *netif;

    if((netif = ip_route(&(pcb->remote_ip))) == NULL) {
      DEBUGF(UDP_DEBUG, ("udp_connect: No route to 0x%lx\n",
pcb->remote_ip.addr));
#ifdef UDP_STATS
      ++lwip_stats.udp.rterr;
#endif /* UDP_STATS */
      return ERR_RTE;
    }

    pcb->local_ip = netif->ip_addr;
  } else if(ip_addr_isany(&pcb->remote_ip)) {
    pcb->local_ip.addr = 0;
  }




Leon Woestenberg

Axon Digital Design
Phone: +31 13 511 6666
Fax: +31 13 511 4151
web: www.axon.tv






reply via email to

[Prev in Thread] Current Thread [Next in Thread]