summaryrefslogtreecommitdiffstats
path: root/meta-networking
diff options
context:
space:
mode:
authorAws Ismail <aws.ismail@windriver.com>2013-05-06 14:06:49 -0400
committerJoe MacDonald <joe.macdonald@windriver.com>2013-05-07 10:23:41 -0400
commitaf74e53e97a9800f7cf159ec44dbcbfeaff9a73b (patch)
treec0eed03dbabd124a1c52c7cee6105598963bf2b3 /meta-networking
parenta8b96b69bd418b74f48dc4d111caac676ae667f5 (diff)
downloadmeta-openembedded-af74e53e97a9800f7cf159ec44dbcbfeaff9a73b.tar.gz
Quagga: sync zebra routing table with the kernel one
When interface goes down, and there are some static routes that are made with ip route, they are going to be deleted from kernel fib. That's what kernel does by default. But they are not going to be deleted from zebra's fib. They will be declared inactive. This issue was originally discussed in [1] and a patch was proposed. [1] http://www.gossamer-threads.com/lists/quagga/dev/22609 Signed-off-by: Aws Ismail <aws.ismail@windriver.com> Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com>
Diffstat (limited to 'meta-networking')
-rw-r--r--meta-networking/recipes-protocols/quagga/files/Zebra-sync-zebra-routing-table-with-the-kernel-one.patch48
-rw-r--r--meta-networking/recipes-protocols/quagga/quagga.inc3
2 files changed, 50 insertions, 1 deletions
diff --git a/meta-networking/recipes-protocols/quagga/files/Zebra-sync-zebra-routing-table-with-the-kernel-one.patch b/meta-networking/recipes-protocols/quagga/files/Zebra-sync-zebra-routing-table-with-the-kernel-one.patch
new file mode 100644
index 000000000..35f4637d8
--- /dev/null
+++ b/meta-networking/recipes-protocols/quagga/files/Zebra-sync-zebra-routing-table-with-the-kernel-one.patch
@@ -0,0 +1,48 @@
1sync zebra routing table with the kernel one when interface is down
2
3Add router to kernel main router table with "ip", then you can see
4a router item in kernel main router table. Also can see this router
5item in zebra router table. If down the interface, this router item
6will be deleted from kernel main router table, but it will not be
7deleted from zebra router table, just set as inactive.
8
9This patch is adopted from [1].
10[1] http://www.gossamer-threads.com/lists/quagga/dev/22609
11
12Upstream-Status: Pending
13
14Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
15Signed-of-by: Roy.Li <rongqing.li@windriver.com>
16
17---
18 zebra/zebra_rib.c | 7 +++++++
19 1 files changed, 7 insertions(+), 0 deletions(-)
20
21diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
22index 154e8d5..63434d0 100644
23--- a/zebra/zebra_rib.c
24+++ b/zebra/zebra_rib.c
25@@ -765,6 +765,9 @@ rib_match_ipv6 (struct in6_addr *addr)
26 #define RIB_SYSTEM_ROUTE(R) \
27 ((R)->type == ZEBRA_ROUTE_KERNEL || (R)->type == ZEBRA_ROUTE_CONNECT)
28
29+#define RIB_KERNEL_ROUTE(R) \
30+ ((R)->type == ZEBRA_ROUTE_KERNEL)
31+
32 /* This function verifies reachability of one given nexthop, which can be
33 * numbered or unnumbered, IPv4 or IPv6. The result is unconditionally stored
34 * in nexthop->flags field. If the 4th parameter, 'set', is non-zero,
35@@ -1135,6 +1138,10 @@ rib_process (struct route_node *rn)
36 redistribute_delete (&rn->p, fib);
37 if (! RIB_SYSTEM_ROUTE (fib))
38 rib_uninstall_kernel (rn, fib);
39+#ifdef GNU_LINUX
40+ else if(RIB_KERNEL_ROUTE (fib) && !if_is_up(if_lookup_by_index(fib->nexthop->ifindex)))
41+ del=fib;
42+#endif
43 UNSET_FLAG (fib->flags, ZEBRA_FLAG_SELECTED);
44
45 /* Set real nexthop. */
46--
471.7.4.1
48
diff --git a/meta-networking/recipes-protocols/quagga/quagga.inc b/meta-networking/recipes-protocols/quagga/quagga.inc
index 160c458cc..f9a32a99a 100644
--- a/meta-networking/recipes-protocols/quagga/quagga.inc
+++ b/meta-networking/recipes-protocols/quagga/quagga.inc
@@ -15,7 +15,7 @@ SNMP_CONF="${@base_contains('DISTRO_FEATURES', 'snmp', '--enable-snmp', '', d)}"
15LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ 15LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
16 file://COPYING.LIB;md5=f30a9716ef3762e3467a2f62bf790f0a" 16 file://COPYING.LIB;md5=f30a9716ef3762e3467a2f62bf790f0a"
17 17
18INC_PR = "r1" 18INC_PR = "r2"
19 19
20QUAGGASUBDIR = "" 20QUAGGASUBDIR = ""
21# ${QUAGGASUBDIR} is deal with old versions. Set to "/attic" for old 21# ${QUAGGASUBDIR} is deal with old versions. Set to "/attic" for old
@@ -23,6 +23,7 @@ QUAGGASUBDIR = ""
23SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagga-${PV}.tar.gz;name=quagga-${PV} \ 23SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagga-${PV}.tar.gz;name=quagga-${PV} \
24 file://fix-for-lib-inpath.patch \ 24 file://fix-for-lib-inpath.patch \
25 file://quagga-0.99.17-libcap.patch \ 25 file://quagga-0.99.17-libcap.patch \
26 file://Zebra-sync-zebra-routing-table-with-the-kernel-one.patch \
26 file://quagga.init \ 27 file://quagga.init \
27 file://quagga.default \ 28 file://quagga.default \
28 file://watchquagga.init \ 29 file://watchquagga.init \