summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-06-13 13:49:38 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-07-24 13:51:39 -0400
commita5b6bd2be38e943f9a028e7025e191bb92b25c94 (patch)
tree69d733765123b0c3c9ecc6479e941cdde714154f
parente0ae31b88690aa93159a018e383e4e6ba6dc9937 (diff)
pimd: Ensure packet received on vrf interface is configured for pim
In a vrf configuration, when we receive a pim packet we lookup the correct incoming interface. There exists a chance that the correct incoming interface has not been configured to use pim yet. gracefully bow out and do nothing with the packet. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--pimd/pim_pim.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c
index 80ce6f066f..5b9d6effc8 100644
--- a/pimd/pim_pim.c
+++ b/pimd/pim_pim.c
@@ -327,7 +327,13 @@ static int pim_sock_read(struct thread *t)
* it's the right interface because we bind to it
*/
ifp = if_lookup_by_index(ifindex, pim_ifp->pim->vrf_id);
-
+ if (!ifp->info) {
+ if (PIM_DEBUG_PIM_PACKETS)
+ zlog_debug(
+ "%s: Received incoming pim packet on interface not yet configured for pim %s",
+ __PRETTY_FUNCTION__, ifp->name);
+ goto done;
+ }
int fail = pim_pim_packet(ifp, buf, len);
if (fail) {
if (PIM_DEBUG_PIM_PACKETS)