diff options
| author | Jafar Al-Gharaibeh <Jafaral@users.noreply.github.com> | 2019-05-28 10:26:28 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-28 10:26:28 -0500 |
| commit | bda0241599246636bebde6143f20ccdec5290570 (patch) | |
| tree | e67f265032fd4fa91e2cfe00d00c233743c7dc31 /pimd/pim_pim.c | |
| parent | f6fd430e44e5eb219e11091ff18b31ea871f2122 (diff) | |
| parent | 19de48b9814b1cda9968a5320545a4c6bbd31d10 (diff) | |
Merge pull request #4239 from sarav511/rp
pimd: PIM Bootstrap Message Processing
Diffstat (limited to 'pimd/pim_pim.c')
| -rw-r--r-- | pimd/pim_pim.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c index 71b0d47928..12b28ed9af 100644 --- a/pimd/pim_pim.c +++ b/pimd/pim_pim.c @@ -39,6 +39,7 @@ #include "pim_msg.h" #include "pim_register.h" #include "pim_errors.h" +#include "pim_bsm.h" static int on_pim_hello_send(struct thread *t); static int pim_hello_send(struct interface *ifp, uint16_t holdtime); @@ -148,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) @@ -185,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 */ @@ -273,6 +276,11 @@ 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) { zlog_debug( @@ -634,7 +642,7 @@ static int hello_send(struct interface *ifp, uint16_t holdtime) zassert(pim_msg_size >= PIM_PIM_MIN_LEN); zassert(pim_msg_size <= PIM_PIM_BUFSIZE_WRITE); - pim_msg_build_header(pim_msg, pim_msg_size, PIM_MSG_TYPE_HELLO); + pim_msg_build_header(pim_msg, pim_msg_size, PIM_MSG_TYPE_HELLO, false); if (pim_msg_send(pim_ifp->pim_sock_fd, pim_ifp->primary_address, qpim_all_pim_routers_addr, pim_msg, pim_msg_size, |
