diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-04-27 20:53:46 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-04-27 20:59:52 +0200 |
commit | 0761368af03d4e613a9297bf20dc68690fcc5d69 (patch) | |
tree | 128f921b72bc248cd41feb50535e75dc301bc421 /zebra/rt_netlink.c | |
parent | Merge pull request #2125 from qlyoung/fix-gcc-build-command-graph (diff) | |
download | frr-0761368af03d4e613a9297bf20dc68690fcc5d69.tar.xz frr-0761368af03d4e613a9297bf20dc68690fcc5d69.zip |
zebra: Add PBR and SHARP handling
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>
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r-- | zebra/rt_netlink.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index cdc52211c..a35dc9a17 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -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; } |