]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib, pbrd: Do not allow v6 LL nexthops to be specified without an interface.
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Mar 2018 22:23:27 +0000 (18:23 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 17 Apr 2018 22:40:17 +0000 (18:40 -0400)
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>
lib/nexthop_group.c
pbrd/pbr_vty.c

index 1ec49c2a02766a384c4d60d47c0a6bfa20c9ae83..a527d011ae7846089287cc86d6360fe8b6dc9598 100644 (file)
@@ -280,8 +280,14 @@ 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);
index 87ec3804a53778164475fc6ed100f29a0aed7317..18d8896faf96609300c0821998a8d48b3dfcf570 100644 (file)
@@ -251,8 +251,14 @@ 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)