lib, pbrd: Do not allow v6 LL nexthops to be specified without an interface.

Prevent the creation of a v6 LL nexthop that does not include an interface
for proper resolution.

Ticket: CM-20276
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2018-03-28 18:23:27 -04:00
parent 170f8b90ba
commit cafec8da4f
2 changed files with 14 additions and 2 deletions

View File

@ -280,9 +280,15 @@ DEFPY(ecmp_nexthops, ecmp_nexthops_cmd,
intf, vrf->name);
return CMD_WARNING;
}
} else
} else {
if (IN6_IS_ADDR_LINKLOCAL(&nhop.gate.ipv6)) {
vty_out(vty,
"Specified a v6 LL with no interface, rejecting\n");
return CMD_WARNING_CONFIG_FAILED;
}
nhop.type = NEXTHOP_TYPE_IPV6;
}
}
nh = nexthop_exists(&nhgc->nhg, &nhop);

View File

@ -251,9 +251,15 @@ DEFPY(pbr_map_nexthop, pbr_map_nexthop_cmd,
intf, vrf->name);
return CMD_WARNING_CONFIG_FAILED;
}
} else
} else {
if (IN6_IS_ADDR_LINKLOCAL(&nhop.gate.ipv6)) {
vty_out(vty,
"Specified a v6 LL with no interface, rejecting\n");
return CMD_WARNING_CONFIG_FAILED;
}
nhop.type = NEXTHOP_TYPE_IPV6;
}
}
if (pbrms->nhg)
nh = nexthop_exists(pbrms->nhg, &nhop);