]> git.proxmox.com Git - mirror_frr.git/commitdiff
tools, zebra: Use different protocol value for our statics
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 25 May 2018 18:36:12 +0000 (14:36 -0400)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Sat, 26 May 2018 06:46:13 +0000 (08:46 +0200)
The re-use of RTPROT_STATIC has caused too many collisions
where other legitimate route sources are causing us to
believe we are the originator of the route.  Modify
the code so that if another protocol inserts RTPROT_STATIC
we will assume it's a Kernel Route.

Fixes: #2293
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
tools/etc/iproute2/rt_protos.d/frr.conf
tools/frr
zebra/kernel_netlink.c
zebra/rt_netlink.c
zebra/rt_netlink.h

index cac75bdfbabb4c193b8a2ade47d8e00aee0b08c8..4c6968ac2765bede04b79465ea70c8d277bfd559 100644 (file)
@@ -10,3 +10,4 @@
 193  ldp
 194  sharp
 195  pbr
+196  static
index fec94af689ec3808d27aec930c2470a92b7ed161..7d7b97433ac00c6e2975fead6e7b7efc747ef6d3 100755 (executable)
--- a/tools/frr
+++ b/tools/frr
@@ -565,6 +565,7 @@ case "$1" in
           ip route flush proto 193
           ip route flush proto 194
           ip route flush proto 195
+         ip route flush proto 196
        else
          [ -n "$dmn" ] && eval "${dmn/-/_}=0"
          start_watchfrr
index 6b587dab3863fc9fb923033fcbbf2457d76d10a1..ac5baba1cd083f541c182e0910fb4393c5bc64f2 100644 (file)
@@ -110,6 +110,7 @@ static const struct message rtproto_str[] = {
        {RTPROT_ISIS, "IS-IS"},
        {RTPROT_RIP, "RIP"},
        {RTPROT_RIPNG, "RIPNG"},
+       {RTPROT_ZSTATIC, "static"},
        {0}};
 
 static const struct message family_str[] = {{AF_INET, "ipv4"},
index 8ab70c8d4b0c3b7cabc97e8f0cedbabb70690b46..1ea2b853623cfb8817c5bf668e59edf5032ca819 100644 (file)
@@ -94,7 +94,7 @@ void rt_netlink_init(void)
 static inline int is_selfroute(int proto)
 {
        if ((proto == RTPROT_BGP) || (proto == RTPROT_OSPF)
-           || (proto == RTPROT_STATIC) || (proto == RTPROT_ZEBRA)
+           || (proto == RTPROT_ZSTATIC) || (proto == RTPROT_ZEBRA)
            || (proto == RTPROT_ISIS) || (proto == RTPROT_RIPNG)
            || (proto == RTPROT_NHRP) || (proto == RTPROT_EIGRP)
            || (proto == RTPROT_LDP) || (proto == RTPROT_BABEL)
@@ -120,7 +120,7 @@ static inline int zebra2proto(int proto)
                proto = RTPROT_OSPF;
                break;
        case ZEBRA_ROUTE_STATIC:
-               proto = RTPROT_STATIC;
+               proto = RTPROT_ZSTATIC;
                break;
        case ZEBRA_ROUTE_ISIS:
                proto = RTPROT_ISIS;
@@ -194,6 +194,7 @@ static inline int proto2zebra(int proto, int family)
                proto = ZEBRA_ROUTE_LDP;
                break;
        case RTPROT_STATIC:
+       case RTPROT_ZSTATIC:
                proto = ZEBRA_ROUTE_STATIC;
                break;
        case RTPROT_SHARP:
index 78888f48ca9f349521329d47e06f14da509dc596..c8d918b1d20ea4a76c84ce9dba487754297ca536 100644 (file)
@@ -53,6 +53,7 @@
 #define RTPROT_LDP         193
 #define RTPROT_SHARP       194
 #define RTPROT_PBR         195
+#define RTPROT_ZSTATIC     196
 
 void rt_netlink_init(void);