On Sat, Mar 13, 2021 at 11:31:05PM +0100, Klemens Nanni wrote:
> 3. bug?: mpe(4) does not delete the label upon SIOCDELLABEL:
>
> # ifconfig mpe
> mpe: no such interface
> # ifconfig mpe0 create
> # ifconfig mpe0
> mpe0: flags=10<POINTOPOINT> mtu 1500
> index 39 priority 0 llprio 3
> encap: txprio 0 rxprio packet
> mpls: label (unset)
> groups: mpe
> # ifconfig mpe0 mplslabel 42
> # ifconfig mpe0 -mplslabel
> # ifconfig mpe0 | grep label
> mpls: label 42
That's only half the picture: the underlaying MPLS route is still
properly added and deleted through the ioctl, so that works.
It's actually a display bug because we unset the wrong label internally;
most certainly introduced with revision 1.87 copy/pasting SIOCDELLABEL.
mpe(4) looks like it could profit from mpe_{get,del}label() like mpip(4)
has them; it currently only has mpe_set_label() and does the rest
inline in the ioctl handler.
With the fix below:
# ifconfig mpe
mpe: no such interface
# ifconfig mpe0 mplslabel 42
# ifconfig mpe0 | grep label
mpls: label 42
# ifconfig mpe0 -mplslabel
# ifconfig mpe0 | grep label
mpls: label (unset)
Feedback? OK?
Index: if_mpe.c
===================================================================
RCS file: /cvs/src/sys/net/if_mpe.c,v
retrieving revision 1.98
diff -u -p -r1.98 if_mpe.c
--- if_mpe.c 20 Feb 2021 05:03:37 -0000 1.98
+++ if_mpe.c 16 Mar 2021 19:42:28 -0000
@@ -401,7 +401,7 @@ mpe_ioctl(struct ifnet *ifp, u_long cmd,
smplstosa(&sc->sc_smpls), sc->sc_rdomain);
}
- shim.shim_label = MPLS_LABEL2SHIM(0);
+ sc->sc_smpls.smpls_label = MPLS_LABEL2SHIM(0);
break;
case SIOCSLIFPHYRTABLE: