quagga/ripd: Fix two bugs after received SIGHUP signal
authorXufeng Zhang <xufeng.zhang@windriver.com>
Thu, 24 Oct 2013 09:48:41 +0000 (17:48 +0800)
committerPatrick Ohly <patrick.ohly@intel.com>
Fri, 9 Jan 2015 16:34:16 +0000 (08:34 -0800)
There are two problems for ripd implementation after received
SIGHUP signal:
1). ripd didn't clean up ifp->connected list before reload
    configuration file which makes the same advertise packet
    being sent multiple times(depends on how many SIGHUP was recieved).
2). ripd reset ri->split_horizon flag to RIP_NO_SPLIT_HORIZON
    during restart which is different from the flag when ripd is
    firstly started up, leading to unnecessary route to be advertised.

[YOCTO #5266]

(From meta-openembedded rev: 27ba970b9eabd254aea24848420c4d3b8674761f)

Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch [new file with mode: 0644]
meta-openembedded/meta-networking/recipes-protocols/quagga/quagga.inc

diff --git a/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch
new file mode 100644 (file)
index 0000000..4b8c9a9
--- /dev/null
@@ -0,0 +1,50 @@
+ripd: Fix two bugs after received SIGHUP signal
+
+There are two problems for ripd implementation after received
+SIGHUP signal:
+1). ripd didn't clean up ifp->connected list before reload
+    configuration file.
+2). ripd reset ri->split_horizon flag to RIP_NO_SPLIT_HORIZON
+    which lead to the unnecessary route to be advertised.
+
+Upstream-Status: Submitted [http://patchwork.diac24.net/patch/604/]
+
+Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
+Signed-off-by: Joe MacDonald <joe@deserted.net>
+---
+--- a/ripd/rip_interface.c
++++ b/ripd/rip_interface.c
+@@ -500,6 +500,8 @@
+   struct listnode *node;
+   struct interface *ifp;
+   struct rip_interface *ri;
++  struct connected *ifc;
++  struct listnode *conn_node, *next;
+   for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
+     {
+@@ -514,6 +516,13 @@
+         thread_cancel (ri->t_wakeup);
+         ri->t_wakeup = NULL;
+       }
++
++      for (conn_node = listhead (ifp->connected); conn_node; conn_node = next)
++        {
++          ifc = listgetdata (conn_node);
++          next = conn_node->next;
++          listnode_delete (ifp->connected, ifc);
++        }
+     }
+ }
+@@ -548,8 +557,8 @@
+         ri->key_chain = NULL;
+       }
+-      ri->split_horizon = RIP_NO_SPLIT_HORIZON;
+-      ri->split_horizon_default = RIP_NO_SPLIT_HORIZON;
++      ri->split_horizon = RIP_SPLIT_HORIZON;
++      ri->split_horizon_default = RIP_SPLIT_HORIZON;
+       ri->list[RIP_FILTER_IN] = NULL;
+       ri->list[RIP_FILTER_OUT] = NULL;
index 8720876..9d900af 100644 (file)
@@ -31,7 +31,8 @@ SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagg
            file://quagga.default \
            file://watchquagga.init \
            file://watchquagga.default \
-           file://volatiles.03_quagga"
+           file://volatiles.03_quagga \
+           file://ripd-fix-two-bugs-after-received-SIGHUP.patch"
 
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"