OpenBSD CVS

CVS log for src/sys/net/if_vxlan.c


[BACK] Up to [local] / src / sys / net

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.99 / (download) - annotate - [select for diffs], Sat Dec 23 10:52:54 2023 UTC (5 months, 2 weeks ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.98: +2 -1 lines
Diff to previous 1.98 (colored)

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

Revision 1.98 / (download) - annotate - [select for diffs], Fri Dec 22 23:01:50 2023 UTC (5 months, 2 weeks ago) by mvs
Branch: MAIN
Changes since 1.97: +1 -2 lines
Diff to previous 1.97 (colored)

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

Revision 1.97 / (download) - annotate - [select for diffs], Wed Nov 29 18:46:37 2023 UTC (6 months, 1 week ago) by denis
Branch: MAIN
Changes since 1.96: +1 -2 lines
Diff to previous 1.96 (colored)

remove unused VXLANMTU definition

OK claudio, miod

Revision 1.96 / (download) - annotate - [select for diffs], Tue Nov 28 13:23:20 2023 UTC (6 months, 1 week ago) by bluhm
Branch: MAIN
Changes since 1.95: +4 -4 lines
Diff to previous 1.95 (colored)

Remove struct inpcb from in6_embedscope() parameters.

rip6_output() did modify inp_outputopts6 temporarily to provide
different ip6_pktopts to in6_embedscope().  Better pass inp_outputopts6
and inp_moptions6 as separate arguments to in6_embedscope().
Simplify the code that deals with these options in in6_embedscope().
Doucument inp_moptions and inp_moptions6 as protected by net lock.

OK kn@

Revision 1.95 / (download) - annotate - [select for diffs], Sat Nov 18 00:23:38 2023 UTC (6 months, 3 weeks ago) by dlg
Branch: MAIN
Changes since 1.94: +7 -1 lines
Diff to previous 1.94 (colored)

ports specified on tunnel destination addresses are invalid.

Revision 1.94 / (download) - annotate - [select for diffs], Fri Oct 27 20:56:48 2023 UTC (7 months, 2 weeks ago) by jan
Branch: MAIN
Changes since 1.93: +3 -1 lines
Diff to previous 1.93 (colored)

Forward TCP LRO disabling to parent devices.

Also disable TCP LRO on bridged vlan(4) and default for bpe(4), nvgre(4) and
vxlan(4).

ok bluhm@

Revision 1.93 / (download) - annotate - [select for diffs], Thu Aug 3 09:49:08 2023 UTC (10 months, 1 week ago) by mvs
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.92: +4 -5 lines
Diff to previous 1.92 (colored)

Move solock() down to sosetopt(). A part of standalone sblock() work.
This movement required because buffers related SO_SND* and SO_RCV*
socket options should be protected with sblock(). However, standalone
sblock() has different lock order with solock() and `so_snd' and
`so_rcv' buffers. At least sblock() for `so_snd' buffer will always be
taken before solock() in the sosend() path.

The (*pr_ctloutput)() call was removed from the SOL_SOCKET level 'else'
branch. Except the SO_RTABLE case where it handled in the special way,
this is null op call.

For SO_SND* and SO_RCV* cases solock() will be replaced by sblock() in
the future.

Feedback from bluhm

Tested by bluhm naddy

ok bluhm

Revision 1.92 / (download) - annotate - [select for diffs], Thu Apr 13 02:19:05 2023 UTC (13 months, 4 weeks ago) by jsg
Branch: MAIN
Changes since 1.91: +1 -2 lines
Diff to previous 1.91 (colored)

remove duplicate includes
ok deraadt@ miod@ krw@

Revision 1.91 / (download) - annotate - [select for diffs], Mon Jun 6 14:45:41 2022 UTC (2 years ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.90: +4 -5 lines
Diff to previous 1.90 (colored)

Simplify solock() and sounlock(). There is no reason to return a value
for the lock operation and to pass a value to the unlock operation.
sofree() still needs an extra flag to know if sounlock() should be called
or not. But sofree() is called less often and mostly without keeping the lock.
OK mpi@ mvs@

Revision 1.90 / (download) - annotate - [select for diffs], Sat Feb 26 04:46:34 2022 UTC (2 years, 3 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.89: +13 -18 lines
Diff to previous 1.89 (colored)

add the mbuf tag that prevents loops in vxlan_encap, not vxlan_output.

vxlan_output calls ether_output, which will do arp for ipv4 packets.
if arp hasn't resolved an address for a peer yet, it will queue the
packet and transmit it again after resolution completes. the way
it outputs is to call the interface output routine again, which is
vxlan_output.

if we tag the packet in vxlan_output before arp, and then arp calls
vxlan_output again, it looks like a loop and drops it. moving the
tagging to when we add all the encap headers in vxlan_encap avoids
this issue.

Revision 1.89 / (download) - annotate - [select for diffs], Mon Feb 21 05:19:07 2022 UTC (2 years, 3 months ago) by dlg
Branch: MAIN
Changes since 1.88: +2 -1 lines
Diff to previous 1.88 (colored)

in input, clear the address union before putting an ipv4 address in it.

the whole vxlan address is used for lookups in the RB tree, so any
garbage on the stack where the address sits could confuse the lookup.
it looks like i was lucky before, but if you receive vxlan over
ipsec you are less lucky.

found by and fix tested by jason tubnor.

Revision 1.88 / (download) - annotate - [select for diffs], Fri Feb 18 03:22:27 2022 UTC (2 years, 3 months ago) by dlg
Branch: MAIN
Changes since 1.87: +11 -1 lines
Diff to previous 1.87 (colored)

dont bother running ethernet multicast ioctl handlers.

while here turn ENETRESET into 0 in the ioctl path. there's no
hardware to reset.

Revision 1.87 / (download) - annotate - [select for diffs], Fri Feb 18 01:27:39 2022 UTC (2 years, 3 months ago) by dlg
Branch: MAIN
Changes since 1.86: +2 -2 lines
Diff to previous 1.86 (colored)

fix inverted check of running when changing tunnel rdomain.

you should only be able to change the tunnel rdomain when the
interface is down. i was accidentally make sure you could only
change the rdomain when the interface was up.

Revision 1.86 / (download) - annotate - [select for diffs], Fri Feb 18 00:46:42 2022 UTC (2 years, 3 months ago) by dlg
Branch: MAIN
Changes since 1.85: +6 -4 lines
Diff to previous 1.85 (colored)

only unwind multicast when in learning mode.

found by bluhm@ when he ran the regress tests.

Revision 1.85 / (download) - annotate - [select for diffs], Wed Feb 16 01:45:31 2022 UTC (2 years, 3 months ago) by dlg
Branch: MAIN
Changes since 1.84: +21 -4 lines
Diff to previous 1.84 (colored)

fill in support for rx prio handling.

Revision 1.84 / (download) - annotate - [select for diffs], Wed Feb 16 01:25:45 2022 UTC (2 years, 3 months ago) by dlg
Branch: MAIN
Changes since 1.83: +1493 -697 lines
Diff to previous 1.83 (colored)

rewrite vxlan to better fit the current kernel infrastructure.

the big change is removing the integration with and reliance on
bridge(4) for learning vxlan endpoints. we have the etherbridge
layer now (which is used by veb, nvgre, bpe, etc) so vxlan can
operate independently of bridge(4) (or any other driver) while still
dynamically learning about other endpoints.

vxlan now uses the udp socket upcall mechanism to receive packets.
this means it actually creates and binds udp sockets to use rather
adding code in the udp layer for stealing packets from the udp
layer.

i think it's also important to note that this adds loop prevention
to the code. this stops a vxlan interface being used to transmit a
packet that was encapsulated in itself.

i want to clear this out of my tree where it's been sitting for
nearly a year. noone seems too concerned with the change either
way.

ok claudio@

Revision 1.83 / (download) - annotate - [select for diffs], Mon Jan 10 14:07:59 2022 UTC (2 years, 5 months ago) by jan
Branch: MAIN
Changes since 1.82: +2 -2 lines
Diff to previous 1.82 (colored)

Use NULL instead of 0 for pointers.

OK bluhm@

Revision 1.82 / (download) - annotate - [select for diffs], Thu Feb 25 02:48:21 2021 UTC (3 years, 3 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.81: +2 -2 lines
Diff to previous 1.81 (colored)

we don't have to cast to caddr_t when calling m_copydata anymore.

the first cut of this diff was made with coccinelle using this spatch:

@rule@
type caddr_t;
expression m, off, len, cp;
@@
-m_copydata(m, off, len, (caddr_t)cp)
+m_copydata(m, off, len, cp)

i had fix it's opinionated idea of formatting by hand though, so
i'm not sure it was worth it.

ok deraadt@ bluhm@

Revision 1.81 / (download) - annotate - [select for diffs], Fri Aug 21 22:59:27 2020 UTC (3 years, 9 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.80: +1 -2 lines
Diff to previous 1.80 (colored)

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

Revision 1.80 / (download) - annotate - [select for diffs], Tue Jul 28 09:52:32 2020 UTC (3 years, 10 months ago) by mvs
Branch: MAIN
Changes since 1.79: +2 -1 lines
Diff to previous 1.79 (colored)

Add missing `IFXF_CLONED' flag to clone interfaces.

ok mpi@

Revision 1.79 / (download) - annotate - [select for diffs], Fri Jul 10 13:26:42 2020 UTC (3 years, 11 months ago) by patrick
Branch: MAIN
Changes since 1.78: +2 -2 lines
Diff to previous 1.78 (colored)

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

ok dlg@ tobhe@

Revision 1.78 / (download) - annotate - [select for diffs], Fri Jul 10 13:22:22 2020 UTC (3 years, 11 months ago) by patrick
Branch: MAIN
Changes since 1.77: +2 -2 lines
Diff to previous 1.77 (colored)

Change users of IFQ_DEQUEUE(), IFQ_ENQUEUE() and IFQ_LEN() to use the
"new" API.

ok dlg@ tobhe@

Revision 1.77 / (download) - annotate - [select for diffs], Sun Apr 12 11:56:52 2020 UTC (4 years, 1 month ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.76: +3 -3 lines
Diff to previous 1.76 (colored)

Stop processing packets under non-exclusive (read) netlock.

Prevent concurrency in the socket layer which is not ready for that.

Two recent data corruptions in pfsync(4) and the socket layer pointed
out that, at least, tun(4) was incorrectly using NET_RUNLOCK().  Until
we find a way in software to avoid future mistakes and to make sure that
only the softnet thread and some ioctls are safe to use a read version
of the lock, put everything back to the exclusive version.

ok stsp@, visa@

Revision 1.76 / (download) - annotate - [select for diffs], Fri Nov 8 07:16:29 2019 UTC (4 years, 7 months ago) by dlg
Branch: MAIN
Changes since 1.75: +5 -10 lines
Diff to previous 1.75 (colored)

convert interface address change hooks to tasks and a task_list.

this follows what's been done for detach and link state hooks, and
makes handling of hooks generally more robust.

address hooks are a bit different to detach/link state hooks in
that there's only a few things that register hooks (carp, pf, vxlan),
but a lot of places to run the hooks (lots of ipv4 and ipv6 address
configuration).

an address hook cookie was in struct pfi_kif, which is part of the
pf abi. rather than break pfctl -sI, this maintains the void * used
for the cookie and uses it to store a task, which is then used as
intended with the new api.

Revision 1.75 / (download) - annotate - [select for diffs], Thu Nov 7 07:36:32 2019 UTC (4 years, 7 months ago) by dlg
Branch: MAIN
Changes since 1.74: +6 -10 lines
Diff to previous 1.74 (colored)

turn the linkstate hooks into a task list, like the detach hooks.

this is largely mechanical, except for carp. this moves the addition
of the carp link state hook after we're committed to using the new
interface as a carpdev. because the add can't fail, we avoid a
complicated unwind dance. also, this tweaks the carp linkstate hook
so it only updates the relevant carp interface, not all of the
carpdevs on the parent.

hrvoje popovski has tested an early version of this diff and it's
generally ok, but there's some splasserts that this diff fires that
i'll fix in an upcoming diff.

ok claudio@

Revision 1.74 / (download) - annotate - [select for diffs], Wed Nov 6 03:51:26 2019 UTC (4 years, 7 months ago) by dlg
Branch: MAIN
Changes since 1.73: +6 -10 lines
Diff to previous 1.73 (colored)

replace the hooks used with if_detachhooks with a task list.

the main semantic change is that things registering detach hooks
have to allocate and set a task structure that then gets added to
the list. this means if the task is allocated up front (eg, as part
of carps softc or bridges port structure), it avoids the possibility
that adding a hook can fail. a lot of drivers weren't checking for
failure, and unwinding state in the event of failure in other parts
was error prone.

while doing this i discovered that the list operations have to be
in a particular order, but drivers weren't doing that consistently
either. this diff wraps the list ops up so you have to seriously
go out of your way to screw them up.

ive also sprinkled some NET_ASSERT_LOCKED around the list operations
so we can make sure there's no potential for the list to be corrupted,
especially while it's being run.

hrvoje popovski has tested this a bit, and some issues he discovered
have been fixed.

ok sashan@

Revision 1.73 / (download) - annotate - [select for diffs], Mon Jun 10 16:32:51 2019 UTC (5 years ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.72: +5 -5 lines
Diff to previous 1.72 (colored)

Use mallocarray(9) & put some free(9) sizes for M_IPMOPTS allocations.

ok semarie@, visa@

Revision 1.72 / (download) - annotate - [select for diffs], Sun Apr 28 22:15:58 2019 UTC (5 years, 1 month ago) by mpi
Branch: MAIN
Changes since 1.71: +2 -2 lines
Diff to previous 1.71 (colored)

Removes the KERNEL_LOCK() from bridge(4)'s output fast-path.

This redefines the ifp <-> bridge relationship.  No lock can be
currently used across the multiples contexts where the bridge has
tentacles to protect a pointer, use an interface index.

Tested by various, ok dlg@, visa@

Revision 1.71 / (download) - annotate - [select for diffs], Tue Apr 23 10:53:45 2019 UTC (5 years, 1 month ago) by dlg
Branch: MAIN
Changes since 1.70: +3 -4 lines
Diff to previous 1.70 (colored)

a first cut at converting some virtual ethernet interfaces to if_vinput

this let's input processing bypass ifiqs. there's a performance
benefit from this, and it will let me tweak the backpressure detection
mechanism that ifiqs use without impacting on a stack of virtual
interfaces.

ive tested all of these except mpw, which i will end up testing
soon anyway.

Revision 1.70 / (download) - annotate - [select for diffs], Mon Dec 3 17:25:22 2018 UTC (5 years, 6 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.69: +4 -4 lines
Diff to previous 1.69 (colored)

Convert more MH_ALIGN() to m_align(). Also switch from m_gethdr/M_GETHDR
calls to m_get/M_GET calls because M_MOVE_PKTHDR() is initialising
the pkthdr and so it is not needed when allocation the header.
OK bluhm@

Revision 1.69 / (download) - annotate - [select for diffs], Thu Nov 15 22:22:03 2018 UTC (5 years, 6 months ago) by dlg
Branch: MAIN
Changes since 1.68: +25 -3 lines
Diff to previous 1.68 (colored)

add support for txprio configuration

Revision 1.68 / (download) - annotate - [select for diffs], Fri Aug 17 01:53:31 2018 UTC (5 years, 9 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.67: +1 -4 lines
Diff to previous 1.67 (colored)

the stack already counts bytes and packets, so don't do it again here.

makes output stats look plausible.

reported by jason tubnor
ok deraadt@

Revision 1.67 / (download) - annotate - [select for diffs], Tue Feb 20 01:20:37 2018 UTC (6 years, 3 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.66: +15 -2 lines
Diff to previous 1.66 (colored)

add support for setting the tunnel df bit.

ok mpi@

Revision 1.66 / (download) - annotate - [select for diffs], Mon Jan 22 09:05:06 2018 UTC (6 years, 4 months ago) by mpi
Branch: MAIN
Changes since 1.65: +32 -2 lines
Diff to previous 1.65 (colored)

Do not call ip_output() recursively in vxlan_start().

ip_output() currently needs the NET_LOCK() which is not held when an
interface is added to a pf(4) queue.

Fix an issue reported by Jason Tubnor, ok dlg@

Revision 1.65 / (download) - annotate - [select for diffs], Tue Jan 9 15:24:24 2018 UTC (6 years, 5 months ago) by bluhm
Branch: MAIN
Changes since 1.64: +2 -5 lines
Diff to previous 1.64 (colored)

Creating a cloned interface could return ENOMEM due to temporary
memory shortage.  As it is invoked from a system call, it should
not fail and wait instead.
OK visa@ mpi@

Revision 1.64 / (download) - annotate - [select for diffs], Mon Nov 20 10:35:24 2017 UTC (6 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.63: +2 -1 lines
Diff to previous 1.63 (colored)

Sprinkle some NET_ASSERT_LOCKED(), const and co to prepare running
pr_input handlers without KERNEL_LOCK().

ok visa@

Revision 1.63 / (download) - annotate - [select for diffs], Wed Oct 25 09:24:09 2017 UTC (6 years, 7 months ago) by mpi
Branch: MAIN
Changes since 1.62: +14 -2 lines
Diff to previous 1.62 (colored)

Remove Multicast and Broadcast flags from the encapsulated packet in
vxlan(4) like it is done by other tunnelling pseudo-interfaces.

While here sync the comment between multiple interfaces.

Bug report and original diff from Pierre LALET.

Revision 1.62 / (download) - annotate - [select for diffs], Fri Aug 11 21:24:19 2017 UTC (6 years, 10 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.61: +3 -4 lines
Diff to previous 1.61 (colored)

Remove NET_LOCK()'s argument.

Tested by Hrvoje Popovski, ok bluhm@

Revision 1.61 / (download) - annotate - [select for diffs], Thu Aug 10 18:38:33 2017 UTC (6 years, 10 months ago) by reyk
Branch: MAIN
Changes since 1.60: +3 -1 lines
Diff to previous 1.60 (colored)

A missing break in vxlan_sockaddr_cmp() could eventually trick an
vxlan interface into accepting packets for the wrong destination (if
the sockaddr_in6 checks somehow match on sockaddr_in addresses).

Coverity CID 1452902; Severity: Moderate

OK mikeb@

Revision 1.60 / (download) - annotate - [select for diffs], Thu May 4 15:00:24 2017 UTC (7 years, 1 month ago) by bluhm
Branch: MAIN
Changes since 1.59: +8 -9 lines
Diff to previous 1.59 (colored)

Introduce sstosa() for converting sockaddr_storage with a type safe
inline function instead of casting it to sockaddr.  While there,
use inline instead of __inline for all these conversions.  Some
struct sockaddr casts can be avoided completely.
OK dhill@ mpi@

Revision 1.59 / (download) - annotate - [select for diffs], Tue Apr 11 14:43:49 2017 UTC (7 years, 2 months ago) by dhill
Branch: MAIN
Changes since 1.58: +3 -3 lines
Diff to previous 1.58 (colored)

Partially revert previous mallocarray conversions that contain
constants.

The consensus is that if both operands are constant, we don't need
mallocarray.  Reminded by tedu@

ok deraadt@

Revision 1.58 / (download) - annotate - [select for diffs], Sun Apr 9 17:57:58 2017 UTC (7 years, 2 months ago) by dhill
Branch: MAIN
Changes since 1.57: +3 -3 lines
Diff to previous 1.57 (colored)

Use mallocarray to allocate multicast group memberships.

ok deraadt@

Revision 1.57 / (download) - annotate - [select for diffs], Sun Jan 22 10:17:39 2017 UTC (7 years, 4 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.56: +1 -3 lines
Diff to previous 1.56 (colored)

move counting if_opackets next to counting if_obytes in if_enqueue.

this means packets are consistently counted in one place, unlike the
many and various ways that drivers thought they should do it.

ok mpi@ deraadt@

Revision 1.56 / (download) - annotate - [select for diffs], Wed Jan 4 12:49:49 2017 UTC (7 years, 5 months ago) by mikeb
Branch: MAIN
Changes since 1.55: +5 -25 lines
Diff to previous 1.55 (colored)

As noticed by bluhm@ the netlock is required for the multicast cleanup

While here, remove unnecessary splnet's.

ok mpi

Revision 1.55 / (download) - annotate - [select for diffs], Tue Jan 3 15:35:34 2017 UTC (7 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.54: +6 -7 lines
Diff to previous 1.54 (colored)

Don't try to reconfigure the multicast group in the detach handler of
the multicast interface - simply clear the VXLAN configuration when
the associated multicast interface disappears.  This fixes some
locking and recursion problems.

OK mpi@ mikeb@

Revision 1.54 / (download) - annotate - [select for diffs], Tue Dec 13 06:51:11 2016 UTC (7 years, 5 months ago) by dlg
Branch: MAIN
Changes since 1.53: +15 -11 lines
Diff to previous 1.53 (colored)

make v6 tunnel address handling consider ipv6 scope.

an earlier version of this diff was ok mpi@

Revision 1.53 / (download) - annotate - [select for diffs], Fri Dec 2 11:16:04 2016 UTC (7 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.52: +2 -2 lines
Diff to previous 1.52 (colored)

Rremoves 'struct route_in6 *' argument from in6_selectsrc().

Move the corresponding code in in6_pcbselsrc().  This reduces
differences with IPv4 and will help us to get rid of 'struct route*'.

ok vgross@

Revision 1.52 / (download) - annotate - [select for diffs], Tue Nov 29 10:09:57 2016 UTC (7 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (colored)

For virtual Ethernet drivers that don't have a technical limit of the
hardmtu, pick a value of 65435 that leaves space for some
encapsulation and almost a complete max-IP packet.  After some
discussion we picked this arbitrary value.

OK dlg@

Revision 1.51 / (download) - annotate - [select for diffs], Tue Oct 25 16:31:08 2016 UTC (7 years, 7 months ago) by bluhm
Branch: MAIN
Changes since 1.50: +49 -11 lines
Diff to previous 1.50 (colored)

Make kernel without INET6 compile again.
OK mikeb@

Revision 1.50 / (download) - annotate - [select for diffs], Fri Oct 14 10:25:02 2016 UTC (7 years, 7 months ago) by mikeb
Branch: MAIN
Changes since 1.49: +19 -9 lines
Diff to previous 1.49 (colored)

Fulfil our contractual obligations with ether_input

Since ether_input expects the m_data to point directly at the Ethernet
header and most upper layer protocols immediately following Ethernet
expect their headers to be aligned to the 4 byte boundary, we need to
ensure that the decapsulated VXLAN packet payload satisfies these
requirements.

prompted by a diff by vgross@, with input from dlg@, ok yasuoka

Revision 1.49 / (download) - annotate - [select for diffs], Fri Oct 7 06:16:03 2016 UTC (7 years, 8 months ago) by yasuoka
Branch: MAIN
Changes since 1.48: +21 -3 lines
Diff to previous 1.48 (colored)

Fix vxlan_lookup() to comply the assumption of ether_input().  Put the
entire ethernet header on first mbuf and align 32bit at the payload.
Also fix the vxlan_output() not to cause an alignment fault.  Use a
new mbuf for VXLAN header instead of M_PREPEND to make sure that the
mbuf is aligned 32bit.  This is required to align 32 bit at the outer
IP header.

input vgross mikeb
ok dlg

Revision 1.48 / (download) - annotate - [select for diffs], Fri Sep 30 10:22:05 2016 UTC (7 years, 8 months ago) by yasuoka
Branch: MAIN
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored)

Accept a packet smaller than ETHERMIN.

ok reyk

Revision 1.47 / (download) - annotate - [select for diffs], Thu Sep 29 11:37:44 2016 UTC (7 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.46: +5 -5 lines
Diff to previous 1.46 (colored)

Rename brtag_src/brtag_dst to brtag_peer/brtag_local to avoid
confusion about the tunnel endpoints when responding to the peer.

OK yasuoka@

Revision 1.46 / (download) - annotate - [select for diffs], Wed Sep 28 14:26:43 2016 UTC (7 years, 8 months ago) by yasuoka
Branch: MAIN
Changes since 1.45: +3 -3 lines
Diff to previous 1.45 (colored)

Fix vxlan to use the destination address correctly.

Use the dst of the bridge_tunneltag for src on vxlan output and vice
versa.

ok reyk

Revision 1.45 / (download) - annotate - [select for diffs], Wed Sep 28 14:10:35 2016 UTC (7 years, 8 months ago) by yasuoka
Branch: MAIN
Changes since 1.44: +4 -5 lines
Diff to previous 1.44 (colored)

Fix the way of checking the length of vxlan packet and made it strict.

ok reyk

Revision 1.44 / (download) - annotate - [select for diffs], Sun Sep 4 11:14:44 2016 UTC (7 years, 9 months ago) by reyk
Branch: MAIN
Changes since 1.43: +1 -9 lines
Diff to previous 1.43 (colored)

Remove the IFF_LINK0 option to send the response back to the peer's
UDP src port - the VXLAN RFC clearly says that packet should be send
to the configured VXLAN port (4789).

OK mpi@

Revision 1.43 / (download) - annotate - [select for diffs], Sat Sep 3 13:46:57 2016 UTC (7 years, 9 months ago) by reyk
Branch: MAIN
Changes since 1.42: +77 -19 lines
Diff to previous 1.42 (colored)

Add support for a multipoint-to-multipoint mode in vxlan(4).  In this
mode, vxlan(4) must be configured to accept any virtual network
identifier with "vnetid any" and added to a bridge(4) or switch(4).
This way the driver will dynamically learn the tunnel endpoints and
their vnetids for the responses and can be used to dynamically bridge
between VXLANs.  It is also being used in combination with switch(4)
and the OpenFlow tunnel classifiers.

With input from yasuoka@ goda@
OK deraadt@ dlg@

Revision 1.42 / (download) - annotate - [select for diffs], Sun Aug 7 14:26:26 2016 UTC (7 years, 10 months ago) by reyk
Branch: MAIN
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored)

whitespace

Revision 1.41 / (download) - annotate - [select for diffs], Sun Aug 7 13:49:12 2016 UTC (7 years, 10 months ago) by reyk
Branch: MAIN
Changes since 1.40: +7 -7 lines
Diff to previous 1.40 (colored)

Define VXLAN_VNI_UNSET and VXLAN_VNI_MAX instead of using magic numbers.
No functional change.

Revision 1.40 / (download) - annotate - [select for diffs], Sat Aug 6 14:33:33 2016 UTC (7 years, 10 months ago) by reyk
Branch: MAIN
Changes since 1.39: +226 -88 lines
Diff to previous 1.39 (colored)

Add support for IPv6 tunnel endpoints.  This currently only works for
unicast mode, multicast is not yet supported.

	ifconfig vxlan0 tunnel fd00::1 fd00::2

Roughly based on an earlier diff by goda@
OK yasuoka@

Revision 1.39 / (download) - annotate - [select for diffs], Sat Aug 6 14:29:48 2016 UTC (7 years, 10 months ago) by reyk
Branch: MAIN
Changes since 1.38: +2 -6 lines
Diff to previous 1.38 (colored)

Fix multicast mode (destination is a multicast IP): the BCAST and
MCAST flags have to be cleared from the mbuf after decapsulating
packets.  This fixes tunneled broadcast packets, eg. ARP.  It used to
work before the input path was changed the flags got cleared later in
the stack.

OK yasuoka@

Revision 1.38 / (download) - annotate - [select for diffs], Wed Apr 13 11:41:15 2016 UTC (8 years, 1 month ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.37: +1 -2 lines
Diff to previous 1.37 (colored)

We're always ready!  So send IFQ_SET_READY() to the bitbucket.

Revision 1.37 / (download) - annotate - [select for diffs], Fri Jan 22 11:56:14 2016 UTC (8 years, 4 months ago) by goda
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored)

Drop packets whose VNI flag is not set and VNI is not zero

ok reyk@ yasuoka@

Revision 1.36 / (download) - annotate - [select for diffs], Thu Jan 14 09:20:31 2016 UTC (8 years, 4 months ago) by mpi
Branch: MAIN
Changes since 1.35: +2 -5 lines
Diff to previous 1.35 (colored)

No need for a splnet() dance around IFQ_DEQUEUE() anymore.

From David Hill, ok dlg@

Revision 1.35 / (download) - annotate - [select for diffs], Sat Dec 5 10:07:55 2015 UTC (8 years, 6 months ago) by tedu
Branch: MAIN
Changes since 1.34: +1 -2 lines
Diff to previous 1.34 (colored)

remove old lint annotations

Revision 1.34 / (download) - annotate - [select for diffs], Fri Nov 27 16:17:52 2015 UTC (8 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.33: +20 -1 lines
Diff to previous 1.33 (colored)

Keep "struct vxlan_softc" private to prevent pulling more headers when
<net/if_vxlan.h> is included.

Revision 1.33 / (download) - annotate - [select for diffs], Sun Oct 25 12:05:40 2015 UTC (8 years, 7 months ago) by mpi
Branch: MAIN
Changes since 1.32: +1 -4 lines
Diff to previous 1.32 (colored)

arp_ifinit() is no longer required.

Revision 1.32 / (download) - annotate - [select for diffs], Fri Oct 23 01:19:04 2015 UTC (8 years, 7 months ago) by dlg
Branch: MAIN
Changes since 1.31: +35 -15 lines
Diff to previous 1.31 (colored)

tweak the vnetid so it can be optional and therefore cleared/deleted.

the abstract vnetid is promoted to a uin32_t, and adds a SIOCDVNETID
ioctl so it can be cleared.

this is all because i set an assignment on implementing a virtual
network interface and the students got confused when vnetid 0 didnt
show up in ifconfig output.

the vnetid in the vxlan(4) protocol is optional, but the current
code confuses 0 with no vnetid being set. this makes it clear.

ok reyk@ who also simplified my diff

Revision 1.31 / (download) - annotate - [select for diffs], Thu Oct 15 13:59:21 2015 UTC (8 years, 7 months ago) by yasuoka
Branch: MAIN
Changes since 1.30: +3 -5 lines
Diff to previous 1.30 (colored)

Fix previous.  The port number is not included in sc_src and it is
checked already at beginning of the loop.

ok reyk

Revision 1.30 / (download) - annotate - [select for diffs], Mon Oct 12 10:51:49 2015 UTC (8 years, 8 months ago) by dlg
Branch: MAIN
Changes since 1.29: +1 -12 lines
Diff to previous 1.29 (colored)

dont need to do suser checks in ioctl paths cos if.c does them for us.

ok mikeb@ mpi@

Revision 1.29 / (download) - annotate - [select for diffs], Sat Oct 3 07:22:05 2015 UTC (8 years, 8 months ago) by yasuoka
Branch: MAIN
Changes since 1.28: +32 -4 lines
Diff to previous 1.28 (colored)

When multiple vxlan interfaces are configured with same VNI, select the
interface whose tunnel destination corresponded to the incoming packets'
source address.

ok reyk

Revision 1.28 / (download) - annotate - [select for diffs], Wed Sep 9 20:05:21 2015 UTC (8 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.27: +3 -1 lines
Diff to previous 1.27 (colored)

if_put after the if_get.

ok mpi@ claudio@

Revision 1.27 / (download) - annotate - [select for diffs], Mon Jul 20 22:54:30 2015 UTC (8 years, 10 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.26: +1 -4 lines
Diff to previous 1.26 (colored)

Remove splassert(IPL_NET) from if_input().

if_input() has been designed to be able to safely handle a batch of
packets from physical drivers to the network stack.  Most of these
drivers have an interrupt routine executed at IPL_NET and the check
made sense during the conversion.  However we also want to re-enqueue
packets with if_input() from the network stack currently running at
IPL_SOFTNET.

ok claudio@

Revision 1.26 / (download) - annotate - [select for diffs], Sat Jul 18 22:15:14 2015 UTC (8 years, 10 months ago) by goda
Branch: MAIN
Changes since 1.25: +4 -1 lines
Diff to previous 1.25 (colored)

Raise SPL to SPL_NET before calling if_input() in vxlan_lookup().

ok reyk@ mpi@

Revision 1.25 / (download) - annotate - [select for diffs], Wed Jun 24 09:40:54 2015 UTC (8 years, 11 months ago) by mpi
Branch: MAIN
Changes since 1.24: +1 -3 lines
Diff to previous 1.24 (colored)

Increment if_ipackets in if_input().

Note that pseudo-drivers not using if_input() are not affected by this
conversion.

ok mikeb@, kettenis@, claudio@, dlg@

Revision 1.24 / (download) - annotate - [select for diffs], Mon Apr 13 08:40:32 2015 UTC (9 years, 2 months ago) by mpi
Branch: MAIN
Changes since 1.23: +5 -10 lines
Diff to previous 1.23 (colored)

ether_input() should not longer be called directly so convert to
if_input().

Needed for the upcoming pseudo-driver integration work.

ok dlg@

Revision 1.23 / (download) - annotate - [select for diffs], Tue Apr 7 10:46:20 2015 UTC (9 years, 2 months ago) by mpi
Branch: MAIN
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

Do not pass an `ifp' argument to interface input handlers since it
might be overwritten by pseudo-drivers.

ok dlg@, henning@

Revision 1.22 / (download) - annotate - [select for diffs], Sat Mar 14 03:38:51 2015 UTC (9 years, 3 months ago) by jsg
Branch: MAIN
Changes since 1.21: +1 -2 lines
Diff to previous 1.21 (colored)

Remove some includes include-what-you-use claims don't
have any direct symbols used.  Tested for indirect use by compiling
amd64/i386/sparc64 kernels.

ok tedu@ deraadt@

Revision 1.21 / (download) - annotate - [select for diffs], Sat Jan 24 00:29:06 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.20: +5 -5 lines
Diff to previous 1.20 (colored)

Userland (base & ports) was adapted to always include <netinet/in.h>
before <net/pfvar.h> or <net/if_pflog.h>.  The kernel files can be
cleaned up next.  Some sockaddr_union steps make it into here as well.
ok naddy

Revision 1.20 / (download) - annotate - [select for diffs], Fri Dec 19 17:14:40 2014 UTC (9 years, 5 months ago) by tedu
Branch: MAIN
Changes since 1.19: +1 -19 lines
Diff to previous 1.19 (colored)

unifdef INET in net code as a precursor to removing the pretend option.
long live the one true internet.
ok henning mikeb

Revision 1.19 / (download) - annotate - [select for diffs], Wed Dec 17 09:57:13 2014 UTC (9 years, 5 months ago) by mpi
Branch: MAIN
Changes since 1.18: +4 -4 lines
Diff to previous 1.18 (colored)

Remove the "multicast_" prefix from the fields a multicast-only struct.

Prodded by claudio@ and mikeb@

Revision 1.18 / (download) - annotate - [select for diffs], Wed Dec 17 09:45:59 2014 UTC (9 years, 5 months ago) by mpi
Branch: MAIN
Changes since 1.17: +5 -4 lines
Diff to previous 1.17 (colored)

Use an interface index instead of a pointer for multicast options.

Output interface (port) selection for multicast traffic is not done via
route lookups.  Instead the output ifp is registred when setsockopt(2)
is called with the IP{V6,}_MULTICAST_IF option.  But since there is no
mechanism to invalidate such pointer stored in a pcb when an interface
is destroyed/removed, it might lead your kernel to fault.

Prevent a fault upon resume reported by frantisek holop, thanks!

ok mikeb@, claudio@

Revision 1.17 / (download) - annotate - [select for diffs], Fri Dec 5 15:50:04 2014 UTC (9 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.16: +2 -1 lines
Diff to previous 1.16 (colored)

Explicitly include <net/if_var.h> instead of pulling it in <net/if.h>.

ok mikeb@, krw@, bluhm@, tedu@

Revision 1.16 / (download) - annotate - [select for diffs], Sun Nov 23 07:39:02 2014 UTC (9 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

length argument for some free() calls; ok doug

Revision 1.15 / (download) - annotate - [select for diffs], Tue Jul 22 11:06:09 2014 UTC (9 years, 10 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.14: +1 -2 lines
Diff to previous 1.14 (colored)

Fewer <netinet/in_systm.h> !

Revision 1.14 / (download) - annotate - [select for diffs], Sat Jul 12 18:44:22 2014 UTC (9 years, 11 months ago) by tedu
Branch: MAIN
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.

Revision 1.13 / (download) - annotate - [select for diffs], Mon Apr 21 12:22:25 2014 UTC (10 years, 1 month ago) by henning
Branch: MAIN
Changes since 1.12: +1 -1 lines
Diff to previous 1.12 (colored)

ip_output() using varargs always struck me as bizarre, esp since it's only
ever used to pass on uint32 (for ipsec). stop that madness and just pass
the uint32, 0 in all cases but the two that pass the ipsec flowinfo.
ok deraadt reyk guenther

Revision 1.12 / (download) - annotate - [select for diffs], Mon Apr 14 09:06:42 2014 UTC (10 years, 1 month ago) by mpi
Branch: MAIN
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored)

"struct pkthdr" holds a routing table ID, not a routing domain one.
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@

Revision 1.11 / (download) - annotate - [select for diffs], Fri Apr 11 08:44:37 2014 UTC (10 years, 2 months ago) by mpi
Branch: MAIN
Changes since 1.10: +7 -7 lines
Diff to previous 1.10 (colored)

Interfaces are associated to rdomains, make it clear by renaming
`sc_rtableid' into `sc_rdomain'.  No functional change.

ok reyk@

Revision 1.10 / (download) - annotate - [select for diffs], Tue Oct 22 08:34:04 2013 UTC (10 years, 7 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

whitespace

Revision 1.9 / (download) - annotate - [select for diffs], Sat Oct 19 18:22:37 2013 UTC (10 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.8: +62 -33 lines
Diff to previous 1.8 (colored)

Improve the address and linkstate hooks and add an additional detach
hook to track any changes of the parent multicast interface.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Oct 19 14:46:31 2013 UTC (10 years, 7 months ago) by mpi
Branch: MAIN
Changes since 1.7: +1 -10 lines
Diff to previous 1.7 (colored)

Uniformize drivers doing nothing with their multicast filters to make
them ignore the SIOC{ADD,DEL}MULTI ioctls.

ok reyk@, claudio@

Revision 1.7 / (download) - annotate - [select for diffs], Sat Oct 19 11:37:20 2013 UTC (10 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.6: +6 -6 lines
Diff to previous 1.6 (colored)

In an ideal world, we would use splsoftnet() for all the interface
configuration steps.  But vxlan(4) has to configure the link state and
address hooks of a parent interface that potentially need splnet().
So revert everything back to use splnet() for now.

Discussed with mpi@

Revision 1.6 / (download) - annotate - [select for diffs], Sat Oct 19 11:20:08 2013 UTC (10 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.5: +103 -24 lines
Diff to previous 1.5 (colored)

When a multicast tunnel destination is configured, we have to detect address
and link state changes on the interface that is sending out the tunnel
traffic.  Attach a link state and address hook in this case and reset the
multicast configuration.  This also fixes a problem on VMware that looses
the multicast associations when the virtual link state of the NIC is
triggered.

Revision 1.5 / (download) - annotate - [select for diffs], Tue Oct 15 10:24:41 2013 UTC (10 years, 7 months ago) by mpi
Branch: MAIN
Changes since 1.4: +26 -18 lines
Diff to previous 1.4 (colored)

Remove the multicast filter from the ``real'' interface when destroying
a vxlan(4) interface and convert some splnet() to splsoftnet() when
appropriate.

ok reyk@

Revision 1.4 / (download) - annotate - [select for diffs], Mon Oct 14 13:04:26 2013 UTC (10 years, 7 months ago) by mpi
Branch: MAIN
Changes since 1.3: +7 -8 lines
Diff to previous 1.3 (colored)

Make use of satosin() when applicable plus a couple of style nits.

ok reyk@

Revision 1.3 / (download) - annotate - [select for diffs], Sun Oct 13 12:21:54 2013 UTC (10 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.2: +4 -4 lines
Diff to previous 1.2 (colored)

whitespace

Revision 1.2 / (download) - annotate - [select for diffs], Sun Oct 13 10:41:11 2013 UTC (10 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.1: +9 -2 lines
Diff to previous 1.1 (colored)

Set the default MTU to full 1500 bytes.  We do not want to encourage
running vxlan(4) with a lowered MTU of just 1450 bytes instead of
bumping the MTU of the transport interfaces to at least 1550 or
preferrably 1600 bytes.

Revision 1.1 / (download) - annotate - [select for diffs], Sun Oct 13 10:10:03 2013 UTC (10 years, 8 months ago) by reyk
Branch: MAIN

Import vxlan(4), the virtual extensible local area network tunnel
interface.  VXLAN is a UDP-based tunnelling protocol for overlaying
virtualized layer 2 networks over layer 3 networks. The implementation
is based on draft-mahalingam-dutt-dcops-vxlan-04 and has been tested
with other implementations in the wild.

put it in deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.