pimd: IGMP sockets need to be iface-bound too

There's an IGMP socket per interface, so they should be bound to that
interface.  Which also makes IGMP work in VRFs.

Fixes: #7889
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
David Lamparter 2021-04-20 05:10:17 +02:00 committed by Martin Winter
parent 12536067cc
commit f06c6e3ef9
No known key found for this signature in database
GPG Key ID: 05A4ECF8C0102306

View File

@ -112,17 +112,15 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, struct interface *ifp,
}
#ifdef SO_BINDTODEVICE
if (protocol == IPPROTO_PIM) {
int ret;
int ret;
ret = pim_socket_bind(fd, ifp);
if (ret) {
close(fd);
zlog_warn(
"Could not set fd: %d for interface: %s to device",
fd, ifp->name);
return PIM_SOCK_ERR_BIND;
}
ret = pim_socket_bind(fd, ifp);
if (ret) {
close(fd);
zlog_warn(
"Could not set fd: %d for interface: %s to device",
fd, ifp->name);
return PIM_SOCK_ERR_BIND;
}
#else
/* XXX: use IP_PKTINFO / IP_RECVIF to emulate behaviour? Or change to