]> git.proxmox.com Git - mirror_frr.git/commitdiff
ripd: Create non default passive interface if defined so
authorDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 18 Apr 2023 18:19:34 +0000 (21:19 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 18 Apr 2023 18:19:34 +0000 (21:19 +0300)
Without this patch, it's never get non-passive and even listed under status:

Configuration:

```
router rip
 network 192.168.1.0/24
 network 10.10.10.1/32
 passive-interface default
 no passive-interface r2-eth0
 timers basic 5 15 10
exit
```

```
r2# do sh ip rip status
Routing Protocol is "rip"
  Sending updates every 5 seconds with +/-50%, next due in 4 seconds
  Timeout after 15 seconds, garbage collect after 10 seconds
  Outgoing update filter list for all interface is not set
  Incoming update filter list for all interface is not set
  Default redistribution metric is 1
  Redistributing:
  Default version control: send version 2, receive any version
    Interface        Send  Recv   Key-chain
    lo               2     1 2
    r2-eth0          2     1 2
  Routing for Networks:
    10.10.10.1/32
    192.168.1.0/24
  Passive Interface(s):
    lo
    r2-eth0
  Routing Information Sources:
    Gateway          BadPackets BadRoutes  Distance Last Update
    192.168.1.3              0         0       120   00:00:04
  Distance: (default is 120)
r2#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
ripd/rip_nb_config.c

index 343bb9bb57b2d71900cea3533e306f879482777b..d237866a41cdf1cbeadcdf73e0c58574b2674647 100644 (file)
@@ -525,7 +525,7 @@ int ripd_instance_non_passive_interface_create(struct nb_cb_create_args *args)
        rip = nb_running_get_entry(args->dnode, NULL, true);
        ifname = yang_dnode_get_string(args->dnode, NULL);
 
-       return rip_passive_nondefault_unset(rip, ifname);
+       return rip_passive_nondefault_set(rip, ifname);
 }
 
 int ripd_instance_non_passive_interface_destroy(struct nb_cb_destroy_args *args)
@@ -539,7 +539,7 @@ int ripd_instance_non_passive_interface_destroy(struct nb_cb_destroy_args *args)
        rip = nb_running_get_entry(args->dnode, NULL, true);
        ifname = yang_dnode_get_string(args->dnode, NULL);
 
-       return rip_passive_nondefault_set(rip, ifname);
+       return rip_passive_nondefault_unset(rip, ifname);
 }
 
 /*