summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-09-02 20:34:14 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-12-22 02:26:08 +0100
commitfa8da98c263029568e9842a457be542062801b07 (patch)
tree579341fd1b770943e83d1608e633c7418e0717fc
parentpimd: Fix compile error on some platforms. (diff)
downloadfrr-fa8da98c263029568e9842a457be542062801b07.tar.xz
frr-fa8da98c263029568e9842a457be542062801b07.zip
pimd: Fix up rp initialization breakage
When I converted over to using 'struct prefix' I broke the initialization of the rp. In addition, I used the wrong AFI type to switch on in pim_rpf.c Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--pimd/pim_rp.c5
-rw-r--r--pimd/pim_rpf.c8
2 files changed, 7 insertions, 6 deletions
diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c
index 05b6623e8..612c08e1b 100644
--- a/pimd/pim_rp.c
+++ b/pimd/pim_rp.c
@@ -91,6 +91,7 @@ pim_rp_init (void)
return;
str2prefix ("224.0.0.0/4", &rp_info->group);
+ rp_info->group.family = AF_INET;
rp_info->rp.rpf_addr.family = AF_INET;
rp_info->rp.rpf_addr.u.prefix4.s_addr = INADDR_NONE;
tail = rp_info;
@@ -192,8 +193,8 @@ pim_rp_new (const char *rp, const char *group_range)
if (!result)
return -1;
-
- result = inet_pton (rp_info->rp.rpf_addr.family, rp, &rp_info->rp.rpf_addr.u.prefix);
+ rp_info->rp.rpf_addr.family = AF_INET;
+ result = inet_pton (rp_info->rp.rpf_addr.family, rp, &rp_info->rp.rpf_addr.u.prefix4);
if (result <= 0)
return -1;
diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c
index 662d4aaf5..f3bdb6830 100644
--- a/pimd/pim_rpf.c
+++ b/pimd/pim_rpf.c
@@ -245,10 +245,10 @@ pim_rpf_addr_is_inaddr_none (struct pim_rpf *rpf)
{
switch (rpf->rpf_addr.family)
{
- case AFI_IP:
+ case AF_INET:
return rpf->rpf_addr.u.prefix4.s_addr == INADDR_NONE;
break;
- case AFI_IP6:
+ case AF_INET6:
zlog_warn ("%s: v6 Unimplmeneted", __PRETTY_FUNCTION__);
return 1;
break;
@@ -265,10 +265,10 @@ pim_rpf_addr_is_inaddr_any (struct pim_rpf *rpf)
{
switch (rpf->rpf_addr.family)
{
- case AFI_IP:
+ case AF_INET:
return rpf->rpf_addr.u.prefix4.s_addr == INADDR_ANY;
break;
- case AFI_IP6:
+ case AF_INET6:
zlog_warn ("%s: v6 Unimplmented", __PRETTY_FUNCTION__);
return 1;
break;