summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Westphal <renato@openbsd.org>2017-10-05 16:05:43 +0200
committerGitHub <noreply@github.com>2017-10-05 16:05:43 +0200
commitad183f047cab21576a42a9da0c4ed94cd1391005 (patch)
treec0a5532bae3005c76ba7021cba9b4d105c42c3c7
parentMerge pull request #1280 from donaldsharp/eigrp_interface (diff)
parent*: Add some documentation about how to handle new daemons (diff)
downloadfrr-ad183f047cab21576a42a9da0c4ed94cd1391005.tar.xz
frr-ad183f047cab21576a42a9da0c4ed94cd1391005.zip
Merge pull request #1244 from donaldsharp/flush_routes
tools: Fix route flush
-rw-r--r--tools/etc/iproute2/rt_protos.d/frr.conf1
-rwxr-xr-xtools/frr24
-rw-r--r--zebra/rt_netlink.h16
3 files changed, 30 insertions, 11 deletions
diff --git a/tools/etc/iproute2/rt_protos.d/frr.conf b/tools/etc/iproute2/rt_protos.d/frr.conf
index 6b341f516..2d3b884e7 100644
--- a/tools/etc/iproute2/rt_protos.d/frr.conf
+++ b/tools/etc/iproute2/rt_protos.d/frr.conf
@@ -8,4 +8,3 @@
191 nhrp
192 eigrp
193 ldp
-194 babel
diff --git a/tools/frr b/tools/frr
index 4eb4a5c28..78190aadb 100755
--- a/tools/frr
+++ b/tools/frr
@@ -544,14 +544,22 @@ case "$1" in
if [ -z "$dmn" -o "$dmn" = "zebra" ]; then
echo "Removing all routes made by FRR."
- ip route flush proto bgp
- ip route flush proto ospf
- ip route flush proto static
- ip route flush proto rip
- ip route flush proto ripng
- ip route flush proto zebra
- ip route flush proto isis
-
+ # Specific values for each proto can be found
+ # in /etc/iproute2/rt_protos as well as FRR
+ # specific ones in /etc/iproute2/rt_protos.d
+ # Additionally if a new protocol is added
+ # we need to add it here as well as
+ # in rt_netlink.h( follow the directions! )
+ ip route flush proto 186
+ ip route flush proto 188
+ ip route flush proto 4
+ ip route flush proto 189
+ ip route flush proto 190
+ ip route flush proto 11
+ ip route flush proto 187
+ ip route flush proto 192
+ ip route flush proto 42
+ ip route flush proto 191
else
[ -n "$dmn" ] && eval "${dmn/-/_}=0"
start_watchfrr
diff --git a/zebra/rt_netlink.h b/zebra/rt_netlink.h
index e607dda6f..980ff915c 100644
--- a/zebra/rt_netlink.h
+++ b/zebra/rt_netlink.h
@@ -27,14 +27,26 @@
#define NL_DEFAULT_ROUTE_METRIC 20
-/* Additional protocol strings to push into routes */
+/*
+ * Additional protocol strings to push into routes
+ * If we add anything new here please make sure
+ * to update:
+ * zebra2proto Function
+ * proto2zebra Function
+ * is_selfroute Function
+ * tools/frr To flush the route upon exit
+ *
+ * Finally update this file to allow iproute2 to
+ * know about this new route.
+ * tools/etc/iproute2/rt_protos.d
+ */
#define RTPROT_BGP 186
#define RTPROT_ISIS 187
#define RTPROT_OSPF 188
#define RTPROT_RIP 189
#define RTPROT_RIPNG 190
#if !defined(RTPROT_BABEL)
-#define RTPROT_BABEL 42
+#define RTPROT_BABEL 42
#endif
#define RTPROT_NHRP 191
#define RTPROT_EIGRP 192