]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: IGMP sockets need to be iface-bound too
authorDavid Lamparter <equinox@opensourcerouting.org>
Tue, 20 Apr 2021 03:10:17 +0000 (05:10 +0200)
committerMartin Winter <mwinter@opensourcerouting.org>
Mon, 5 Jul 2021 23:44:24 +0000 (01:44 +0200)
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>
pimd/pim_sock.c

index 504519c8a41006bda36cde59f105ea7106d1d001..05b0f92a4b65fce0fc5e353f8043ba87749344b1 100644 (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