diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-01-18 13:24:24 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-01-18 13:24:24 +0100 |
commit | c2403b25989831d8a12fedc3e1af38c58520510d (patch) | |
tree | ec06aa355d093acae021d7b22782c96ed2428a38 /pimd/pim_sock.c | |
parent | zebra: Fix kernel_get_ipmr_sg_stats to return an value (diff) | |
download | frr-c2403b25989831d8a12fedc3e1af38c58520510d.tar.xz frr-c2403b25989831d8a12fedc3e1af38c58520510d.zip |
pimd: 'struct ip_mreqn' is not available on all platforms
Signed-off-by: Donald Sharp <sharpd@cumulusnetowrks.com>
Diffstat (limited to 'pimd/pim_sock.c')
-rw-r--r-- | pimd/pim_sock.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pimd/pim_sock.c b/pimd/pim_sock.c index 43fe7b7d1..5fcdfe1b9 100644 --- a/pimd/pim_sock.c +++ b/pimd/pim_sock.c @@ -115,7 +115,11 @@ pim_socket_bind (int fd, struct interface *ifp) int pim_socket_mcast(int protocol, struct in_addr ifaddr, int ifindex, u_char loop) { int rcvbuf = 1024 * 1024 * 8; +#ifdef HAVE_STRUCT_IP_MREQN_IMR_IFINDEX struct ip_mreqn mreq; +#else + struct ip_mreq mreq; +#endif int fd; fd = pim_socket_raw(protocol); @@ -218,7 +222,12 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, int ifindex, u_char lo } memset (&mreq, 0, sizeof (mreq)); +#ifdef HAVE_STRUCT_IP_MREQN_IMR_IFINDEX mreq.imr_ifindex = ifindex; +#else + mreq.imr_interface = ifindex; +#endif + if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, (void *) &mreq, sizeof(mreq))) { zlog_warn("Could not set Outgoing Interface Option on socket fd=%d: errno=%d: %s", |