summaryrefslogtreecommitdiffstats
path: root/pimd/pim_tlv.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-11-07 21:45:40 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-12-22 02:26:14 +0100
commita7762e076597867bb75c8a60fb184f924035ed2e (patch)
treec0800948f074b9f33974f8ad8ac16147094ad698 /pimd/pim_tlv.c
parentpimd: Modify pim_parse_addr_group to use 'struct prefix_sg' (diff)
downloadfrr-a7762e076597867bb75c8a60fb184f924035ed2e.tar.xz
frr-a7762e076597867bb75c8a60fb184f924035ed2e.zip
pimd: Modify pim_parse_addr_source to use 'struct prefix_sg'
Modify the pim_parse_addr_source function to take a 'struct prefix_sg' and to fill in the src data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_tlv.c')
-rw-r--r--pimd/pim_tlv.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/pimd/pim_tlv.c b/pimd/pim_tlv.c
index 3d48c05af..dcded9503 100644
--- a/pimd/pim_tlv.c
+++ b/pimd/pim_tlv.c
@@ -568,7 +568,7 @@ pim_parse_addr_group (struct prefix_sg *sg,
}
int
-pim_parse_addr_source(struct prefix *p,
+pim_parse_addr_source(struct prefix_sg *sg,
uint8_t *flags,
const uint8_t *buf,
int buf_size)
@@ -612,9 +612,7 @@ pim_parse_addr_source(struct prefix *p,
return -3;
}
- p->family = AF_INET; /* notice: AF_INET != PIM_MSG_ADDRESS_FAMILY_IPV4 */
- memcpy(&p->u.prefix4, addr, sizeof(struct in_addr));
- p->prefixlen = mask_len;
+ memcpy(&sg->src, addr, sizeof(struct in_addr));
/*
RFC 4601: 4.9.1 Encoded Source and Group Address Formats
@@ -626,9 +624,9 @@ pim_parse_addr_source(struct prefix *p,
and 128 for IPv6 native). A router SHOULD ignore any messages
received with any other mask length.
*/
- if (p->prefixlen != 32) {
+ if (mask_len != 32) {
zlog_warn("%s: IPv4 bad source address mask: %d",
- __PRETTY_FUNCTION__, p->prefixlen);
+ __PRETTY_FUNCTION__, mask_len);
return -4;
}