udp.h, udp.c, sockets.c: Changes for "#20503 IGMP Improvement". Add IP_MULTICAST_IF option in socket API, and a new field "multicast_ip" in "struct udp_pcb" (for netconn and raw API users), only if LWIP_IGMP=1. Add getsockopt processing for IP_MULTICAST_TTL and IP_MULTICAST_IF.

This commit is contained in:
fbernon
2007-09-15 15:19:41 +00:00
parent 93c487fb75
commit 2bdd916b06
4 changed files with 60 additions and 8 deletions

View File

@@ -355,8 +355,14 @@ udp_send(struct udp_pcb *pcb, struct pbuf *p)
return err;
}
}
/* find the outgoing network interface for this packet */
#if LWIP_IGMP
netif = ip_route((ip_addr_ismulticast(&(pcb->remote_ip)))?(&(pcb->multicast_ip)):(&(pcb->remote_ip)));
#else
netif = ip_route(&(pcb->remote_ip));
#endif /* LWIP_IGMP */
/* no outgoing network interface could be found? */
if (netif == NULL) {
LWIP_DEBUGF(UDP_DEBUG | 1, ("udp_send: No route to 0x%"X32_F"\n", pcb->remote_ip.addr));