return true;
}
-int pim_bsm_process(struct interface *ifp, struct ip *ip_hdr, uint8_t *buf,
+int pim_bsm_process(struct interface *ifp, pim_sgaddr *sg, uint8_t *buf,
uint32_t buf_size, bool no_fwd)
{
struct bsm_hdr *bshdr;
}
#if PIM_IPV == 4
- if (ip_hdr->ip_dst.s_addr == qpim_all_pim_routers_addr.s_addr)
+ if (!pim_addr_cmp(sg->grp, qpim_all_pim_routers_addr))
#else
if (0)
#endif
* match RPF towards the BSR's IP address, or they have
* no-forward set
*/
- if (!no_fwd
- && !pim_nht_bsr_rpf_check(pim, bshdr->bsr_addr.addr, ifp,
- ip_hdr->ip_src)) {
+ if (!no_fwd && !pim_nht_bsr_rpf_check(pim, bshdr->bsr_addr.addr,
+ ifp, sg->src)) {
if (PIM_DEBUG_BSM)
zlog_debug(
- "BSM check: RPF to BSR %s is not %pI4%%%s",
- bsr_str, &ip_hdr->ip_src, ifp->name);
+ "BSM check: RPF to BSR %s is not %pPA%%%s",
+ bsr_str, &sg->src, ifp->name);
pim->bsm_dropped++;
return -1;
}
- } else if (if_address_is_local(&ip_hdr->ip_dst, AF_INET,
- pim->vrf->vrf_id)) {
+ } else if (if_address_is_local(&sg->grp, PIM_AF, pim->vrf->vrf_id)) {
/* Unicast BSM received - if ucast bsm not enabled on
* the interface, drop it
*/
void pim_bsm_proc_free(struct pim_instance *pim);
void pim_bsm_clear(struct pim_instance *pim);
void pim_bsm_write_config(struct vty *vty, struct interface *ifp);
-int pim_bsm_process(struct interface *ifp,
- struct ip *ip_hdr,
- uint8_t *buf,
- uint32_t buf_size,
- bool no_fwd);
+int pim_bsm_process(struct interface *ifp, pim_sgaddr *sg, uint8_t *buf,
+ uint32_t buf_size, bool no_fwd);
bool pim_bsm_new_nbr_fwd(struct pim_neighbor *neigh, struct interface *ifp);
struct bsgrp_node *pim_bsm_get_bsgrp_node(struct bsm_scope *scope,
struct prefix *grp);
}
bool pim_nht_bsr_rpf_check(struct pim_instance *pim, struct in_addr bsr_addr,
- struct interface *src_ifp, struct in_addr src_ip)
+ struct interface *src_ifp, pim_addr src_ip)
{
struct pim_nexthop_cache *pnc = NULL;
struct pim_nexthop_cache lookup;
void pim_nht_bsr_del(struct pim_instance *pim, struct in_addr bsr_addr);
/* RPF(bsr_addr) == src_ip%src_ifp? */
bool pim_nht_bsr_rpf_check(struct pim_instance *pim, struct in_addr bsr_addr,
- struct interface *src_ifp, struct in_addr src_ip);
+ struct interface *src_ifp, pim_addr src_ip);
#endif
pim_msg_len - PIM_MSG_HEADER_LEN);
break;
case PIM_MSG_TYPE_BOOTSTRAP:
- return pim_bsm_process(ifp, ip_hdr, pim_msg, pim_msg_len,
- no_fwd);
+ return pim_bsm_process(ifp, ip_hdr->ip_src, ip_hdr->ip_dst,
+ pim_msg, pim_msg_len, no_fwd);
break;
default: