summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_routemap.c
diff options
context:
space:
mode:
authorChristian Franke <chris@opensourcerouting.org>2013-07-05 17:35:37 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2013-09-19 18:04:40 +0200
commitfa713d9ee5ed30dedd0a290be9aaff780a2896be (patch)
tree1d263cce70c341f3f2a73a47d4b1cd5a38b09129 /zebra/zebra_routemap.c
parentzebra: improve interface shutdown behaviour (diff)
downloadfrr-fa713d9ee5ed30dedd0a290be9aaff780a2896be.tar.xz
frr-fa713d9ee5ed30dedd0a290be9aaff780a2896be.zip
zebra: rework recursive route resolution
Change the datastructure for recursive routes. This brings the following benefits: By using struct nexthop also to store nexthops obtained by recursive resolution, we can get rid of quite a bit of code duplication in the fib management. (rt_netlink, rt_socket, ...) With the new datastructure we can make use of all available paths when recursive routes are resolved with multipath routes. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'zebra/zebra_routemap.c')
-rw-r--r--zebra/zebra_routemap.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c
index b3111b8e6..39c7e1bff 100644
--- a/zebra/zebra_routemap.c
+++ b/zebra/zebra_routemap.c
@@ -422,14 +422,10 @@ route_match_ip_next_hop (void *rule, struct prefix *prefix,
switch (nexthop->type) {
case NEXTHOP_TYPE_IFINDEX:
case NEXTHOP_TYPE_IFNAME:
+ /* Interface routes can't match ip next-hop */
+ return RMAP_NOMATCH;
case NEXTHOP_TYPE_IPV4_IFINDEX:
case NEXTHOP_TYPE_IPV4_IFNAME:
- if (nexthop->rtype != NEXTHOP_TYPE_IPV4)
- return RMAP_NOMATCH;
- p.family = AF_INET;
- p.prefix = nexthop->rgate.ipv4;
- p.prefixlen = IPV4_MAX_BITLEN;
- break;
case NEXTHOP_TYPE_IPV4:
p.family = AF_INET;
p.prefix = nexthop->gate.ipv4;
@@ -488,14 +484,10 @@ route_match_ip_next_hop_prefix_list (void *rule, struct prefix *prefix,
switch (nexthop->type) {
case NEXTHOP_TYPE_IFINDEX:
case NEXTHOP_TYPE_IFNAME:
+ /* Interface routes can't match ip next-hop */
+ return RMAP_NOMATCH;
case NEXTHOP_TYPE_IPV4_IFINDEX:
case NEXTHOP_TYPE_IPV4_IFNAME:
- if (nexthop->rtype != NEXTHOP_TYPE_IPV4)
- return RMAP_NOMATCH;
- p.family = AF_INET;
- p.prefix = nexthop->rgate.ipv4;
- p.prefixlen = IPV4_MAX_BITLEN;
- break;
case NEXTHOP_TYPE_IPV4:
p.family = AF_INET;
p.prefix = nexthop->gate.ipv4;