diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2016-08-04 15:07:26 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetwroks.com> | 2016-08-08 03:05:26 +0200 |
commit | 4a3867d0d331ab64311f517bfb39bddfc933c9ee (patch) | |
tree | bbfb0e3efa099b216058d16937ec442d1d085a37 /lib/sockopt.h | |
parent | ospf6d: fix sendmsg on OpenBSD (diff) | |
download | frr-4a3867d0d331ab64311f517bfb39bddfc933c9ee.tar.xz frr-4a3867d0d331ab64311f517bfb39bddfc933c9ee.zip |
lib: fix setting of IPv4 multicast sockopts on OpenBSD
OpenBSD doesn't support the "ifindex hack" derived from RFC 1724 which
allows an ifindex to be encoded in the imr_interface field (in_addr)
of the ip_mreq structure. OpenBSD also doesn't support the RFC3678
Protocol-Independent socket API extensions, which allows an interface
to be specified by its ifindex. With that said, in OpenBSD we still need
to specify an interface by its IP address. This patch adds an exception
in the multicast sockopt functions to handle this case.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/sockopt.h')
-rw-r--r-- | lib/sockopt.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sockopt.h b/lib/sockopt.h index cb14efc7b..a597314c3 100644 --- a/lib/sockopt.h +++ b/lib/sockopt.h @@ -83,9 +83,10 @@ extern int setsockopt_ipv6_tclass (int, int); (((af) == AF_INET) : SOPT_SIZE_CMSG_IFINDEX_IPV4() \ ? SOPT_SIZE_CMSG_PKTINFO_IPV6()) -extern int setsockopt_ipv4_multicast_if(int sock, +extern int setsockopt_ipv4_multicast_if(int sock, struct in_addr if_addr, unsigned int ifindex); extern int setsockopt_ipv4_multicast(int sock, int optname, + struct in_addr if_addr, unsigned int mcast_addr, unsigned int ifindex); extern int setsockopt_ipv4_tos(int sock, int tos); |