diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2022-01-14 16:38:41 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2022-02-14 06:45:03 +0100 |
| commit | 0d360092045fdfca1a363bbc522deafbb79255e8 (patch) | |
| tree | 9ce974e3fb9af2dfb2b6ea5e35c92328dbd115a0 /pimd/pim_assert.c | |
| parent | 16763d77a39ae0cd84e6fcf4b3f6a05f10d94c38 (diff) | |
pim6d: more TLV parse/encode IPv6 preparation
More proliferation of pim_addr to work towards IPV6.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'pimd/pim_assert.c')
| -rw-r--r-- | pimd/pim_assert.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/pimd/pim_assert.c b/pimd/pim_assert.c index 3c38ebd76b..f4b6e81bd6 100644 --- a/pimd/pim_assert.c +++ b/pimd/pim_assert.c @@ -216,7 +216,8 @@ int pim_assert_recv(struct interface *ifp, struct pim_neighbor *neigh, struct in_addr src_addr, uint8_t *buf, int buf_size) { pim_sgaddr sg; - struct prefix msg_source_addr; + pim_addr msg_source_addr; + bool wrong_af = false; struct pim_assert_metric msg_metric; int offset; uint8_t *curr; @@ -246,8 +247,9 @@ int pim_assert_recv(struct interface *ifp, struct pim_neighbor *neigh, /* Parse assert source addr */ - offset = pim_parse_addr_ucast(&msg_source_addr, curr, curr_size); - if (offset < 1) { + offset = pim_parse_addr_ucast(&msg_source_addr, curr, curr_size, + &wrong_af); + if (offset < 1 || wrong_af) { char src_str[INET_ADDRSTRLEN]; pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str)); zlog_warn("%s: pim_parse_addr_ucast() failure: from %s on %s", @@ -286,15 +288,13 @@ int pim_assert_recv(struct interface *ifp, struct pim_neighbor *neigh, if (PIM_DEBUG_PIM_TRACE) { char neigh_str[INET_ADDRSTRLEN]; - char source_str[INET_ADDRSTRLEN]; pim_inet4_dump("<neigh?>", src_addr, neigh_str, sizeof(neigh_str)); - pim_inet4_dump("<src?>", msg_source_addr.u.prefix4, source_str, - sizeof(source_str)); zlog_debug( - "%s: from %s on %s: (S,G)=(%s,%pPAs) pref=%u metric=%u rpt_bit=%u", - __func__, neigh_str, ifp->name, source_str, &sg.grp, - msg_metric.metric_preference, msg_metric.route_metric, + "%s: from %s on %s: (S,G)=(%pPAs,%pPAs) pref=%u metric=%u rpt_bit=%u", + __func__, neigh_str, ifp->name, &msg_source_addr, + &sg.grp, msg_metric.metric_preference, + msg_metric.route_metric, PIM_FORCE_BOOLEAN(msg_metric.rpt_bit_flag)); } @@ -304,8 +304,7 @@ int pim_assert_recv(struct interface *ifp, struct pim_neighbor *neigh, assert(pim_ifp); ++pim_ifp->pim_ifstat_assert_recv; - return dispatch_assert(ifp, msg_source_addr.u.prefix4, sg.grp, - msg_metric); + return dispatch_assert(ifp, msg_source_addr, sg.grp, msg_metric); } /* |
