summaryrefslogtreecommitdiff
path: root/pimd/pim_tlv.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-11-07 15:45:40 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-12-21 20:26:14 -0500
commita7762e076597867bb75c8a60fb184f924035ed2e (patch)
treec0800948f074b9f33974f8ad8ac16147094ad698 /pimd/pim_tlv.c
parentbce0e645214306808047f3ffd321abaa844c3e97 (diff)
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 3d48c05afc..dcded95035 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;
}