Merge pull request #1244 from donaldsharp/flush_routes

tools: Fix route flush
This commit is contained in:
Renato Westphal 2017-10-05 11:05:43 -03:00 committed by GitHub
commit ad183f047c
3 changed files with 30 additions and 11 deletions

View File

@ -8,4 +8,3 @@
191 nhrp 191 nhrp
192 eigrp 192 eigrp
193 ldp 193 ldp
194 babel

View File

@ -544,14 +544,22 @@ case "$1" in
if [ -z "$dmn" -o "$dmn" = "zebra" ]; then if [ -z "$dmn" -o "$dmn" = "zebra" ]; then
echo "Removing all routes made by FRR." echo "Removing all routes made by FRR."
ip route flush proto bgp # Specific values for each proto can be found
ip route flush proto ospf # in /etc/iproute2/rt_protos as well as FRR
ip route flush proto static # specific ones in /etc/iproute2/rt_protos.d
ip route flush proto rip # Additionally if a new protocol is added
ip route flush proto ripng # we need to add it here as well as
ip route flush proto zebra # in rt_netlink.h( follow the directions! )
ip route flush proto isis 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 else
[ -n "$dmn" ] && eval "${dmn/-/_}=0" [ -n "$dmn" ] && eval "${dmn/-/_}=0"
start_watchfrr start_watchfrr

View File

@ -27,14 +27,26 @@
#define NL_DEFAULT_ROUTE_METRIC 20 #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_BGP 186
#define RTPROT_ISIS 187 #define RTPROT_ISIS 187
#define RTPROT_OSPF 188 #define RTPROT_OSPF 188
#define RTPROT_RIP 189 #define RTPROT_RIP 189
#define RTPROT_RIPNG 190 #define RTPROT_RIPNG 190
#if !defined(RTPROT_BABEL) #if !defined(RTPROT_BABEL)
#define RTPROT_BABEL 42 #define RTPROT_BABEL 42
#endif #endif
#define RTPROT_NHRP 191 #define RTPROT_NHRP 191
#define RTPROT_EIGRP 192 #define RTPROT_EIGRP 192