don't have bpf_detachd give up the bd mtx to call ifpromisc.
instead, have it return an interface reference and make the caller
responsible for the ifpromisc call. this gets rid of window that
releasing the bd mtx opens and the NET_LOCK call for ifpromisc opens.
that window allows allows an interface we're trying to attach to
in bpf_setif, or switch dlts on in bpf_setdlt, to be removed from
the system before bpf can properly account for it. so we need to
keep the bd mtx hold.
found by tom smyth whoe also tested a few versions of this diff.
i missed a chunk when getting rid of the IFT_IEEE8023ADLAG fiddling
trunk_port_ioctl was checking that IFT_IEEE8023ADLAG was set on the
port, which isnt true anymore.
dont switch if_type to IFT_IEEE8023ADLAG on ports anymore.
if_type should be immutable and set by the driver providing the
interface.
from what i can tell, the main reason to do this was to mark an
interfaces as "in use" by trunk, but we can figure that out by using
ac_trport now.
don't let a vxlan interface set itself as the parent.
fixes part of the problems in the "vxlan(4): vxlan accepted as its
own parent" email tom smyth sent to bugs@
this doesnt prevent configuration of interface topologies with
loops, but it's a good start.
don't let an nvgre interface set itself as the parent.
fixes part of the problems in the "gre(4): nvgre accepted as its
own parent" email tom smyth sent to bugs@
this doesnt prevent configuration of interface topologies with
loops, but it's a good start.
vfs: set cn_pnbuf to NULL after pool_put in vfs_generic_abortop. This
can be called in a variety of error paths and by explicitly NULLing this
and not clearing HASBUF this ensures a panic on reuse rather than a
potential UAF.
There are no known paths to this currently, this is a hardening only.
ok deraadt@ kirill@ beck@
don't assume the new interface being patched is pair until the end.
care has to be taken to still release the requested ifnet reference,
regardless of whether it is a pair or not.
this should fix the 'pair(4): "patch" to a non-pair interface panics
(lo) or downs its link' problem reported by tom smyth on bugs@
check that the interface being paired is a pair(4) before fiddling with it
before this it was looking into the pair_softc of the new interface
before making sure it was a pair(4) first.
ok mvs@
use if_drvid to ensure pair is only paired with other pair ifaces
this was doing some complicated stuff with if_clone_lookup and
strcmp to get the same result, but this is a lot simpler.
ok mvs@ as part of a larger diff.
use if_drvid to identify vport interface instances.
veb treats vports specially, so it needs a way to identify which
interfaces are backed by the vport driver, which is what if_drvid
provides. this replaces using an ifnet function pointer to imply
which driver backs an interface, which is brittle.
ok mvs@ as part of a bigger diff.
use if_drvid to ensure rports are only paired with rports.
i was using the if_enqueue function point for this, but i want to
replace if_enqueue with a more generic function in the future which
would break this.
part of a larger diff that was ok mvs@
add a void *if_drvid to ifnet so drivers can supply an opaque id.
there's a few places where specific drivers need to know if another
interface is backed by the same driver. at the moment they abuse a
function pointer to check this, but that's brittle because things like
trunks and bridges fiddle with function pointers on their port
interfaces to mask certain behaviours.
this adds a dedicated driver settable identifier for this purpose
instead, and then uses it in the appropriate drivers. a driver can
point this at anything it wants to act as an identifier.
this started out because i was looking at replacing rport_enqueue
with a generic function provided by if.h, which would break using
it to identify instances of rport(4).
ok mvs@
stop reporting ifmedia on virtual interfaces.
showing "media: Ethernet autoselect" on virtual interfaces is
unecessary. the important thing is link state, which is reported
via if_link_state on the interface itself.
ok miod@ mvs@
Increase the MCLBYTES RX DMA allocation size, since the valid maximum 802.11
frame size can be larger, and therefore could write beyond the allocation.
Diff from acts1631kjv at proton dot me.
ok claudio@
Remove warning for sysupgrade -f without -s
It was supposed to be an error, but `! false && false` interactions
with `set -e` in ksh turned it into a warning.
While this operation is dangerous and may require additional work
from the admin, it is behind the force flag and you get to keep
both pieces.
ok sthen@
I agree deraadt@
----------------------------------------------------------------------
Change Open Firmware calling routines to explicitly allow for one returned
value. The existing code used to work on real hardware, but wasn't exactly
IEEE1275-conformant, and did not work with QEMU's OpenBIOS.
Tested on various machines from U1 and U5 to Blade, V250 and T1000.
diff from Ted Bullock, ok kettenis@