summaryrefslogtreecommitdiffstats
path: root/babeld
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-06-13 09:45:16 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-06-13 09:45:16 +0200
commit3565d9ac830cb04d0e5da8ceb8e6e9fdefde788a (patch)
tree32c5767ebcebc3c4be43b79b93ae98bd517f8e0b /babeld
parentMerge remote-tracking branch 'frr/master' into pull-624 (diff)
downloadfrr-3565d9ac830cb04d0e5da8ceb8e6e9fdefde788a.tar.xz
frr-3565d9ac830cb04d0e5da8ceb8e6e9fdefde788a.zip
babeld: install directly connected IPv4 as such
babeld would install "1.2.3.4 on eth0" as "1.2.3.4 via 1.2.3.4 on eth0". Remove the superfluous nexthop and send to zebra as directly-connected route. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'babeld')
-rw-r--r--babeld/kernel.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/babeld/kernel.c b/babeld/kernel.c
index fa06f80a5..26860f3ba 100644
--- a/babeld/kernel.c
+++ b/babeld/kernel.c
@@ -177,7 +177,12 @@ kernel_route_v4(int add,
api.nexthop_num = 1;
api.nexthop = &nexthop_pointer;
nexthop.ifindex = ifindex;
- nexthop.type = NEXTHOP_TYPE_IPV4_IFINDEX;
+ if (IPV4_ADDR_SAME (&nexthop.gate.ipv4, &quagga_prefix.u.prefix4) &&
+ quagga_prefix.prefixlen == 32) {
+ nexthop.type = NEXTHOP_TYPE_IFINDEX;
+ } else {
+ nexthop.type = NEXTHOP_TYPE_IPV4_IFINDEX;
+ }
SET_FLAG(api.message, ZAPI_MESSAGE_METRIC);
api.metric = metric;
}
@@ -227,6 +232,7 @@ kernel_route_v6(int add, const unsigned char *pref, unsigned short plen,
api.nexthop_num = 1;
api.nexthop = &nexthop_pointer;
nexthop.ifindex = ifindex;
+ /* difference to IPv4: always leave the linklocal as nexthop */
nexthop.type = NEXTHOP_TYPE_IPV6_IFINDEX;
SET_FLAG(api.message, ZAPI_MESSAGE_METRIC);
api.metric = metric;