Age | Commit message (Collapse) | Author |
|
diff from jsg@
ok deraadt@, benno@
|
|
from leaking the multicast address.
beck@ found the hard way that this made his second CARP master use a
wrong MAC address.
This is part of a bigger diff from Florian Riehm who is currently
working on a proper solution to fix balancing modes.
ok beck@, bluhm@
|
|
It was only checked in balancing mode, which is currently broken, and is
no longer needed.
Discusssed with bluhm@ and Florian Riehm.
|
|
the packet has been feed to the pseudo-interfaces input handlers.
To fix that without introducing a layer violation we should be able to
disable HW-vlan on parent when in use with different pseudo-interfaces.
In the case of bridge(4) for example it makes no sense to let the interface
remove the VLAN header if the kernel has to add it back for every packet.
Fix issues reported by sebastia@ and markus@
From dlg@, ok claudio@
|
|
the srp_ref struct is used to track the location of the callers
hazard pointer so later calls to srp_follow and srp_enter already
know what to clear. this in turn means most of the caveats around
using srps go away. specifically, you can now:
- switch cpus while holding an srp ref
- ie, you can sleep while holding an srp ref
- you can take and release srp refs in any order
the original intent was to simplify use of the api when dealing
with complicated data structures. the caller now no longer has to
track the location of the srp a value was fetched from, the srp_ref
effectively does that for you.
srp lists have been refactored to use srp_refs instead of srpl_iter
structs.
this is in preparation of using srps inside the ART code. ART is a
complicated data structure, and lookups require overlapping holds
of srp references.
ok mpi@ jmatthew@
|
|
|
|
if a physical interface receives a multicast/broadcast packet and
has carp interfaces on it, that packet needs to be copied for
reception by each of those carp interfaces.
previously it was using m_copym2, but that doesn't respect the
alignment of the source packet. this meant the ip header in the
copies were aligned incorrectly for the network stack, which breaks
strict alignment archs.
m_dup_pkt lets carp specify that the payload needs an ETHER_ALIGN
adjustment, so the ip header inside will be aligned correctly.
reported and tested by anthony eden who hit this on armv7
i reproduced the problem on sparc64 and verified the fix on amd64
and sparc64
ok mpi@ mikeb@ deraadt@
|
|
an interface joined a specific multicast group.
ok phessler@, visa@, dlg@
|
|
Problem reported by and diff tested by Fabian Raetz, thanks!
ok benno@, bluhm@
|
|
This is needed in order to fully unlock ARP processing with carp(4)
interfaces as found the hardway by sthen@.
ok sthen@, dlg@
|
|
fallback to a SLIST.
ok dlg@, jasper@
|
|
for unlocking the ARP input path.
ok dlg@
|
|
later failed.
|
|
Pointed by and ok reyk@
|
|
One of the keys of our MP work relies on making OpenBSD's kernel simpler!
In this case turning ARP processing MP-safe is quite complicated due to
the way carp(4) is hooked in arpinput() and nowadays you'd better run
kitchensinkd(9) anyway :)
ok bluhm@, claudio@, reyk@
|
|
L2 resolution depends on the protocol (encoded in the route entry) and
an ``ifp''. Not having to care about an ``ifa'' makes our life easier
in our MP effort. Fewer dependencies between data structures implies
fewer headaches.
Discussed with bluhm@, ok claudio@
|
|
ok claudio@, bluhm@, jsg@
|
|
and mpi believe could be used uninitialised.
ok mpi@
|
|
(Especially adding IF_DROP() after IFQ_ENQUEUE() was completely wrong because
IFQ_ENQUEUE() already does it. Oops.)
After this revert, the situation becomes:
- if_snd.ifq_drops is incremented in either IFQ_ENQUEUE() or IF_DROP(), but
it is not shown to userland, and
- if_data.ifi_oqdrops is shown to userland, but it is not incremented by
anyone.
|
|
mpi@ plans to clean-up IF_DROP()'s, but fix consistent use of it for now.
OK dlg@
|
|
for ART.
While here sync the two remaining mix() macros.
ok chris@, dlg@
|
|
there are three data structures involved here:
the list of carp interfaces on a parent interface (struct carp_if)
is now accessed via the if_ih cookie. its lifetime is managed by
the if_ih_insert and if_ih_remove calls.
the second is the interfaces (struct carp_softc) in the list above.
these has been moved from being access via a TAILQ to an SRPL.
modifications to the list are serialised by the kernel lock.
the third is the list of vhost entries (struct carp_vhost_entry).
these used to be in a LIST on each carp_softc, but have been moved
to being accessed vian an SRPL. modifications to the list are
serialised by the kernel lock.
written at l2k15
tested by mpi@ and hrvoje popovski
ok mpi@
|
|
ifp0, and the ifnet * that refers to the carp interface ifp.
this makes it easier for me to read. it's probably not the right
name for ifp0, but at least it's consistent.
ok sthen@ bluhm@ mpi@ claudio@
|
|
ok claudio@ mpi@
|
|
vhif_ifs so you can tell when that list is empty.
you can use TAILQ_EMPTY to see if a list is empty though, so kill
the count and use EMPTY instead.
ok mpi@
|
|
ifpp - XXX: just for statistics
ifpp is always NULL in all callers so that statistic confirms ifpp is
dying
OK mpi@
|
|
to pass additional context or transient data with the similar life
time.
ok mpi, suggestions, hand holding and ok from dlg
|
|
ok claudio@
|
|
instead of having every driver that manipulates the ifih list
understand SRPLs, this moves that processing into if_ih_insert and
if_ih_remove functions.
we rely on the kernel lock to serialise the modifications to the
list.
tested by mpi@
ok mpi@ claudio@ mikeb@
|
|
ifp in order to access its ifih handlers.
So get rid of if_get() in the various ifih handlers we know the ifp is
live at this point.
ok dlg@
|
|
talking about (*ifp->if_output)().
ok claudio@, dlg@
|
|
tweaks and ok mpi@
|
|
Note that pseudo-drivers not using if_input() are not affected by this
conversion.
ok mikeb@, kettenis@, claudio@, dlg@
|
|
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@
|
|
ok sthen@, phessler@
|
|
Tested by <mxb AT alumni DOT chalmers DOT se>, thanks!
ok bluhm@, dlg@
|
|
Since vhe are allocated with M_ZERO and INIT is also defined to be 0,
carp_set_state() would result in a no-op because of the state check.
So explicitly initialize the state of a vhe to INIT and move the state
check in carp_set_state_all() to prevent similar issues in the future.
Problem and initial diff from Johan Ymerson, thanks!
ok henning@
|
|
change behaviour for now but will allow to share the same address with
the parent interface without major hacks.
OK mpi@
|
|
pointer to this function.
ok claudio@
|
|
Fix a problem found by Johan Huldtgren, ok phessler@
|
|
are converted to if_input(), this time without breaking parent-less setup.
ok sthen@, dlg@
|
|
to the carp interface would end up enqueued without being decapsulated.
Found the hard way by shten@
|
|
are converted to if_input().
ok dlg@, claudio@
|
|
interface instead of rewritting most of them.
This change is also needed for upcoming if_input() conversion.
As a bonus pseudo-driver attached on top of carp are now detached in
the right order.
ok claudio@, henning@
|
|
might be overwritten by pseudo-drivers.
ok dlg@, henning@
|
|
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.
ok tedu@ deraadt@
|
|
configured IP address when sending AD.
Previously ip_output() was doing this magic for us and ip6_output() was
failing, making it impossible to send AD if the parent did not have an
IPv6 address.
Fix a regression found the hardway by benno@ introduced by the move to
NOINET6 by default.
ok benno@, phessler@
|
|
reroll the loop to free its Ethernet multicast addresses when destroying
an interface.
Prevent a panic found the hard way by phessler@
ok henning@, pelikan@, phessler@
|
|
The half-backed logic to find a parent interface before configuring an
address on a carp(4) interface is responsible for too many layers of
complexity resulting in various breakages everytime something change in
the stack.
So make carp(4) a bit less special. It now requires a parent interface
like all the other pseudo-devices.
ok mikeb@, dlg@, florian@, henning@
|
|
carp(4) has a hack to update its Ethernet address which was also
generating the corresponding IPv6 link-local address. Since the
removal of the NOINET6 flag, this link-local address was generated
even if no IPv6 address has been configured on the interface.
This unbreak carp setup without v6 addresses, found the hard way by
sebastia@.
ok sebastia@, benno@, stsp@, @phessler
|