summaryrefslogtreecommitdiffstats
path: root/pbrd
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2019-10-08 00:01:21 +0200
committerStephen Worley <sworley@cumulusnetworks.com>2019-10-08 00:29:01 +0200
commitcb254f41c05cbefdd5564a7a910e441ee349ed0e (patch)
tree7692366e1b1ebc014e770ef78c3eb66a4980164e /pbrd
parentMerge pull request #5112 from qlyoung/cli-reject-ipv4-leading-zero (diff)
downloadfrr-cb254f41c05cbefdd5564a7a910e441ee349ed0e.tar.xz
frr-cb254f41c05cbefdd5564a7a910e441ee349ed0e.zip
pbrd: Don't track ipv6 link locals
Don't bother tracking ipv6 link locals to determine if a map should be installed. Every interface has a route of `fe80::/64` so its just going to return the arbitrarily first one it finds when it resolves it and hands it back to us. Instead, just track the interface we specify along with it. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'pbrd')
-rw-r--r--pbrd/pbr_nht.c13
-rw-r--r--pbrd/pbr_vty.c4
-rw-r--r--pbrd/pbr_zebra.c6
3 files changed, 19 insertions, 4 deletions
diff --git a/pbrd/pbr_nht.c b/pbrd/pbr_nht.c
index ae04402f4..67a1fe2ff 100644
--- a/pbrd/pbr_nht.c
+++ b/pbrd/pbr_nht.c
@@ -267,7 +267,9 @@ void pbr_nhgroup_add_nexthop_cb(const struct nexthop_group_cmd *nhgc,
pbr_nht_install_nexthop_group(pnhgc, nhgc->nhg);
pbr_map_check_nh_group_change(nhgc->name);
- if (nhop->type == NEXTHOP_TYPE_IFINDEX) {
+ if (nhop->type == NEXTHOP_TYPE_IFINDEX
+ || (nhop->type == NEXTHOP_TYPE_IPV6_IFINDEX
+ && IN6_IS_ADDR_LINKLOCAL(&nhop->gate.ipv6))) {
struct interface *ifp;
ifp = if_lookup_by_index(nhop->ifindex, nhop->vrf_id);
@@ -772,10 +774,15 @@ pbr_nht_individual_nexthop_update(struct pbr_nexthop_cache *pnhc,
case NEXTHOP_TYPE_IFINDEX:
pbr_nht_individual_nexthop_interface_update(pnhc, pnhi);
break;
+ case NEXTHOP_TYPE_IPV6_IFINDEX:
+ if (IN6_IS_ADDR_LINKLOCAL(&pnhc->nexthop->gate.ipv6)) {
+ pbr_nht_individual_nexthop_interface_update(pnhc, pnhi);
+ break;
+ }
+ /* Intentional fall thru */
+ case NEXTHOP_TYPE_IPV4_IFINDEX:
case NEXTHOP_TYPE_IPV4:
case NEXTHOP_TYPE_IPV6:
- case NEXTHOP_TYPE_IPV4_IFINDEX:
- case NEXTHOP_TYPE_IPV6_IFINDEX:
pbr_nht_individual_nexthop_gw_update(pnhc, pnhi);
break;
case NEXTHOP_TYPE_BLACKHOLE:
diff --git a/pbrd/pbr_vty.c b/pbrd/pbr_vty.c
index a6e764bbb..069b3e6c9 100644
--- a/pbrd/pbr_vty.c
+++ b/pbrd/pbr_vty.c
@@ -363,7 +363,9 @@ DEFPY(pbr_map_nexthop, pbr_map_nexthop_cmd,
pbr_map_check(pbrms);
}
- if (nhop.type == NEXTHOP_TYPE_IFINDEX) {
+ if (nhop.type == NEXTHOP_TYPE_IFINDEX
+ || (nhop.type == NEXTHOP_TYPE_IPV6_IFINDEX
+ && IN6_IS_ADDR_LINKLOCAL(&nhop.gate.ipv6))) {
struct interface *ifp;
ifp = if_lookup_by_index(nhop.ifindex, nhop.vrf_id);
diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c
index 2bba83738..39e92467a 100644
--- a/pbrd/pbr_zebra.c
+++ b/pbrd/pbr_zebra.c
@@ -450,6 +450,12 @@ void pbr_send_rnh(struct nexthop *nhop, bool reg)
p.family = AF_INET6;
memcpy(&p.u.prefix6, &nhop->gate.ipv6, 16);
p.prefixlen = 128;
+ if (IN6_IS_ADDR_LINKLOCAL(&nhop->gate.ipv6))
+ /*
+ * Don't bother tracking link locals, just track their
+ * interface state.
+ */
+ return;
break;
}