| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There're lots of consumers, Ethernet drivers, libraries and applications.
It is more promising to assert the sizes in every compilation units
rather than in if_ethersubr.c only.
Those assertions were in the header file but were moved to if_ethersubr.c
due to possible conflict of the implementation of CTASSERT [1]. Now that
the default C standard is now gnu17 [2] [3] which supports _Static_assert
natively, use _Static_assert instead of CTASSERT to avoid possible
conflicts.
While here, add an extra assertion for the size of struct ether_vlan_header.
[1] d54d93ac7f0f Move CTASSERT of ether header sizes out of the header file and into ...
[2] ca4eddea97c5 src: Use gnu17 as the default C standard for userland instead of gnu99
[3] 3a98d5701c7f sys: Use gnu17 as the default C standard for the kernel
PR: 287761 (exp-run)
Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D50947
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are generally useful to anything dealing with 802.1q and aren't
specific to if_vlan, so move them to <net/ethernet.h> and remove the
_KERNEL gate.
While here, document what they actually mean.
Reviewed by: kp, des
Approved by: des (mentor)
Differential Revision: https://reviews.freebsd.org/D50570
|
|
|
|
|
|
|
|
|
|
| |
ether_vlanid_t is a type to represent a VLAN ID, for example inside a
.1q tag. since this is specific to Ethernet, put it in net/ethernet.h.
change bridge to use the new type instead of uint{16,32}_t.
Reviewed by: adrian, kp
Differential Revision: https://reviews.freebsd.org/D49836
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The mbuf flag M_HASFCS was introduced for drivers to indicate the net
stack that packets include FCS (Frame Check Sequence). In principle, to
be efficient, FCS should always be processed by hardware, firmware, or
at last sort the driver. Well, Ethernet specifies that damaged frames
should be discarded, thus only good ones will be passed up to the net
stack, then it makes no senses for the net stack to see FCS just to trim
it.
The last consumer of the flag M_HASFCS has been removed since change [1].
It is time to retire it.
1. 105a4f7b3cb6 ng_atmllc: remove
Reviewed by: kp
MFC after: never
Differential Revision: https://reviews.freebsd.org/D42391
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some Raspberry Pi pass smsc95xx.macaddr=XX:XX:XX:XX:XX:XX as bootargs.
Use this if no ethernet address is found in an EEPROM.
As last resort fall back to ether_gen_addr() instead of random MAC.
PR: 274092
Reported by: Patrick M. Hausen (via ML)
Reviewed by: imp, karels, zlei
Tested by: Patrick M. Hausen
Approved by: karels
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D42463
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In commit c7cffd65c5d8 the function ether_8021q_frame() was slightly
refactored to use pointer of struct ether_8021q_tag as parameter qtag to
include the new option proto.
It is wrong to write to qtag->pcp as it will effectively change the memory
that qtag points to. Unfortunately the transmit routine of if_vlan parses
pointer of the member ifv_qtag of its softc which stores vlan interface's
PCP internally, when transmitting mbufs that contains PCP the vlan
interface's PCP will get overwritten.
Fix by operating on a local copy of qtag->pcp. Also mark 'struct ether_8021q_tag'
as const so that compilers can pick up such kind of bug.
PR: 273304
Reviewed by: kp
Fixes: c7cffd65c5d85 Add support for stacked VLANs (IEEE 802.1ad, AKA Q-in-Q)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D39505
|
|
|
|
| |
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
if_bridge receives packets via a special interface, if_bridge_input,
rather than by if_input. Thus, netmap's usual hooking of ifnet routines
does not work as expected. Instead, modify bridge_input() to pass
packets directly to netmap when it is enabled. This applies to both
locally delivered packets and forwarded packets.
When a netmap application transmits a packet by writing it to the host
TX ring, the mbuf chain is passed to if_input, which ordinarily points
to ether_input(). However, when transmitting via if_bridge,
bridge_input() needs to see the packet again in order to decide whether
to deliver or forward. Thus, introduce a new protocol flag,
M_BRIDGE_INJECT, which 1) causes the packet to be passed to
bridge_input() again after Ethernet processing, and 2) avoids passing
the packet back to netmap. The source MAC address of the packet is used
to determine the original "receiving" interface.
Reviewed by: vmaffione
MFC after: 2 months
Sponsored by: Zenarmor
Sponsored by: OPNsense
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38066
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Hide more netstack by making the BPF_TAP macros real functions in the
netstack. "struct ifnet" is used in the header instead of "if_t" to
keep header pollution down.
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38103
|
|
|
|
|
|
| |
- s/verion/version/
MFC after: 3 days
|
|
|
|
|
|
| |
Reviewed by: imp
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33501
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix what appears to have been a small copy/paste typo in ifconfig(8)'s
documentation (man page and header file).
Not that it matters anymore.
Reference: Table I-2 in IEEE Std 802.1Q-2014.
PR: 255557
Submitted by: Jose Luis Duran <jlduran@gmail.com>
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the bridge is moved to a different vnet we must remove all of its
member interfaces (and span interfaces), because we don't know if those
will be moved along with it. We don't want to hold references to
interfaces not in our vnet.
Reviewed by: donner@
MFC after: 1 week
Sponsored by: Orange Business Services
Differential Revision: https://reviews.freebsd.org/D28859
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This can be used to detect if an ethernet address is specifically an
IPv6 multicast address, defined in accordance to RFC 2464.
ETHER_IS_MULTICAST is still preferred in the general case.
Reviewed by: ae
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D26611
Notes:
svn path=/head/; revision=367163
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
802.1ad interfaces are created with ifconfig using the "vlanproto" parameter.
Eg., the following creates a 802.1Q VLAN (id #42) over a 802.1ad S-VLAN
(id #5) over a physical Ethernet interface (em0).
ifconfig vlan5 create vlandev em0 vlan 5 vlanproto 802.1ad up
ifconfig vlan42 create vlandev vlan5 vlan 42 inet 10.5.42.1/24
VLAN_MTU, VLAN_HWCSUM and VLAN_TSO capabilities should be properly
supported. VLAN_HWTAGGING is only partially supported, as there is
currently no IFCAP_VLAN_* denoting the possibility to set the VLAN
EtherType to anything else than 0x8100 (802.1ad uses 0x88A8).
Submitted by: Olivier Piras
Sponsored by: RG Nets
Differential Revision: https://reviews.freebsd.org/D26436
Notes:
svn path=/head/; revision=366917
|
|
|
|
|
|
|
| |
No functional change
Notes:
svn path=/head/; revision=357655
|
|
|
|
|
|
|
|
| |
Powerlink and Sercos III are used in automation. Both have been standardized
and In the case of Ethernet Powerlink there is a BSD-licensed stack.
Notes:
svn path=/head/; revision=357587
|
|
|
|
|
|
|
| |
Pointed by: Dikshie Fauzie
Notes:
svn path=/head/; revision=357424
|
|
|
|
|
|
|
| |
Consistently use uppercase for ethertype hex numbers.
Notes:
svn path=/head/; revision=357423
|
|
|
|
|
|
|
| |
No functional change.
Notes:
svn path=/head/; revision=357417
|
|
|
|
|
|
|
| |
Sort ETHERTYPE_FCOE, from r357414.
Notes:
svn path=/head/; revision=357415
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add some types based on other BSDs and also add EtherCat and PROFINET, which
are IEC standards.
There is a public list (CSV format) at:
https://standards.ieee.org/products-services/regauth/
MFC after: 2 weeks
Notes:
svn path=/head/; revision=357414
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some places in network code may need to verify that an ethernet address
is not the 'zero' address. Provide a standard macro ETHER_IS_ZERO for
this purpose, similar to the ETHER_IS_BROADCAST macro already available.
This patch also removes previous ETHER_IS_ZERO definitions in several
USB ethernet drivers, in favor of this centrally-located macro.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: erj@
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D21240
Notes:
svn path=/head/; revision=354345
|
|
|
|
|
|
|
|
|
|
|
| |
Older network equipment used the ethertypes 0x9100, 0x9200, and 0x9300 for
outer VLANs, before standardisation introduced 0x88a8.
Submitted by: Lutz Donnerhacke <lutz_donnerhacke.de>
Differential Revision: https://reviews.freebsd.org/D21846
Notes:
svn path=/head/; revision=353674
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h"
in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header
pollution substantially.
EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c
files into appropriate headers (e.g., sys/proc.h, powernv/opal.h).
As a side effect of reduced header pollution, many .c files and headers no
longer contain needed definitions. The remainder of the patch addresses
adding appropriate includes to fix those files.
LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by
sys/mutex.h since r326106 (but silently protected by header pollution prior
to this change).
No functional change (intended). Of course, any out of tree modules that
relied on header pollution for sys/eventhandler.h, sys/lock.h, or
sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped.
Notes:
svn path=/head/; revision=347984
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Give devices that need a MAC a 16-bit allocation out of the FreeBSD
Foundation OUI range. Change the name ether_fakeaddr to ether_gen_addr now
that we're dealing real MAC addresses with a real OUI rather than random
locally-administered addresses.
Reviewed by: bz, rgrimes
Differential Revision: https://reviews.freebsd.org/D19587
Notes:
svn path=/head/; revision=346324
|
|
|
|
|
|
|
|
|
|
|
|
| |
We currently have two places with identical fake hwaddr generation --
if_vxlan and if_bridge. Lift it into if_ethersubr for reuse in other
interfaces that may also need a fake addr.
Reviewed by: bryanv, kp, philip
Differential Revision: https://reviews.freebsd.org/D19573
Notes:
svn path=/head/; revision=345139
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to 802.1Q-2014, VLAN tagged packets with VLAN id 0 should be
considered as untagged, and only PCP and DEI values from the VLAN tag
are meaningful. See for instance
https://www.cisco.com/c/en/us/td/docs/switches/connectedgrid/cg-switch-sw-master/software/configuration/guide/vlan0/b_vlan_0.html.
Make it possible to specify PCP value for outgoing packets on an
ethernet interface. When PCP is supplied, the tag is appended, VLAN
id set to 0, and PCP is filled by the supplied value. The code to do
VLAN tag encapsulation is refactored from the if_vlan.c and moved into
if_ethersubr.c.
Drivers might have issues with filtering VID 0 packets on
receive. This bug should be fixed for each driver.
Reviewed by: ae (previous version), hselasky, melifaro
Sponsored by: Mellanox Technologies
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D14702
Notes:
svn path=/head/; revision=331622
|
|
|
|
|
|
|
|
|
|
| |
Reviewed by: kp
Obtained from: OpenBSD
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14593
Notes:
svn path=/head/; revision=330536
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ifnet_arrival_event may not be adequate under certain situation; e.g.
when the LLADDR is needed. So the ethernet ifattach event is announced
after all necessary bits are setup.
MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D11617
Notes:
svn path=/head/; revision=321406
|
|
|
|
|
|
|
|
|
|
|
|
| |
Miss read the parentheses.
Reported by: oleg@
Reviewed by: hps@
MFC after: 3 days
Sponsored by: Microsoft
Notes:
svn path=/head/; revision=318512
|
|
|
|
|
|
|
|
|
|
| |
Reviewed by: araujo, hps
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7710
Notes:
svn path=/head/; revision=305177
|
|
|
|
|
|
|
|
|
|
|
|
| |
turn them into a shared definition.
Set M_MCAST/M_BCAST appropriately upon packet reception in net80211, just
before they are delivered up to the ethernet stack.
Submitted by: rstone
Notes:
svn path=/head/; revision=303811
|
|
|
|
|
|
|
| |
MFC after: 2 weeks
Notes:
svn path=/head/; revision=297358
|
|
|
|
|
|
|
| |
since this structure is protocol definition, not part of implementation.
Notes:
svn path=/head/; revision=274374
|
|
|
|
| |
Notes:
svn path=/head/; revision=249925
|
|
|
|
|
|
|
|
|
| |
to allow passing a cached struct llentry * down to L2
Reviewed by: rwatson
Notes:
svn path=/head/; revision=191148
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
if_ethersubr.c. CTASSERT is implemented using a dummy typedef, which if
used in a header file may conflict with another CTASSERT in a source file
using that header.
I'll make a note of this in CTASSERT's man page.
Approved by: imp
Notes:
svn path=/head/; revision=182285
|
|
|
|
|
|
|
| |
MFC after: 3 days
Notes:
svn path=/head/; revision=179036
|
|
|
|
| |
Notes:
svn path=/head/; revision=172777
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
queue so the output network card must support the same tagging mechanism as
how the frame was input (prepended Ethernet header tag or stripped HW mflag).
Now the vlan Ethernet header is _always_ stripped in ether_input and the mbuf
flagged, only only network cards with VLAN_HWTAGGING enabled would properly
re-tag any outgoing vlan frames.
If the outgoing interface does not support hardware tagging then readd the vlan
header to the front of the frame. Move the common vlan encapsulation in to
ether_vlanencap().
Reported by: Erik Osterholm, Jon Otterholm
MFC after: 1 week
Notes:
svn path=/head/; revision=172770
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
as to the type of the command argument: int -> u_long.
These types have different widths in the 64-bit world.
Add a note to UPDATING because the change breaks KBI
on 64-bit platforms.
Discussed on: -net, -current
Reviewed by: bms, ru
Notes:
svn path=/head/; revision=170097
|
|
|
|
|
|
|
| |
commit.
Notes:
svn path=/head/; revision=169529
|
|
|
|
| |
Notes:
svn path=/head/; revision=167290
|
|
|
|
|
|
|
| |
in line with that we find in the rest of the tree.
Notes:
svn path=/head/; revision=165724
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sizeof ether_header is 2 * ETHER_ADDR_LEN + 2 (14) bytes long
sizeof ether_addr is ETHER_ADDR_LEN bytes long
On arm, this shows that struct ether_addr needs to be __packed.
The first condition muts be true for the bridging code to not dump core.
The second one appears to be implicitly relied upon by wi (but many
of the rids it sends down likely need __packed too to be safe) and
maybe others. It appears to not hurt anything.
Notes:
svn path=/head/; revision=164785
|
|
|
|
|
|
|
| |
Pointed out by: ru
Notes:
svn path=/head/; revision=164398
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
processing are forced to toggle this functionality when the card
is put in and out of promiscuous mode. The main reason for this
is because the hardware strips the VLAN tag, making it impossible
for the tag information to show up in network diagnostic tools like
tcpdump(1).
This change introduces ether_vlan_mtap(), which is called if the
mbuf has M_VLANTAG set. VLAN information is extracted from the
mbuf and inserted into a stack allocated ether vlan header which
is then inserted through the bpf machinery via bpf_mtap2(). The
original mbuf's data pointer and lengths are temporarily adjusted
to eliminate the original Ethernet header for the duration of the
tap operation. This should have no long term effects on the mbuf.
Also, define a new macro, ETHER_BPF_MTAP which should be used
by drivers which support hardware offload of VLAN tag processing.
The fixes for the relevant drivers will follow shortly.
Discussed with: rwatson, andre, jhb (and others)
Much feedback from: sam, ru
MFC after: 1 month [1]
[1] The version that is eventually MFCed will be somewhat
different then this, as there has been significant work
done to the VLAN code in HEAD.
Notes:
svn path=/head/; revision=164396
|
|
|
|
|
|
|
|
|
|
|
| |
constratins on arm; this fixes bridging when packets are
rx'd so ip headers are 32-bit aligned
Reviewed by: imp (and discussed elsewhere)
MFC after: 2 weeks
Notes:
svn path=/head/; revision=164381
|
|
|
|
| |
Notes:
svn path=/head/; revision=136154
|