mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-06-14 08:53:56 +08:00
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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user