diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2016-11-12 21:39:51 +0100 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2016-11-25 14:46:06 +0100 |
commit | 5736139d4a9192c9ba296d2bddc5bbbd025dfd7f (patch) | |
tree | 8a1fe09a691392f57742f5d04ac47b8d6047724a | |
parent | ripd: fix race condition on input processing (diff) | |
download | frr-5736139d4a9192c9ba296d2bddc5bbbd025dfd7f.tar.xz frr-5736139d4a9192c9ba296d2bddc5bbbd025dfd7f.zip |
pimd/zebra: fix setting of IP_MULTICAST_LOOP on OpenBSD
Linux, FreeBSD and NetBSD (and possibly others too) accept both uint8_t
and int for the IP_MULTICAST_LOOP sockoption. OpenBSD, in the other hand,
accepts only uint8_t. To make setting IP_MULTICAST_LOOP work on every
supported platform, always pass a uint8_t variable as a parameter.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
-rw-r--r-- | pimd/pim_sock.c | 2 | ||||
-rw-r--r-- | pimd/pim_sock.h | 2 | ||||
-rw-r--r-- | pimd/pim_ssmpingd.c | 2 | ||||
-rw-r--r-- | zebra/irdp_packet.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/pimd/pim_sock.c b/pimd/pim_sock.c index a024e3ae0..90b11dcfd 100644 --- a/pimd/pim_sock.c +++ b/pimd/pim_sock.c @@ -68,7 +68,7 @@ int pim_socket_raw(int protocol) return fd; } -int pim_socket_mcast(int protocol, struct in_addr ifaddr, int ifindex, int loop) +int pim_socket_mcast(int protocol, struct in_addr ifaddr, int ifindex, u_char loop) { int fd; diff --git a/pimd/pim_sock.h b/pimd/pim_sock.h index f0a160081..cd29543fa 100644 --- a/pimd/pim_sock.h +++ b/pimd/pim_sock.h @@ -39,7 +39,7 @@ #define PIM_SOCK_ERR_BIND (-11) /* Can't bind to interface */ int pim_socket_raw(int protocol); -int pim_socket_mcast(int protocol, struct in_addr ifaddr, int ifindex, int loop); +int pim_socket_mcast(int protocol, struct in_addr ifaddr, int ifindex, u_char loop); int pim_socket_join(int fd, struct in_addr group, struct in_addr ifaddr, ifindex_t ifindex); int pim_socket_join_source(int fd, ifindex_t ifindex, diff --git a/pimd/pim_ssmpingd.c b/pimd/pim_ssmpingd.c index fe88eba27..daa3c65e3 100644 --- a/pimd/pim_ssmpingd.c +++ b/pimd/pim_ssmpingd.c @@ -151,7 +151,7 @@ static int ssmpingd_socket(struct in_addr addr, int port, int mttl) } { - int loop = 0; + u_char loop = 0; if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, (void *) &loop, sizeof(loop))) { zlog_warn("%s: could not %s Multicast Loopback Option on socket fd=%d: errno=%d: %s", diff --git a/zebra/irdp_packet.c b/zebra/irdp_packet.c index 25c7aff26..290a6180e 100644 --- a/zebra/irdp_packet.c +++ b/zebra/irdp_packet.c @@ -282,7 +282,7 @@ send_packet(struct interface *ifp, char buf[256]; struct in_pktinfo *pktinfo; u_long src; - int on; + u_char on; if (!(ifp->flags & IFF_UP)) return; |