summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2016-08-11 17:51:41 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2016-08-16 16:10:52 +0200
commit6bcd6029f1143b62f005c3508df3b3021787f898 (patch)
tree6434580d8e48892595dfa7de2bee9a0db55f9293
parent120c658793d960796030793b74385a9fe9888ebb (diff)
pimd: don't break with missing SO_BINDTODEVICE
This effectively a partial revert of commit 61ea395... "pimd: Bind pim sockets to interface they are associated with" Note this isn't really a proper fix, it just clears the build breakage on BSD without improving the usage of multiple sockets. Reported-by: Martin Winter <mwinter@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
-rw-r--r--pimd/pim_sock.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pimd/pim_sock.c b/pimd/pim_sock.c
index a2e166f796..e04cd41575 100644
--- a/pimd/pim_sock.c
+++ b/pimd/pim_sock.c
@@ -79,6 +79,7 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, int ifindex, int loop)
return PIM_SOCK_ERR_SOCKET;
}
+#ifdef SO_BINDTODEVICE
if (protocol == IPPROTO_PIM)
{
int ret;
@@ -104,7 +105,10 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, int ifindex, int loop)
return PIM_SOCK_ERR_BIND;
}
}
-
+#else
+ /* XXX: use IP_PKTINFO / IP_RECVIF to emulate behaviour? Or change to
+ * only use 1 socket for all interfaces? */
+#endif
/* Needed to obtain destination address from recvmsg() */
{