From d3aded9982a2928f98d7b983593bae304efcf268 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 27 Jun 2016 12:54:30 -0400 Subject: [PATCH] pimd: Allow (*,G) to work properly. When the kernel looks up a *,G route it expects the incoming interface to be part of the outgoing interface ttl list. Signed-off-by: Donald Sharp --- pimd/pim_mroute.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index f85f422298..4bf490f456 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -524,6 +524,7 @@ int pim_mroute_del_vif(int vif_index) int pim_mroute_add(struct mfcctl *mc) { int err; + int orig; qpim_mroute_add_last = pim_time_monotonic_sec(); ++qpim_mroute_add_events; @@ -534,8 +535,22 @@ int pim_mroute_add(struct mfcctl *mc) return -1; } + /* The linux kernel *expects* the incoming + * vif to be part of the outgoing list + * in the case of a (*,G). + */ + if (mc->mfcc_origin.s_addr == INADDR_ANY) + { + orig = mc->mfcc_ttls[mc->mfcc_parent]; + mc->mfcc_ttls[mc->mfcc_parent] = 1; + } + err = setsockopt(qpim_mroute_socket_fd, IPPROTO_IP, MRT_ADD_MFC, mc, sizeof(*mc)); + + if (mc->mfcc_origin.s_addr == INADDR_ANY) + mc->mfcc_ttls[mc->mfcc_parent] = orig; + if (err) { int e = errno; zlog_warn("%s %s: failure: setsockopt(fd=%d,IPPROTO_IP,MRT_ADD_MFC): errno=%d: %s", -- 2.39.5