OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.25 / (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_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, HEAD
Changes since 1.24: +1 -1 lines
Diff to previous 1.24 (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.24 / (download) - annotate - [select for diffs], Wed Feb 24 06:44:54 2021 UTC (3 years, 3 months ago) by dlg
Branch: MAIN
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

fix the length check on arp packets when handling arp filter rules.

another bridge feature i'm not convinced people actually use.

ok jmatthew@ claudio@

Revision 1.23 / (download) - annotate - [select for diffs], Thu Jan 28 20:06:38 2021 UTC (3 years, 4 months ago) by mvs
Branch: MAIN
Changes since 1.22: +4 -2 lines
Diff to previous 1.22 (colored)

bridge(4): convert ifunit() to if_unit(9)

ok bluhm@ sashan@

Revision 1.22 / (download) - annotate - [select for diffs], Mon Jan 25 19:47:16 2021 UTC (3 years, 4 months ago) by mvs
Branch: MAIN
Changes since 1.21: +8 -29 lines
Diff to previous 1.21 (colored)

We have this sequence in bridge(4) ioctl(2) path:

	ifs = ifunit(req->ifbr_ifsname);
		if (ifs == NULL) {
			error = ENOENT;
			break;
		}
	if (ifs->if_bridgeidx != ifp->if_index) {
		error = ESRCH;
		break;
	}
	bif = bridge_getbif(ifs);

This sequence repeats 8 times. Also we don't check value returned by
bridge_getbig() before use. Newly introduced bridge_getbig() function
replaces this sequence. This not only reduces duplicated code but also
makes `bif' dereference safe.

ok bluhm@

Revision 1.21 / (download) - annotate - [select for diffs], Wed Jun 24 22:03:42 2020 UTC (3 years, 11 months ago) by cheloha
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored)

kernel: use gettime(9)/getuptime(9) in lieu of time_second(9)/time_uptime(9)

time_second(9) and time_uptime(9) are widely used in the kernel to
quickly get the system UTC or system uptime as a time_t.  However,
time_t is 64-bit everywhere, so it is not generally safe to use them
on 32-bit platforms: you have a split-read problem if your hardware
cannot perform atomic 64-bit reads.

This patch replaces time_second(9) with gettime(9), a safer successor
interface, throughout the kernel.  Similarly, time_uptime(9) is replaced
with getuptime(9).

There is a performance cost on 32-bit platforms in exchange for
eliminating the split-read problem: instead of two register reads you
now have a lockless read loop to pull the values from the timehands.
This is really not *too* bad in the grand scheme of things, but
compared to what we were doing before it is several times slower.

There is no performance cost on 64-bit (__LP64__) platforms.

With input from visa@, dlg@, and tedu@.

Several bugs squashed by visa@.

ok kettenis@

Revision 1.20 / (download) - annotate - [select for diffs], Tue Jul 9 15:15:49 2019 UTC (4 years, 11 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.19: +4 -2 lines
Diff to previous 1.19 (colored)

Add missing mtx_leave() in error path.

Reported by kn@, ok visa@

Revision 1.19 / (download) - annotate - [select for diffs], Sun May 12 19:53:22 2019 UTC (5 years, 1 month ago) by mpi
Branch: MAIN
Changes since 1.18: +15 -3 lines
Diff to previous 1.18 (colored)

Switch the list of span interfaces and interfaces to SMR.

This removes the KERNEL_LOCK() around the list iteration in bridge_enqueue().

Since the NET_LOCK() isn't protecting any data structure, release it early
in all the code paths coming from the Network Stack to prevent possible
deadlock situations with smr_barrier().

bridge_input() is still KERNEL_LOCK()ed as well as bridge_filterrule().

ok visa@

Revision 1.18 / (download) - annotate - [select for diffs], Sun Apr 28 22:15:57 2019 UTC (5 years, 1 month ago) by mpi
Branch: MAIN
Changes since 1.17: +39 -33 lines
Diff to previous 1.17 (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.17 / (download) - annotate - [select for diffs], Fri Mar 8 17:48:35 2019 UTC (5 years, 3 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.16: +75 -4 lines
Diff to previous 1.16 (colored)

Move the tag mechanism outside of net/if_bridge.c.

This will help for future (un)locking.

ok visa@

Revision 1.16 / (download) - annotate - [select for diffs], Wed Feb 20 17:11:51 2019 UTC (5 years, 3 months ago) by mpi
Branch: MAIN
Changes since 1.15: +32 -10 lines
Diff to previous 1.15 (colored)

Protect the hash table with a mutex.

inputs & ok visa@

Revision 1.15 / (download) - annotate - [select for diffs], Sun Feb 17 15:21:31 2019 UTC (5 years, 3 months ago) by mpi
Branch: MAIN
Changes since 1.14: +7 -8 lines
Diff to previous 1.14 (colored)

Make bridge_rtupdate() return an error value instead of a pointer.

Revision 1.14 / (download) - annotate - [select for diffs], Thu Feb 14 18:19:13 2019 UTC (5 years, 3 months ago) by mpi
Branch: MAIN
Changes since 1.13: +5 -1 lines
Diff to previous 1.13 (colored)

Use timeout_barrier() when bringing the bridge(4) down and only execute
the timeout handler if the interface is running.

ok claudio@

Revision 1.13 / (download) - annotate - [select for diffs], Wed Dec 12 14:19:15 2018 UTC (5 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.12: +10 -2 lines
Diff to previous 1.12 (colored)

Various cleanups:

- Unify the two hooks by passing the same argument
- Check for nullity before dereferencing `if_bridgeport', this will
  matter when we go MP
- Use the same pattern to find a member in the ioctl path


ok bluhm@, visa@

Revision 1.12 / (download) - annotate - [select for diffs], Wed Nov 14 17:07:44 2018 UTC (5 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.11: +67 -63 lines
Diff to previous 1.11 (colored)

Batch copyout(9)s in preparation for finer locking.

Tested by Hrvoje Popovski, inputs and ok visa@

Revision 1.11 / (download) - annotate - [select for diffs], Fri Oct 26 14:55:27 2018 UTC (5 years, 7 months ago) by mpi
Branch: MAIN
Changes since 1.10: +16 -13 lines
Diff to previous 1.10 (colored)

Make it clear that `if_bridgeport' is dereferenced in the ioctl path
by making all handlers consistent.

ok bluhm@, visa@

Revision 1.10 / (download) - annotate - [select for diffs], Mon Oct 22 13:18:23 2018 UTC (5 years, 7 months ago) by mpi
Branch: MAIN
Changes since 1.9: +11 -11 lines
Diff to previous 1.9 (colored)

Rename 'bridge_iflist' variables for coherency, missed in previous.

Revision 1.9 / (download) - annotate - [select for diffs], Thu Sep 27 12:39:36 2018 UTC (5 years, 8 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.8: +10 -10 lines
Diff to previous 1.8 (colored)

Coherently name "struct bridge_iflist" variables `bif'.

ok visa@

Revision 1.8 / (download) - annotate - [select for diffs], Mon Feb 5 05:06:51 2018 UTC (6 years, 4 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.7: +14 -10 lines
Diff to previous 1.7 (colored)

bcmp -> memcmp; kinda req'd / not-just-kinda ok'd by claudio

Revision 1.7 / (download) - annotate - [select for diffs], Mon Feb 5 03:51:53 2018 UTC (6 years, 4 months ago) by henning
Branch: MAIN
Changes since 1.6: +51 -1 lines
Diff to previous 1.6 (colored)

implement an arp filter
allows arp (and rarp) requests and replies to be matched, including matching
based on the source and target host and protocol adresses, and thus control
over arp traffic and learning.
written for medical x-ray machines, but useful in many spread out L2 networks
ok claudio benno

Revision 1.6 / (download) - annotate - [select for diffs], Thu May 4 15:00:24 2017 UTC (7 years, 1 month ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (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.5 / (download) - annotate - [select for diffs], Wed Jan 11 08:47:48 2017 UTC (7 years, 5 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.4: +5 -14 lines
Diff to previous 1.4 (colored)

No need for a splsoftnet()/splx() dance when the KERNEL_LOCK() is what
serialize access to bridge(4) data structures.

ok mikeb@

Revision 1.4 / (download) - annotate - [select for diffs], Thu Sep 29 11:37:43 2016 UTC (7 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (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.3 / (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.2: +8 -11 lines
Diff to previous 1.2 (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.2 / (download) - annotate - [select for diffs], Wed Dec 2 08:04:12 2015 UTC (8 years, 6 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.1: +1 -21 lines
Diff to previous 1.1 (colored)

Include cleanup.

Revision 1.1 / (download) - annotate - [select for diffs], Tue Dec 1 18:28:29 2015 UTC (8 years, 6 months ago) by goda
Branch: MAIN

Split functions in if_bridge.c into if_bridge.c bridgectl.c .

Splitting functions in if_bridge.c into if_bridge.c for the forwarding part
and bridgectl.c for the control part. It shouldn't have any functional change.

ok reyk@ mpi@ yasuoka@

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.