History log of /openbsd-src/sys/net/if_mpip.c (Results 1 – 19 of 19)
Revision Date Author Comments
# b5b8bc53 01-Jan-2024 mvs <mvs@openbsd.org>

Call if_counters_alloc() before if_attach().

ok bluhm sashan


# 938ff1ae 23-Dec-2023 bluhm <bluhm@openbsd.org>

Backout always allocate per-CPU statistics counters for network
interface descriptor. It panics during attach of em(4) device at
boot.


# 4046f503 22-Dec-2023 mvs <mvs@openbsd.org>

Always allocate per-CPU statistics counters for network interface
descriptor.

We have the mess in network interface statistics. Only pseudo drivers
do per-CPU counters allocation, all other network

Always allocate per-CPU statistics counters for network interface
descriptor.

We have the mess in network interface statistics. Only pseudo drivers
do per-CPU counters allocation, all other network devices use the old
`if_data'. The network stack partially uses per-CPU counters and
partially use `if_data', but the protection is inconsistent: some times
counters accessed with exclusive netlock, some times with shared
netlock, some times with kernel lock, but without netlock, some times
with another locks.

To make network interfaces statistics more consistent, always allocate
per-CPU counters at interface attachment time and use it instead of
`if_data'. At this step only move counters allocation to the if_attach()
internals. The `if_data' removal will be performed with the following
diffs to make review and tests easier.

ok bluhm

show more ...


# 18a44669 29-Aug-2022 bluhm <bluhm@openbsd.org>

Use struct refcnt for interface address reference counting.
There was a crash due to use after free of the ifa although it is
ref counted. As ifa_refcnt was a simple integer increment, there
may be

Use struct refcnt for interface address reference counting.
There was a crash due to use after free of the ifa although it is
ref counted. As ifa_refcnt was a simple integer increment, there
may be a path where multiple CPUs access it concurrently. So change
to struct refcnt which is MP safe and provides dt(4) leak debugging.
Link level address for IPsec enc(4) and various MPLS interfaces is
special. There ifa is part of struct sc. Use refcount anyway and
add a panic to detect use after free.
bug report stsp@; OK mvs@

show more ...


# f8890659 26-Mar-2021 kn <kn@openbsd.org>

Only install route with label, fix route leak on destroy

ifconfig mp* mplslabel N" validates the label both in ifconfig(8) and each
driver's ioctl handler, but there is one case where all drivers in

Only install route with label, fix route leak on destroy

ifconfig mp* mplslabel N" validates the label both in ifconfig(8) and each
driver's ioctl handler, but there is one case where all drivers install
a route without looking at the label at all.

SIOCSLIFPHYRTABLE in all three drivers just validates the rdomain and sets
the label to itself (0) such that the route is (re)installed accordingly.

None of the driver's helper functions dealing with labels and routes
validate labels themselves but instead expect the callees, e.g. the ioctl
handler to do so.

That means we can install routes for the explicit NULL label in non-default
routing tables but are never able to clean them up without reboot.

Fix this by adding the inverse of mp*_clone_destroy()'s label check to the
routines installing the MPLS route to avoid bogus ones in the first place.

OK claudio

show more ...


# c7bf3b0b 17-Mar-2021 kn <kn@openbsd.org>

Use correct rdomain when adding/deleting routes

mpip(4) always adds and deletes routes in rdomain 0 regardless of the
`tunneldomain', i.e. the `sc_rdomain' value.

mpw(4) adds routes with the specif

Use correct rdomain when adding/deleting routes

mpip(4) always adds and deletes routes in rdomain 0 regardless of the
`tunneldomain', i.e. the `sc_rdomain' value.

mpw(4) adds routes with the specified rdomain but always deletes them
in rdomain 0.

mpe(4) consistently uses the softc's rdomain which is tracked
consistently across the various ioctls -- no fix needed.

Found while reading the code and testing ifconfig(8)'s "tunneldomain" in
order to document MPLS ioctls.

OK claudio

show more ...


# 2e3db693 20-Feb-2021 dlg <dlg@openbsd.org>

move from calling l3 protocol input handlers to using if_vinput.

if_vinput requires mpsafe interface counters, so add those in. this
factors out some more code between drivers. monitor mode will wor

move from calling l3 protocol input handlers to using if_vinput.

if_vinput requires mpsafe interface counters, so add those in. this
factors out some more code between drivers. monitor mode will work
on these interfaces now too.

show more ...


# 0e70c421 21-Aug-2020 kn <kn@openbsd.org>

Leave default ifq_maxlen handling to ifq_init()

Most clonable interface drivers (except bridge, enc, loop, pppx,
switch, trunk and vlan) initialise the send queue's length to IFQ_MAXLEN
during *_clo

Leave default ifq_maxlen handling to ifq_init()

Most clonable interface drivers (except bridge, enc, loop, pppx,
switch, trunk and vlan) initialise the send queue's length to IFQ_MAXLEN
during *_clone_create() even though ifq_init(), which is eventually called
through if_attach(), does the same.

Remove all early "ifq_set_maxlen(&ifq->if_snd, IFQ_MAXLEN);" lines to leave
it to ifq_init() and have clonable drivers a tad more in sync.

OK mvs

show more ...


# 0cae21bd 10-Jul-2020 patrick <patrick@openbsd.org>

Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.

ok dlg@ tobhe@


# 98da7c78 10-Jul-2020 patrick <patrick@openbsd.org>

Change users of IFQ_PURGE() to use the "new" API.

ok dlg@ tobhe@


# 379654e8 17-Jun-2020 dlg <dlg@openbsd.org>

make ph_flowid in mbufs 16bits by storing whether it's set in csum_flags.

i've been wanting to do this for a while, and now that we've got
stoeplitz and it gives us 16 bits, it seems like the right

make ph_flowid in mbufs 16bits by storing whether it's set in csum_flags.

i've been wanting to do this for a while, and now that we've got
stoeplitz and it gives us 16 bits, it seems like the right time.

show more ...


# afacbf84 26-Jun-2019 claudio <claudio@openbsd.org>

The MPLS edge devices get the packets from the MPLS stack which never
passed though pf_test(). So there is no need to try to call
pf_pkt_addr_changed() instead just check that the PF statekey is NULL

The MPLS edge devices get the packets from the MPLS stack which never
passed though pf_test(). So there is no need to try to call
pf_pkt_addr_changed() instead just check that the PF statekey is NULL.
Initial problem of not including pf.h found by jsg@
OK jsg@ sashan@

show more ...


# b9e5cef3 19-Apr-2019 dlg <dlg@openbsd.org>

use the factored out txhprio and rxhprio checks

reduces code duplication and chance for error.


# a61f5d85 19-Apr-2019 dlg <dlg@openbsd.org>

implement rxprio


# f1dea89c 17-Apr-2019 dlg <dlg@openbsd.org>

use txprio to control the use of exp as a priority field

by default txprio is set to 0, so the exp field will be 0. howerver,
txprio on mpe/mpw/mpip can be configured with other values or
settings l

use txprio to control the use of exp as a priority field

by default txprio is set to 0, so the exp field will be 0. howerver,
txprio on mpe/mpw/mpip can be configured with other values or
settings like our other tunnel or encapsulation interfaces.
intermediate LSPs can use the exp field to manage their prioritisation
of encapsulated traffic.

show more ...


# 957fd304 02-Apr-2019 dlg <dlg@openbsd.org>

clear the BCAST and MCAST mbuf flags for "outgoing" packets.

if these remain set then output on the underlying interface may
mistakenly be done with the wrong protocol type (eg, MPLS_MCAST
instead o

clear the BCAST and MCAST mbuf flags for "outgoing" packets.

if these remain set then output on the underlying interface may
mistakenly be done with the wrong protocol type (eg, MPLS_MCAST
instead of MPLS), and to the wrong link layer address.

reported by Lee Nelson
the specific problem was identified by Mitchell Krome

show more ...


# db4e5757 02-Apr-2019 dlg <dlg@openbsd.org>

some mbuf ph_rtableid fixes

consistently set the rtabled for "outgoing" packets to the encap
rdomain. use this for rtallocs in mpip too instead of assuming 0.


# 417c8ace 18-Mar-2019 dlg <dlg@openbsd.org>

make SIOCGETLABEL fail with EADDRNOTAVAIL if the label is not set.

this makes ifconfig print "(unset)" to show the label isn't set yet.


# 912623fe 28-Feb-2019 dlg <dlg@openbsd.org>

Add mpip(4), an IP tunnel interface for "IP Layer 2" over MPLS pseudowires

This is basically mpw(4), but it carries IP directly instead of
Ethernet. On the wire it can look the same as what IP over

Add mpip(4), an IP tunnel interface for "IP Layer 2" over MPLS pseudowires

This is basically mpw(4), but it carries IP directly instead of
Ethernet. On the wire it can look the same as what IP over MPLS
looks like, but because it is a pseudowire you can configure a
control word or the FAT label to improve load balancing. It can
be used to quickly set up an IP tunnel over an MPLS fabric
without the need to configure bgpd and mpe(4) interfaces.

Because It implements the same pwe3 ioctls that mpw(4) uses ifconfig
already supports configuration of mpip(4) interfaces. ldpd will
grow support for this in the near future.

This is not hooked up to the build yet

discussed with claduio@ at ak219
ok claudio@

show more ...