diff options
author | Amol Lad <amol.lad@4rf.com> | 2020-12-17 09:08:06 +0100 |
---|---|---|
committer | Reuben Dowle <reuben.dowle@4rf.com> | 2021-04-05 23:23:42 +0200 |
commit | 9084e209611496f98c4960928fbecd51095ebfd5 (patch) | |
tree | 2f98d1e21c230a7f2871fcfbd174a5fe6926a593 /nhrpd/nhrp_multicast.c | |
parent | nhrpd: Use ethertype defines instead of hard-coded values (diff) | |
download | frr-9084e209611496f98c4960928fbecd51095ebfd5.tar.xz frr-9084e209611496f98c4960928fbecd51095ebfd5.zip |
nhrpd: Introduce new - nflog mutlicast-nflog-group (1-65535) - command
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
Diffstat (limited to 'nhrpd/nhrp_multicast.c')
-rw-r--r-- | nhrpd/nhrp_multicast.c | 23 |
1 files changed, 10 insertions, 13 deletions
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); |