Age | Commit message (Collapse) | Author |
|
tweaks and ok mpi@
|
|
|
|
This fix some weird bridge(4) configurations involving pseudo-drivers
stacked on top of interfaces in a bridge.
Also simplifies the loop prevention logic to match bridge's input path.
Instead of using a tag per port/bridge simply flag output mbufs to make
sure only one copy per bridge go through bridge_output().
ok bluhm@, claudio@
|
|
Not all drivers make use of ether_output() and there's no real reason to
call it when no ARP resolution is needed. But in this case we still want
to make sure we're sending packets in the correct rdomain.
ok bluhm@, claudio@ as part of a larger diff.
|
|
Most of the ARP layer already take an ifp pointer and this makes clear
wich chunks of code are messing with ac_enaddr.
Note that our Ethernet code assume that these pointer are interchangeable
since the first element of the "struct arpcom" is a "struct ifnet".
|
|
Move bridge_input() outside of ether_input() in order to duplicate packets
flowing through a bridge port before applying any transformation on mbufs.
This saves a various m_adj(9)/M_PREPEND(9) dances and remove the bridge(4)
hack from vlan(4).
Tested by mxb <mxb AT alumni DOT chalmers DOT se> and kettenis@
ok bluhm@
|
|
receiving interface in the packet header of every mbuf.
The interface pointer should now be retrieved when necessary with
if_get(). If a NULL pointer is returned by if_get(), the interface
has probably been destroy/removed and the mbuf should be freed.
Such mechanism will simplify garbage collection of mbufs and limit
problems with dangling ifp pointers.
Tested by jmatthew@ and krw@, discussed with many.
ok mikeb@, bluhm@, dlg@
|
|
vlan_start().
ok sthen@, phessler@
|
|
ok sthen@, phessler@
|
|
Tested by <mxb AT alumni DOT chalmers DOT se>, thanks!
ok bluhm@, dlg@
|
|
the second (unused) argument of the input packet handlers.
ok dlg@
|
|
change it from feeding the ethertype of the packet (which is almost
certainly an ip packet or vlan packet, so not that variable) to the
number of packets about to be processed.
ok deraadt@ mpi@
|
|
To keep the list of input handlers short, multiple vlans share the
same ifih.
if_input_process() now looks if the interface of a mbuf changed to
make sure the corresponding handlers are executed. This is a hack
and will be improved later.
ok dlg@
|
|
a packet on the sending queue of an interface.
Tested by many, thanks a lot!
ok dlg@, claudio@
|
|
function.
ok claudio@, reyk@
|
|
Each physical interface of a trunk now gets a specific ifih (interface
input handler) that runs before ether_input().
Tested by sthen@, dlg@, Theo Buehler and <mxb AT alumni.chalmers DOT se>
ok sthen@, dlg@
|
|
m_adj(9) to keep bridge(4) working while other pseudo-drivers are
converted to if_input().
Tested by mxb <mxb AT alumni DOT chalmers DOT se>, thanks!
ok henning@
|
|
to of vlan(4) from ether_input() to bridge_input().
One of the goal of the if_input() plumbing is to stop doing all possible
pseudo-drivers checks on every packets. There's no reason that even if
you're not running a bridge(4) you've to run this code.
This change also will also makes it easier to convert vlan(4) to if_input().
Reviewed by Rafael Zalamena and mikeb@, ok markus@
|
|
with niqueues.
this change is so big because there's a lot of code that takes
pointers to different input queues (eg, ether_input picks between
ipv4, ipv6, pppoe, arp, and mpls input queues) and falls through
to code to enqueue packets against the pointer. if i changed only
one of the input queues id have to add sepearate code paths, one
for ifqueues and one for niqueues in each of these places
by flipping all these input queues at once i can keep the currently
common code common.
testing by mpi@ sthen@ and rafael zalamena
ok mpi@ sthen@ claudio@ henning@
|
|
an interface is destroyed/removed. This way we can ensure pseudo-driver
changes done after attaching an interface are undone before detaching it.
Note: it is safe to call if_deactivate() multiple times as the interface
should not have any attached pseudo-interface after the first call.
ok deraadt@, dlg@
|
|
might be overwritten by pseudo-drivers.
ok dlg@, henning@
|
|
"Look safe" henning@, ok florian@
|
|
(will panic) in bridge context; ok henning@
|
|
ok mpi@
|
|
recieving ring to the stack.
if_input() is at the moment a drop-in replacement for ether_input_mbuf()
but will let us stack pseudo-driver in a nice way in order to no longer
call ether_input() recursively.
ok pelikan@, reyk@, blambert@, henning@
|
|
prio from the vlan header to our pf priority levels. This fixes the
mapping on the ouput path.
ok henning
|
|
for the validity of a given outgoing route entry into a single function.
This change is inspired from FreeBSD r111767. The function introduced
here, rt_checkgate(), should hopefully die in a near future. Why should
it die? Well, it is way too late to do such validity checks: if your
kernel can ends up in ether_output() with an invalid route, please do
not let it try to find a new one that might do the job.
Go read this function if you're wondering why you're getting messages
like:
"arpresolve: X.X.X.X: route without link local address"
Since this horrible logic has survived 20 years of copy & past and small
modifications for workarounds without a single clear commit message, let's
assume it is full of dragons and try to play safe. This factorization is
not intended to change any behavior.
With much inputs from bluhm@, tested by weerd@ and florian@ on setups
with p2p IPv6 interfaces.
ok bluhm@, benno@, florian@
|
|
long live the one true internet.
ok henning mikeb
|
|
used by enc(4) devices to attach their routes.
ok sthen@, mikeb@
|
|
|
|
is needed. more thoroughly reviewed. ok deraadt
|
|
|
|
ok deraadt@ tedu@
|
|
so use the safer function. can be converted back to memcpy if necessary,
but later and only after more careful inspection.
|
|
IP-traffic over a carp interface with the underlaying carpdev being unnumbered
(in the numbered case usually the ifp is the carpdev to begin with) went out
with the carpdev's mac address istead of the carp interface's one due to a
carp hack in ether_output exchanging the carp ifp for its carpdev ones one.
move the source mac selection to before that.
fixes unnumbered carp use in environments with strict mac address regimes
like some exchange points. issue found by your's truly the hard way.
ok mpi dlg
|
|
functionnality instead of a mix of enable/disable.
ok bluhm@, jca@
|
|
many years and wide spread demand for support never materialized.
time to pack it in.
|
|
after discussions with beck deraadt kettenis.
|
|
via if_rxring things. this effectively deprecates the third argument
for MCLGETI and m_clget and makes the mbuf layer no longer care about
interfaces and simplifies the allocation paths.
the timeout used to measure livelock has been moved to net/if.c.
ok mpi@
|
|
ok gcc & md5 (aka no binary change)
|
|
on al already ass embed ethernet frame, which meant:
-copy (most of) the existing ethernet header into a ether_vlan_header
on the stack
-fill the extra fields in ether_vlan_header
-set the ether type
-m_adj() to make room for the extra space ether_vlan_header needs
-m_copyback the ether_vlan_header into the mbuf
that involves moving data around, which isn't all that cheap.
cleaner & easier to have ether_output prepend the ether_vlan_header instead
of the regular ethernet header, which makes the vlan tagging essentially
free in most cases.
help & ok reyk, naddy; waste of time bikeshedding tech@
|
|
the pseudo_AF_HDRCMPLT case, ok claudio reyk
|
|
|
|
ok claudio reyk
|
|
carp_rewrite_lladdr to overwrite the src lladdr, get the intended src
lladdr before assembling the ethernet header.
carp_rewrite_lladdr -> carp_get_srclladdr
ok reyk claudio
|
|
src lladdr just to copy it from the esrc buffer into the ethernet header
a few lines later, use an esrc pointer to figure out where to copy the
src lladdr from. ok claudio reyk
|
|
Avoid the confusion by using an appropriate name for the variable.
Note that since routing domain IDs are a subset of the set of routing
table IDs, the following idiom is correct:
rtableid = rdomain
But to get the routing domain ID corresponding to a given routing table
ID, you must call rtable_l2(9).
claudio@ likes it, ok mikeb@
|
|
|
|
such case loouput() is called not ether_output().
ok claudio@, mikeb@
|
|
ok pelikan@, tedu@
|