summaryrefslogtreecommitdiffstats
path: root/ldpd
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2016-11-12 22:05:08 +0100
committerRenato Westphal <renato@opensourcerouting.org>2016-11-25 14:46:06 +0100
commitc5bdb09fd9d18ac0524a14c90f79cfad95afefd7 (patch)
treea74b32bb6d4df5fc1075b4d71fe39fc55e2538d4 /ldpd
parentpimd/zebra: fix setting of IP_MULTICAST_LOOP on OpenBSD (diff)
downloadfrr-c5bdb09fd9d18ac0524a14c90f79cfad95afefd7.tar.xz
frr-c5bdb09fd9d18ac0524a14c90f79cfad95afefd7.zip
*: create a helper function to set the IP_MULTICAST_LOOP sockoption
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ldpd')
-rw-r--r--ldpd/socket.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/ldpd/socket.c b/ldpd/socket.c
index cf352d720..1bb083740 100644
--- a/ldpd/socket.c
+++ b/ldpd/socket.c
@@ -421,15 +421,7 @@ sock_set_ipv4_mcast(struct iface *iface)
int
sock_set_ipv4_mcast_loop(int fd)
{
- uint8_t loop = 0;
-
- if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP,
- (char *)&loop, sizeof(loop)) < 0) {
- log_warn("%s: error setting IP_MULTICAST_LOOP", __func__);
- return (-1);
- }
-
- return (0);
+ return (setsockopt_ipv4_multicast_loop(fd, 0));
}
int