]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: Add PBR and SHARP handling
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 27 Apr 2018 18:53:46 +0000 (14:53 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 27 Apr 2018 18:59:52 +0000 (14:59 -0400)
We are missing some handling of PBR and SHARP protocols
for netlink operations w/ the linux kernel.

Additionally add a bread crumb for new developers( or existing )
to know to fixup the rt_netlink.c when we start handling new
route types to hand to the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/rt_netlink.c
zebra/rt_netlink.h

index cdc52211cccedfe466f6b88363fc2b9c7521f260..a35dc9a177914850bc534a6e8dc7e9d97c82c39f 100644 (file)
@@ -98,7 +98,8 @@ static inline int is_selfroute(int proto)
            || (proto == RTPROT_ISIS) || (proto == RTPROT_RIPNG)
            || (proto == RTPROT_NHRP) || (proto == RTPROT_EIGRP)
            || (proto == RTPROT_LDP) || (proto == RTPROT_BABEL)
-           || (proto == RTPROT_RIP) || (proto == RTPROT_SHARP)) {
+           || (proto == RTPROT_RIP) || (proto == RTPROT_SHARP)
+           || (proto == RTPROT_PBR)) {
                return 1;
        }
 
@@ -142,7 +143,18 @@ static inline int zebra2proto(int proto)
        case ZEBRA_ROUTE_SHARP:
                proto = RTPROT_SHARP;
                break;
+       case ZEBRA_ROUTE_PBR:
+               proto = RTPROT_PBR;
+               break;
        default:
+               /*
+                * When a user adds a new protocol this will show up
+                * to let them know to do something about it.  This
+                * is intentionally a warn because we should see
+                * this as part of development of a new protocol
+                */
+               zlog_warn("%s: Please add this protocol(%d) to proper rt_netlink.c handling",
+                         __PRETTY_FUNCTION__, proto);
                proto = RTPROT_ZEBRA;
                break;
        }
@@ -184,7 +196,22 @@ static inline int proto2zebra(int proto, int family)
        case RTPROT_STATIC:
                proto = ZEBRA_ROUTE_STATIC;
                break;
+       case RTPROT_SHARP:
+               proto = ZEBRA_ROUTE_SHARP;
+               break;
+       case RTPROT_PBR:
+               proto = ZEBRA_ROUTE_PBR;
+               break;
        default:
+               /*
+                * When a user adds a new protocol this will show up
+                * to let them know to do something about it.  This
+                * is intentionally a warn because we should see
+                * this as part of development of a new protocol
+                */
+               zlog_warn("%s: Please add this protocol(%d) to proper rt_netlink.c handling",
+                         __PRETTY_FUNCTION__,
+                         proto);
                proto = ZEBRA_ROUTE_KERNEL;
                break;
        }
index 51350fd6fb114d135a31d5f43f50e53d64df44b9..78888f48ca9f349521329d47e06f14da509dc596 100644 (file)
@@ -52,6 +52,7 @@
 #define RTPROT_EIGRP       192
 #define RTPROT_LDP         193
 #define RTPROT_SHARP       194
+#define RTPROT_PBR         195
 
 void rt_netlink_init(void);