]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Remove System routes from ip protocol route map choices 17953/head
authorDonald Sharp <sharpd@nvidia.com>
Wed, 29 Jan 2025 13:18:32 +0000 (08:18 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 29 Jan 2025 14:31:53 +0000 (09:31 -0500)
Do not allow system routes to be selected for ip protocol

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
doc/user/zebra.rst
lib/route_types.pl
zebra/zebra_cli.c

index ef3a61985330042a35c5dba9048127467546e46c..f700d360868a6ca8d50ad2195fee915822c4475b 100644 (file)
@@ -1133,10 +1133,8 @@ kernel.
    - any,
    - babel,
    - bgp,
-   - connected,
    - eigrp,
    - isis,
-   - kernel,
    - nhrp,
    - openfabric,
    - ospf,
index c75a86696471477f54f6180b3bec6b7d26d7fc15..834cb822d2cedc9ef13caf2830779bde5dc7db2c 100755 (executable)
@@ -127,9 +127,12 @@ printf "#define SHOW_ROUTE_V6_HEADER \\\n%s\n", codelist(@protosv6);
 print "\n";
 
 sub collect {
-       my ($daemon, $ipv4, $ipv6, $any) = @_;
+       my ($daemon, $ipv4, $ipv6, $any, $ip_prot) = @_;
        my (@names, @help) = ((), ());
        for my $p (@protos) {
+               next if ($ip_prot == 1 && $daemon eq "zebra" && $protodetail{$p}->{"cname"} eq "kernel");
+               next if ($ip_prot == 1 && $daemon eq "zebra" && $protodetail{$p}->{"cname"} eq "connected");
+               next if ($ip_prot == 1 && $daemon eq "zebra" && $protodetail{$p}->{"cname"} eq "local");
                next if ($protodetail{$p}->{"daemon"} eq $daemon && $daemon ne "zebra");
                next if ($protodetail{$p}->{"restrict2"} ne "" && 
                         $protodetail{$p}->{"restrict2"} ne $daemon);
@@ -151,24 +154,24 @@ for my $daemon (sort keys %daemons) {
        next unless ($daemons{$daemon}->{"ipv4"} || $daemons{$daemon}->{"ipv6"});
        printf "/* %s */\n", $daemon;
        if ($daemons{$daemon}->{"ipv4"} && $daemons{$daemon}->{"ipv6"}) {
-               my ($names, $help) = collect($daemon, 1, 1, 0);
+               my ($names, $help) = collect($daemon, 1, 1, 0, 0);
                printf "#define FRR_REDIST_STR_%s \\\n  %s\n", uc $daemon, $names;
                printf "#define FRR_REDIST_HELP_STR_%s \\\n%s\n", uc $daemon, $help;
 
-               ($names, $help) = collect($daemon, 1, 0, 0);
+               ($names, $help) = collect($daemon, 1, 0, 0, 0);
                printf "#define FRR_IP_REDIST_STR_%s \\\n  %s\n", uc $daemon, $names;
                printf "#define FRR_IP_REDIST_HELP_STR_%s \\\n%s\n", uc $daemon, $help;
 
-               ($names, $help) = collect($daemon, 0, 1, 0);
+               ($names, $help) = collect($daemon, 0, 1, 0, 0);
                printf "#define FRR_IP6_REDIST_STR_%s \\\n  %s\n", uc $daemon, $names;
                printf "#define FRR_IP6_REDIST_HELP_STR_%s \\\n%s\n", uc $daemon, $help;
 
                if ($daemon eq "zebra") {
-                       ($names, $help) = collect($daemon, 1, 0, 1);
+                       ($names, $help) = collect($daemon, 1, 0, 1, 1);
                        printf "#define FRR_IP_PROTOCOL_MAP_STR_%s \\\n  %s\n", uc $daemon, $names;
                        printf "#define FRR_IP_PROTOCOL_MAP_HELP_STR_%s \\\n%s\n", uc $daemon, $help;
 
-                       ($names, $help) = collect($daemon, 0, 1, 1);
+                       ($names, $help) = collect($daemon, 0, 1, 1, 1);
                        printf "#define FRR_IP6_PROTOCOL_MAP_STR_%s \\\n  %s\n", uc $daemon, $names;
                        printf "#define FRR_IP6_PROTOCOL_MAP_HELP_STR_%s \\\n%s\n", uc $daemon, $help;
                }
index ca53eb2eb34dff6b7c76e2b83014390efd7f36da..bb799283261be0a9e69af11d5bf078ece2d72537 100644 (file)
@@ -1983,6 +1983,10 @@ static void lib_vrf_zebra_ipv6_router_id_cli_write(struct vty *vty,
        vty_out(vty, "ipv6 router-id %s\n", id);
 }
 
+/*
+ * Both the v4 and v6 version of this command are now limiting the
+ * usage of System route types from being considered here at all
+ */
 DEFPY_YANG (ip_protocol,
        ip_protocol_cmd,
        "[no] ip protocol " FRR_IP_PROTOCOL_MAP_STR_ZEBRA