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>
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;
#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,
}
{
- 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",
char buf[256];
struct in_pktinfo *pktinfo;
u_long src;
- int on;
+ u_char on;
if (!(ifp->flags & IFF_UP))
return;