OpenBSD CVS

CVS log for src/sbin/ifconfig/brconfig.c


[BACK] Up to [local] / src / sbin / ifconfig

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.32 / (download) - annotate - [select for diffs], Thu Nov 23 03:38:34 2023 UTC (6 months, 2 weeks ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.31: +37 -1 lines
Diff to previous 1.31 (colored)

add an endpoint command for "bridges" that use addresses as endpoints.

this can be used to add static entries on interfaces like vxlan(4).

Revision 1.31 / (download) - annotate - [select for diffs], Fri Jul 8 07:04:54 2022 UTC (23 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.30: +1 -2 lines
Diff to previous 1.30 (colored)

remove unused variables

Revision 1.30 / (download) - annotate - [select for diffs], Thu Nov 11 09:39:16 2021 UTC (2 years, 6 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.29: +2 -87 lines
Diff to previous 1.29 (colored)

Remove switch(4) specific bits from ifconfig.
OK deraadt@ patrick@

Revision 1.29 / (download) - annotate - [select for diffs], Sat Aug 8 12:38:21 2020 UTC (3 years, 10 months ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.28: +47 -84 lines
Diff to previous 1.28 (colored)

Replace strto*l(3) with strtonum(3)

Some bridge options allow values bigger than the corresponding datatype
and thus pass overflowed values to the kernel, not all options to range
checks and setting invalid "portno" complains about "portidx" values.

Use the same, simpler strtonum() idiom across all options with consistent
error messages and proper [U]INT*_MAX defines as max values to match the
datatype and all option handlers to be consistent (in less code).

Keep deferring option dependent min/max value checking to the ioctl(2)
interface, i.e. values documented in ifconfig(8) are not duplicated in
strtonum() calls.

OK millert

Revision 1.28 / (download) - annotate - [select for diffs], Wed Aug 5 06:22:11 2020 UTC (3 years, 10 months ago) by kn
Branch: MAIN
Changes since 1.27: +15 -2 lines
Diff to previous 1.27 (colored)

Print tpmr(4) members

tpmr is a trivial bridge and has no specific ioctls, so to distinguish
it from the rest we must rely on the interface name;  assuming that it
is tpmr because neither is_bridge() nor is_switch() return success is
not possible due to the way ifconfig is designed: it runs all *_status()
commands for all interface types.

OK dlg

Revision 1.27 / (download) - annotate - [select for diffs], Wed Aug 5 06:12:43 2020 UTC (3 years, 10 months ago) by kn
Branch: MAIN
Changes since 1.26: +13 -19 lines
Diff to previous 1.26 (colored)

Merge switch_status() into bridge_status()

This is to reduce duplicate code and prepare for bridge_status() to cover
all bridge like interfaces: bridge(4), switch(4) and tpmr(4).

OK dlg

Revision 1.26 / (download) - annotate - [select for diffs], Wed Jul 29 12:13:28 2020 UTC (3 years, 10 months ago) by kn
Branch: MAIN
Changes since 1.25: +1 -18 lines
Diff to previous 1.25 (colored)

Remove redundant bridge checks

bridge_status() and switch_status() do the regular sanity check with
SIOCGIFFLAGS, but both functions also call is_switch() and bridge_status()
also calls is_bridge().

is_bridge() checks SIOCGIFFLAGS again, then both is_*() helpers finally do
driver specific ioctl(2) calls to test whether the given interface is
indeed a bridge(4) or a switch(4).

SIOCGIFFLAGS serves no purpose here and is taken care of in ifconfig.c's
getinfo(), so remove its calls from brconfig.c entirely.

OK dlg

Revision 1.25 / (download) - annotate - [select for diffs], Wed Jan 22 06:24:07 2020 UTC (4 years, 4 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

remove semicolons not needed after } statements. ok deraadt

Revision 1.24 / (download) - annotate - [select for diffs], Thu Oct 24 18:54:10 2019 UTC (4 years, 7 months ago) by bluhm
Branch: MAIN
Changes since 1.23: +103 -103 lines
Diff to previous 1.23 (colored)

Fix ifconfig(8) compiler warnings regarding variable "name" reuse.
Call the global variable with the name of the interface "ifname".
Do not pass it around, just use it globally.  Do not use "ifname"
for anything else.
OK deraadt@

Revision 1.23 / (download) - annotate - [select for diffs], Thu Oct 17 18:37:38 2019 UTC (4 years, 7 months ago) by bluhm
Branch: MAIN
Changes since 1.22: +47 -47 lines
Diff to previous 1.22 (colored)

Fix some compiler warings in ifconfig(8).  Move all prototypes and
variables used in multiple .c files into common ifconfig.h.  Basically
this renames brconfig.h to ifconfig.h and also uses it for sff.c.
Fix missing prototypes.  Global variable name s is bad as it shadows
local variables.  Call it sock and use it everywhere.
OK deraadt@

Revision 1.22 / (download) - annotate - [select for diffs], Fri Jun 28 13:32:44 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.21: +44 -44 lines
Diff to previous 1.21 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.21 / (download) - annotate - [select for diffs], Fri May 10 01:29:31 2019 UTC (5 years, 1 month ago) by guenther
Branch: MAIN
Changes since 1.20: +1 -2 lines
Diff to previous 1.20 (colored)

Delete superfluous #includes of <ifaddrs.h>, <net/if_dl.h>, and <net/if_enc.h>

ok krw@, jsg@

Revision 1.20 / (download) - annotate - [select for diffs], Fri Jul 13 08:41:32 2018 UTC (5 years, 10 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.19: +1 -2 lines
Diff to previous 1.19 (colored)

Unused variables.

ok henning@ phessler@

Revision 1.19 / (download) - annotate - [select for diffs], Sat Feb 24 06:31:47 2018 UTC (6 years, 3 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.18: +12 -5 lines
Diff to previous 1.18 (colored)

return early on some unhandled ioctls rather than err().

Revision 1.18 / (download) - annotate - [select for diffs], Thu Feb 8 13:15:32 2018 UTC (6 years, 4 months ago) by mpi
Branch: MAIN
Changes since 1.17: +59 -1 lines
Diff to previous 1.17 (colored)

Add a new '-protected' option for bridge members.

Bridge members that are part of the same protected domain, refered by
a number between 1 and 31, cannot talk to each others.  This is useful
to isolate VMs or untrusted networks at layer 2.

Members can be part of multiple protected domain making it possible to
create complex protected setups.

ok ccardenas@, claudio@, dlg@, henning@

Revision 1.17 / (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.16: +109 -13 lines
Diff to previous 1.16 (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.16 / (download) - annotate - [select for diffs], Mon Jul 31 02:32:11 2017 UTC (6 years, 10 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.15: +8 -4 lines
Diff to previous 1.15 (colored)

The handling of 'add' used by bridge and switch in ifconfig does not
error out if the ioctl returns EEXIST.  Do the same for the switch
specific 'addlocal' and 'portno' ioctls so netstart won't error out
when rerun with the same settings in hostname.switchN.

ok reyk@

Revision 1.15 / (download) - annotate - [select for diffs], Wed Jun 7 16:47:29 2017 UTC (7 years ago) by naddy
Branch: MAIN
Changes since 1.14: +2 -3 lines
Diff to previous 1.14 (colored)

Fix clang warning about tautological compare: an unsigned long can't
be negative.  ok deraadt@

Revision 1.14 / (download) - annotate - [select for diffs], Mon Nov 28 10:12:50 2016 UTC (7 years, 6 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

Rename "flowmax" to "maxflow" and give each switch(4) ioctl a
dedicated number.  Both changes for consistency.

OK rzalamena@

Revision 1.13 / (download) - annotate - [select for diffs], Fri Nov 18 20:43:39 2016 UTC (7 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.12: +4 -4 lines
Diff to previous 1.12 (colored)

Make the ifconfig switch0 output nicer using a single line and the
same keys as the actual commands (datapath, maxgroup, flowmax).
flowmax should eventually renamed to maxflow for consistency.

OK rzalamena@

Revision 1.12 / (download) - annotate - [select for diffs], Mon Oct 17 10:49:17 2016 UTC (7 years, 7 months ago) by rzalamena
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

Use strtoull() to read the datapath id and expect "datapath" instead of
"datapathid" as stated by the man page.

ok reyk@

Revision 1.11 / (download) - annotate - [select for diffs], Sat Sep 3 17:13:48 2016 UTC (7 years, 9 months ago) by chl
Branch: MAIN
Changes since 1.10: +2 -3 lines
Diff to previous 1.10 (colored)

fix format string and remove unused variables

ok yasuoka@ goda@

Revision 1.10 / (download) - annotate - [select for diffs], Fri Sep 2 10:01:36 2016 UTC (7 years, 9 months ago) by goda
Branch: MAIN
Changes since 1.9: +117 -3 lines
Diff to previous 1.9 (colored)

Add switch(4) support to ifconfig

ok deraadt@ yasuoka@ reyk@ henning@

Revision 1.9 / (download) - annotate - [select for diffs], Sat Jul 18 06:50:24 2015 UTC (8 years, 10 months ago) by rzalamena
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.8: +7 -3 lines
Diff to previous 1.8 (colored)

Indent the output of bridge rules in ifconfig.

ok reyk@

Revision 1.8 / (download) - annotate - [select for diffs], Sun Oct 13 12:18:18 2013 UTC (10 years, 7 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

Pass NI_DGRAM to getnameinfo() to use UDP tunnel service names.

Revision 1.7 / (download) - annotate - [select for diffs], Sun Oct 13 10:10:00 2013 UTC (10 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.6: +12 -1 lines
Diff to previous 1.6 (colored)

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@

Revision 1.6 / (download) - annotate - [select for diffs], Sat Dec 22 13:20:32 2012 UTC (11 years, 5 months ago) by camield
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.5: +5 -2 lines
Diff to previous 1.5 (colored)

Return EEXIST to 'add' when a port is already a bridge member.  This makes
reconfiguration with /etc/netstart silent again.  (noticed by deraadt)

And do the same for 'addspan'.

ok deraadt

Revision 1.5 / (download) - annotate - [select for diffs], Tue Dec 4 02:24:46 2012 UTC (11 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.4: +1 -2 lines
Diff to previous 1.4 (colored)

remove some unnecessary sys/param.h inclusions

Revision 1.4 / (download) - annotate - [select for diffs], Fri Nov 30 18:06:11 2012 UTC (11 years, 6 months ago) by gsoares
Branch: MAIN
Changes since 1.3: +15 -15 lines
Diff to previous 1.3 (colored)

get rid of unneeded \n here. err(3) family already does it for us.

OK mikeb@ camield@ reyk@ sobrado@ henning@ krw@

Revision 1.3 / (download) - annotate - [select for diffs], Mon Dec 14 19:22:20 2009 UTC (14 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.2: +54 -55 lines
Diff to previous 1.2 (colored)

use warn() and warnx() instead of incorrect stderr printing.
get rid of EX_* since ifconfig(8) is not sysexits program.
discussed with claudio

Revision 1.2 / (download) - annotate - [select for diffs], Sat Nov 28 20:07:18 2009 UTC (14 years, 6 months ago) by chl
Branch: MAIN
Changes since 1.1: +1 -4 lines
Diff to previous 1.1 (colored)

remove unused variables

ok claudio@

Revision 1.1 / (download) - annotate - [select for diffs], Sun Nov 22 22:00:24 2009 UTC (14 years, 6 months ago) by claudio
Branch: MAIN

Merge brconfig into ifconfig. It is annoying that it is impossible to do
ifconfig bridge0 add em0 add gif0 add vether0 up
instead you need to
ifconfig bridge0 create
brconfig bridge0 add em0 add gif0 add vether0 up
This is working for everything now but we may do some changes when needed.
Manpages and startup scripts are following soon.
OK deraadt@, henning@

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.