From 71533999cb8daed43ed01baa92d6b45510203751 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 18 Nov 2019 10:48:49 -0500 Subject: [PATCH] pimd: Dissallow obvious addresses from being the RP When configuring a RP, dissallow the choice of 0.0.0.0 or 255.255.255.255 as the address as that they make no sense what so ever. Signed-off-by: Donald Sharp --- pimd/pim_rp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c index 35c040c64c..717566738f 100644 --- a/pimd/pim_rp.c +++ b/pimd/pim_rp.c @@ -457,6 +457,10 @@ int pim_rp_new(struct pim_instance *pim, struct in_addr rp_addr, struct pim_upstream *up; struct listnode *upnode; + if (rp_addr.s_addr == INADDR_ANY || + rp_addr.s_addr == INADDR_NONE) + return PIM_RP_BAD_ADDRESS; + rp_info = XCALLOC(MTYPE_PIM_RP, sizeof(*rp_info)); rp_info->rp.rpf_addr.family = AF_INET; -- 2.39.5