]> git.proxmox.com Git - mirror_frr.git/commitdiff
ripngd: fix interface wakeup after shutdown
authorIgor Ryzhov <iryzhov@nfware.com>
Mon, 17 May 2021 16:35:57 +0000 (19:35 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Mon, 17 May 2021 16:35:57 +0000 (19:35 +0300)
RIPNG schedules a call to `ripng_interface_wakeup` in 1 second after
receiving the interface UP event from zebra. The function is called even
if the interface was shut down during this interval.

This is incorrect and also leads to a crash in the following scenario:
```
vtysh -c "conf" -c "router ripng vrf red" -c "network enp2s0"
ip link add red type vrf table 1
ip link set enp2s0 vrf red
ip link set enp2s0 down
ip link set enp2s0 up && sleep 2 && ip link del red
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
ripngd/ripng_interface.c

index c4d494804f0294324f8ed23b1936f64344e3bd87..682839861727ae40ccb3741ef96e9334ff1e8017 100644 (file)
@@ -169,6 +169,9 @@ static int ripng_if_down(struct interface *ifp)
        struct listnode *listnode = NULL, *nextnode = NULL;
 
        ri = ifp->info;
+
+       THREAD_OFF(ri->t_wakeup);
+
        ripng = ri->ripng;
 
        if (ripng)