summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2020-03-24 10:19:17 -0400
committerGitHub <noreply@github.com>2020-03-24 10:19:17 -0400
commite89bb41d803cb6a0eb49542143365ecceafbe33e (patch)
tree737a30169cc8a1bead6fab1aa17bb688c78a1b91
parentbb1cceed4a7cc67cc8ebf3360cd15eca31efa5a9 (diff)
parentb279f95c7097dd66f43d4be09c0071ce1fdb83c5 (diff)
Merge pull request #6047 from sarav511/hold0
pimd: Pim hello should be sent with 0 hold time on address change onold src ip
-rw-r--r--pimd/pim_iface.c6
-rw-r--r--pimd/pim_pim.c3
-rw-r--r--pimd/pim_pim.h1
3 files changed, 7 insertions, 3 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index d05790d33e..07c4172f22 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -277,7 +277,7 @@ static void pim_addr_change(struct interface *ifp)
1) Before an interface goes down or changes primary IP address, a
Hello message with a zero HoldTime should be sent immediately
(with the old IP address if the IP address changed).
- -- FIXME See CAVEAT C13
+ -- Done at the caller of the function as new ip already updated here
2) After an interface has changed its IP address, it MUST send a
Hello message with its new IP address.
@@ -322,6 +322,10 @@ static int detect_primary_address_change(struct interface *ifp,
}
if (changed) {
+ /* Before updating pim_ifp send Hello time with 0 hold time */
+ if (PIM_IF_TEST_PIM(pim_ifp->options)) {
+ pim_hello_send(ifp, 0 /* zero-sec holdtime */);
+ }
pim_ifp->primary_address = new_prim_addr;
}
diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c
index a76fbed203..f37c140bf2 100644
--- a/pimd/pim_pim.c
+++ b/pimd/pim_pim.c
@@ -42,7 +42,6 @@
#include "pim_bsm.h"
static int on_pim_hello_send(struct thread *t);
-static int pim_hello_send(struct interface *ifp, uint16_t holdtime);
static const char *pim_pim_msgtype2str(enum pim_msg_type type)
{
@@ -689,7 +688,7 @@ static int hello_send(struct interface *ifp, uint16_t holdtime)
return 0;
}
-static int pim_hello_send(struct interface *ifp, uint16_t holdtime)
+int pim_hello_send(struct interface *ifp, uint16_t holdtime)
{
struct pim_interface *pim_ifp = ifp->info;
diff --git a/pimd/pim_pim.h b/pimd/pim_pim.h
index e930ab7c2d..b9fdb14dc0 100644
--- a/pimd/pim_pim.h
+++ b/pimd/pim_pim.h
@@ -59,4 +59,5 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len);
int pim_msg_send(int fd, struct in_addr src, struct in_addr dst,
uint8_t *pim_msg, int pim_msg_size, const char *ifname);
+int pim_hello_send(struct interface *ifp, uint16_t holdtime);
#endif /* PIM_PIM_H */