From: Nolan Leake Date: Thu, 13 Sep 2012 17:17:31 +0000 (+0000) Subject: zebra: make static routes respect table setting X-Git-Tag: frr-2.0-rc1~1776 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=b0145ddb4bf75d2c8853aa3d0bc7c522f4f17531;p=matthieu%2Ffrr.git zebra: make static routes respect table setting Make static routes respect non-default routing tables. BEFORE PATCH ------------ ! in zebra.conf table 1 ! add static route vtysh> ip route 10.0.0.0/30 eth0 cumulus@net-top0:~$ ip route default via 192.168.0.2 dev eth0 10.0.0.0/30 dev eth0 proto zebra 192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.15 ! nothing in table 1 cumulus@net-top0:~$ ip route show table 1 AFTER PATCH ----------- ! in zebra.conf table 1 ! add static route vtysh> ip route 10.0.0.0/30 eth0 cumulus@net-top0:~$ ip route default via 192.168.0.2 dev eth0 192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.15 ! static route in table 1 cumulus@net-top0:~$ ip route show table 1 10.0.0.0/30 dev eth0 proto zebra Signed-off-by: Nolan Leake Reviewed-by: Scott Feldman Signed-off-by: David Lamparter --- diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 50674ee889..b8a47031f2 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -2036,6 +2036,7 @@ static_install_ipv4 (struct prefix *p, struct static_ipv4 *si) rib->type = ZEBRA_ROUTE_STATIC; rib->distance = si->distance; rib->metric = 0; + rib->table = zebrad.rtm_table_default; rib->nexthop_num = 0; switch (si->type)