]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Pim hello should be sent with 0 hold time on address change on old src ip
authorsaravanank <saravanank@vmware.com>
Thu, 19 Mar 2020 10:06:46 +0000 (03:06 -0700)
committersaravanank <saravanank@vmware.com>
Thu, 19 Mar 2020 10:06:46 +0000 (03:06 -0700)
RCA: This was todo item in current code base

Fix: Hello sent with 0 hold time before we update the pim ifp primary address

Signed-off-by: Saravanan K <saravanank@vmware.com>
pimd/pim_iface.c
pimd/pim_pim.c
pimd/pim_pim.h

index cb31878e01516d08e47a89ab58076179c177a2ff..647f1976e3ca45fef417661791b80fb7521b6141 100644 (file)
@@ -275,7 +275,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.
@@ -320,6 +320,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;
        }
 
index 8d7a921cf4db8ff6336f248d908c2325bf46ca24..9c99d59672416068007b08d33778b9e5d9cc6a30 100644 (file)
@@ -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)
 {
@@ -662,7 +661,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;
 
index e930ab7c2db5c118d304d4bfac55df9f10d8d7ec..b9fdb14dc0ea5d19aa062736caa1d7d37a701bff 100644 (file)
@@ -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 */