From 9084e209611496f98c4960928fbecd51095ebfd5 Mon Sep 17 00:00:00 2001 From: Amol Lad Date: Thu, 17 Dec 2020 13:38:06 +0530 Subject: nhrpd: Introduce new - nflog mutlicast-nflog-group (1-65535) - command Signed-off-by: Reuben Dowle --- nhrpd/nhrp_multicast.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'nhrpd/nhrp_multicast.c') diff --git a/nhrpd/nhrp_multicast.c b/nhrpd/nhrp_multicast.c index 42e3baaee..822a63b5f 100644 --- a/nhrpd/nhrp_multicast.c +++ b/nhrpd/nhrp_multicast.c @@ -30,7 +30,7 @@ DEFINE_MTYPE_STATIC(NHRPD, NHRP_MULTICAST, "NHRP Multicast") -static int netlink_mcast_nflog_group; +int netlink_mcast_nflog_group; static int netlink_mcast_log_fd = -1; static struct thread *netlink_mcast_log_thread; @@ -201,15 +201,7 @@ static void netlink_mcast_log_register(int fd, int group) zbuf_free(zb); } -static int nhrp_multicast_free(struct interface *ifp, - struct nhrp_multicast *mcast) -{ - list_del(&mcast->list_entry); - XFREE(MTYPE_NHRP_MULTICAST, mcast); - return 0; -} - -static void netlink_mcast_set_nflog_group(struct interface *ifp, int nlgroup) +void netlink_mcast_set_nflog_group(int nlgroup) { if (netlink_mcast_log_fd >= 0) { THREAD_OFF(netlink_mcast_log_thread); @@ -232,6 +224,14 @@ static void netlink_mcast_set_nflog_group(struct interface *ifp, int nlgroup) } } +static int nhrp_multicast_free(struct interface *ifp, + struct nhrp_multicast *mcast) +{ + list_del(&mcast->list_entry); + XFREE(MTYPE_NHRP_MULTICAST, mcast); + return 0; +} + int nhrp_multicast_add(struct interface *ifp, afi_t afi, union sockunion *nbma_addr) { @@ -252,9 +252,6 @@ int nhrp_multicast_add(struct interface *ifp, afi_t afi, }; list_add_tail(&mcast->list_entry, &nifp->afi[afi].mcastlist_head); - if (netlink_mcast_log_fd == -1) - netlink_mcast_set_nflog_group(ifp, MCAST_NFLOG_GROUP); - sockunion2str(nbma_addr, buf, sizeof(buf)); debugf(NHRP_DEBUG_COMMON, "Adding multicast entry (%s)", buf); -- cgit v1.2.3