summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-protocols
diff options
context:
space:
mode:
authorXufeng Zhang <xufeng.zhang@windriver.com>2013-11-19 15:02:30 +0800
committerJoe MacDonald <joe@deserted.net>2013-11-26 10:53:17 -0500
commit936febdff7a937cd4ef21ea7e42a800c7b8d2a85 (patch)
tree6c20150fb980c7a94b3608fb71ee6d7be54c3b6c /meta-networking/recipes-protocols
parentb613318e14a0038b4fc6d5a7378b1affb64fd471 (diff)
downloadmeta-openembedded-936febdff7a937cd4ef21ea7e42a800c7b8d2a85.tar.gz
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@windriver.com> Signed-off-by: Joe MacDonald <joe@deserted.net>
Diffstat (limited to 'meta-networking/recipes-protocols')
-rw-r--r--meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch54
-rw-r--r--meta-networking/recipes-protocols/quagga/quagga.inc4
2 files changed, 57 insertions, 1 deletions
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 000000000..a07e33f9f
--- /dev/null
+++ b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch
@@ -0,0 +1,54 @@
1quagga: Avoid duplicate connected address adding to the list
2
3commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal")
4introduces an regression: ifp->connected list is cleaned up when ripd is
5restarting, however, for interface addresses which are not specified in
6ripd configuration file, they are never to be added into ifp->connected
7again, this will lead to some abnormal behavior for route advertising.
8
9Instead of cleaning up the ifp->connected list to avoid duplicated
10connected address being added into this list, we can check this
11condition during interface address adding process and return early
12when an identical address has already been added.
13
14Upstream-Status: Pending
15
16Signed-off-by: Hu Yadi <Yadi.hu@windriver.com>
17Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
18Signed-off-by: Joe MacDonald <joe@deserted.net>
19---
20--- a/lib/if.c
21+++ b/lib/if.c
22@@ -738,6 +738,16 @@ connected_add_by_prefix (struct interfac
23 struct prefix *destination)
24 {
25 struct connected *ifc;
26+ struct listnode *cnode;
27+ struct connected *c;
28+ int ret = 0;
29+
30+ for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, c))
31+ {
32+ ret = connected_same_prefix (p, (c->address));
33+ if(ret == 1)
34+ return NULL;
35+ }
36
37 /* Allocate new connected address. */
38 ifc = connected_new ();
39--- a/ripd/rip_interface.c
40+++ b/ripd/rip_interface.c
41@@ -516,13 +516,6 @@ rip_interface_clean (void)
42 thread_cancel (ri->t_wakeup);
43 ri->t_wakeup = NULL;
44 }
45-
46- for (conn_node = listhead (ifp->connected); conn_node; conn_node = next)
47- {
48- ifc = listgetdata (conn_node);
49- next = conn_node->next;
50- listnode_delete (ifp->connected, ifc);
51- }
52 }
53 }
54
diff --git a/meta-networking/recipes-protocols/quagga/quagga.inc b/meta-networking/recipes-protocols/quagga/quagga.inc
index 677b1c5a0..b08a74fba 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
32 file://watchquagga.init \ 32 file://watchquagga.init \
33 file://watchquagga.default \ 33 file://watchquagga.default \
34 file://volatiles.03_quagga \ 34 file://volatiles.03_quagga \
35 file://ripd-fix-two-bugs-after-received-SIGHUP.patch" 35 file://ripd-fix-two-bugs-after-received-SIGHUP.patch \
36 file://quagga-Avoid-duplicate-connected-address.patch \
37"
36 38
37PACKAGECONFIG ??= "" 39PACKAGECONFIG ??= ""
38PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap" 40PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"