summaryrefslogtreecommitdiff
path: root/pimd/pim_pim.c
diff options
context:
space:
mode:
authorsaravanank <saravanank@vmware.com>2019-05-04 06:04:17 -0700
committersaravanank <saravanank@vmware.com>2019-05-14 21:40:50 -0700
commit5acde1cfbf669f4a099c6663ef21a2ecac7f2a1e (patch)
tree866279bac2d155f14fc95585d7de34cfd3379f3c /pimd/pim_pim.c
parentd57a8bbf4591ae00dcaa0f9dac29cc936cce505d (diff)
pimd: PIM Bootstrap packet processing
1. Packet validation as per RFC 5059 Sec 3.1.3 We won't supporting scope zone BSM as of now, they are dropped now. Order of the check slightly be changed in code for optimization. if ((DirectlyConnected(BSM.src_ip_address) == FALSE) OR (we have no Hello state for BSM.src_ip_address)) { drop the Bootstrap message silently } if (BSM.dst_ip_address == ALL-PIM-ROUTERS) { if (BSM.no_forward_bit == 0) { if (BSM.src_ip_address != RPF_neighbor(BSM.BSR_ip_address)) { drop the Bootstrap message silently } } else if ((any previous BSM for this scope has been accepted) OR (more than BS_Period has elapsed since startup)) { #only accept no-forward BSM if quick refresh on startup drop the Bootstrap message silently } } else if ((Unicast BSM support enabled) AND (BSM.dst_ip_address is one of my addresses)) { if ((any previous BSM for this scope has been accepted) OR (more than BS_Period has elapsed since startup)) { #the packet was unicast, but this wasn't #a quick refresh on startup drop the Bootstrap message silently } } else { drop the Bootstrap message silently } 2. Nexthop tracking registration for BSR 3. RPF check for BSR Message. Zebra Lookup based rpf check for new BSR NHT cache(pnc) based lookup for old BSR Signed-off-by: Saravanan K <saravanank@vmware.com>
Diffstat (limited to 'pimd/pim_pim.c')
-rw-r--r--pimd/pim_pim.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c
index e9d44b9c3c..12b28ed9af 100644
--- a/pimd/pim_pim.c
+++ b/pimd/pim_pim.c
@@ -149,6 +149,7 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len)
uint16_t checksum; /* computed checksum */
struct pim_neighbor *neigh;
struct pim_msg_header *header;
+ bool no_fwd;
if (len < sizeof(*ip_hdr)) {
if (PIM_DEBUG_PIM_PACKETS)
@@ -186,6 +187,7 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len)
/* for computing checksum */
header->checksum = 0;
+ no_fwd = header->Nbit;
if (header->type == PIM_MSG_TYPE_REGISTER) {
/* First 8 byte header checksum */
@@ -274,6 +276,10 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len)
pim_msg + PIM_MSG_HEADER_LEN,
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);
+ break;
default:
if (PIM_DEBUG_PIM_PACKETS) {