[oe-commits] Xufeng Zhang : quagga: Avoid duplicate connected address adding to the list

git at git.openembedded.org git at git.openembedded.org
Tue Nov 26 16:20:26 UTC 2013


Module: meta-openembedded.git
Branch: master
Commit: 936febdff7a937cd4ef21ea7e42a800c7b8d2a85
URL:    http://git.openembedded.org/?p=meta-openembedded.git&a=commit;h=936febdff7a937cd4ef21ea7e42a800c7b8d2a85

Author: Xufeng Zhang <xufeng.zhang at windriver.com>
Date:   Tue Nov 19 15:02:30 2013 +0800

quagga: Avoid duplicate connected address adding to the list

commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal")
introduces an regression: ifp->connected list is cleaned up when ripd is
restarting, however, for interface addresses which are not specified in
ripd configuration file, they are never to be added into ifp->connected
again, this will lead to some abnormal behavior for route advertising.

Instead of cleaning up the ifp->connected list to avoid duplicated
connected address being added into this list, we can check this
condition during interface address adding process and return early
when an identical address has already been added.

Signed-off-by: Xufeng Zhang <xufeng.zhang at windriver.com>
Signed-off-by: Joe MacDonald <joe at deserted.net>

---

 .../quagga-Avoid-duplicate-connected-address.patch | 54 ++++++++++++++++++++++
 .../recipes-protocols/quagga/quagga.inc            |  4 +-
 2 files changed, 57 insertions(+), 1 deletion(-)

diff --git a/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
new file mode 100644
index 0000000..a07e33f
--- /dev/null
+++ b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
@@ -0,0 +1,54 @@
+quagga: Avoid duplicate connected address adding to the list
+
+commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal")
+introduces an regression: ifp->connected list is cleaned up when ripd is
+restarting, however, for interface addresses which are not specified in
+ripd configuration file, they are never to be added into ifp->connected
+again, this will lead to some abnormal behavior for route advertising.
+
+Instead of cleaning up the ifp->connected list to avoid duplicated
+connected address being added into this list, we can check this
+condition during interface address adding process and return early
+when an identical address has already been added.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hu Yadi <Yadi.hu at windriver.com>
+Signed-off-by: Xufeng Zhang <xufeng.zhang at windriver.com>
+Signed-off-by: Joe MacDonald <joe at deserted.net>
+---
+--- a/lib/if.c
++++ b/lib/if.c
+@@ -738,6 +738,16 @@ connected_add_by_prefix (struct interfac
+                          struct prefix *destination)
+ {
+   struct connected *ifc;
++  struct listnode *cnode;
++  struct connected *c;
++  int ret = 0;
++
++  for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, c))
++    {
++      ret = connected_same_prefix (p, (c->address));
++      if(ret == 1)
++        return NULL;
++    }
+ 
+   /* Allocate new connected address. */
+   ifc = connected_new ();
+--- a/ripd/rip_interface.c
++++ b/ripd/rip_interface.c
+@@ -516,13 +516,6 @@ rip_interface_clean (void)
+ 	  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);
+-        }
+     }
+ }
+ 
diff --git a/meta-networking/recipes-protocols/quagga/quagga.inc b/meta-networking/recipes-protocols/quagga/quagga.inc
index 677b1c5..b08a74f 100644
--- a/meta-networking/recipes-protocols/quagga/quagga.inc
+++ b/meta-networking/recipes-protocols/quagga/quagga.inc
@@ -32,7 +32,9 @@ SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagg
            file://watchquagga.init \
            file://watchquagga.default \
            file://volatiles.03_quagga \
-           file://ripd-fix-two-bugs-after-received-SIGHUP.patch"
+           file://ripd-fix-two-bugs-after-received-SIGHUP.patch \
+           file://quagga-Avoid-duplicate-connected-address.patch \
+"
 
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"



More information about the Openembedded-commits mailing list