diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2023-07-09 21:45:51 +0200 | 
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2023-07-09 21:57:01 +0200 | 
| commit | 71b0b0d3b330073b3d0957efca76a6a6d68002f0 (patch) | |
| tree | c44e3e61d0d84eb88ae7f56115d2f5523eef44ab /zebra/interface.c | |
| parent | 2ec7477a2681d36867b0970517c2f27f14a5af86 (diff) | |
zebra: fix mpls config on ifaces created post frr
The mpls configuration does not work when an interface is
created after having applied the frr configuration. The
below scenario illustrates:
> root@dut:~# modprobe mpls
> root@dut:~# zebra &
> [..]
> dut(config)# interface ifacenotcreated
> dut(config-if)# mpls enable
> dut(config-if)# Ctrl-D
> root@dut:~# ip li show ifacenotcreated
> Device "ifacenotcreated" does not exist.
> root@dut:~# ip li add ifacenotcreated type dummy
> 0
Fix this by forcing the mpls flag when the interface is detected.
> root@dut:~# cat /proc/sys/net/mpls/conf/ifacenotcreat/input
> 1
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'zebra/interface.c')
| -rw-r--r-- | zebra/interface.c | 5 | 
1 files changed, 5 insertions, 0 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index ba6a376536..ae446988dd 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -610,6 +610,11 @@ void if_add_update(struct interface *ifp)  		if_addr_wakeup(ifp); +		if (if_data->mpls_config == IF_ZEBRA_DATA_ON) +			dplane_intf_mpls_modify_state(ifp, true); +		else if (if_data->mpls_config == IF_ZEBRA_DATA_OFF) +			dplane_intf_mpls_modify_state(ifp, false); +  		if (IS_ZEBRA_DEBUG_KERNEL)  			zlog_debug(  				"interface %s vrf %s(%u) index %d becomes active.",  | 
