aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if_edsc.c
Commit message (Collapse)AuthorAgeFilesLines
* if_edsc: generate an arbitrary MAC addressKyle Evans2020-03-021-3/+7
| | | | | | | | | | | | When generating an cloned interface instance in edsc_clone_create(), generate a MAC address from the FF OUI with ether_gen_addr(). This allows us to have unique local-link addresses. Previously, the MAC address was zero. Submitted by: Neel Chauhan <neel AT neelc DOT org> Differential Revision: https://reviews.freebsd.org/D23842 Notes: svn path=/head/; revision=358515
* Use the new VNET_DEFINE_STATIC macro when we are defining static VNETAndrew Turner2018-07-241-1/+1
| | | | | | | | | | | variables. Reviewed by: bz Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16147 Notes: svn path=/head/; revision=336676
* sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326023
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Get closer to a VIMAGE network stack teardown from top to bottom ratherBjoern A. Zeeb2016-06-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | than removing the network interfaces first. This change is rather larger and convoluted as the ordering requirements cannot be separated. Move the pfil(9) framework to SI_SUB_PROTO_PFIL, move Firewalls and related modules to their own SI_SUB_PROTO_FIREWALL. Move initialization of "physical" interfaces to SI_SUB_DRIVERS, move virtual (cloned) interfaces to SI_SUB_PSEUDO. Move Multicast to SI_SUB_PROTO_MC. Re-work parts of multicast initialisation and teardown, not taking the huge amount of memory into account if used as a module yet. For interface teardown we try to do as many of them as we can on SI_SUB_INIT_IF, but for some this makes no sense, e.g., when tunnelling over a higher layer protocol such as IP. In that case the interface has to go along (or before) the higher layer protocol is shutdown. Kernel hhooks need to go last on teardown as they may be used at various higher layers and we cannot remove them before we cleaned up the higher layers. For interface teardown there are multiple paths: (a) a cloned interface is destroyed (inside a VIMAGE or in the base system), (b) any interface is moved from a virtual network stack to a different network stack ("vmove"), or (c) a virtual network stack is being shut down. All code paths go through if_detach_internal() where we, depending on the vmove flag or the vnet state, make a decision on how much to shut down; in case we are destroying a VNET the individual protocol layers will cleanup their own parts thus we cannot do so again for each interface as we end up with, e.g., double-frees, destroying locks twice or acquiring already destroyed locks. When calling into protocol cleanups we equally have to tell them whether they need to detach upper layer protocols ("ulp") or not (e.g., in6_ifdetach()). Provide or enahnce helper functions to do proper cleanup at a protocol rather than at an interface level. Approved by: re (hrs) Obtained from: projects/vnet Reviewed by: gnn, jhb Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6747 Notes: svn path=/head/; revision=302054
* Virtualize if_edsc(4).Hiroki Sato2014-10-051-18/+33
| | | | Notes: svn path=/head/; revision=272572
* Mechanically convert to if_inc_counter().Gleb Smirnoff2014-09-191-2/+2
| | | | Notes: svn path=/head/; revision=271867
* The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff2013-10-261-1/+2
| | | | | | | | | | | to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=257176
* Make the "struct if_clone" opaque to users of the cloning API. UsersGleb Smirnoff2012-10-161-14/+13
| | | | | | | | | | | | | | | now use function calls: if_clone_simple() if_clone_advanced() to initialize a cloner, instead of macros that initialize if_clone structure. Discussed with: brooks, bz, 1 year ago Notes: svn path=/head/; revision=241610
* Give a hint that softc can contain many things besides ifp.Yaroslav Tykhiy2007-03-261-0/+5
| | | | Notes: svn path=/head/; revision=167896
* We no longer embed ifnet in softc, and the pointer to ifnetYaroslav Tykhiy2007-03-261-4/+4
| | | | | | | | | | | | | doesn't need to be first in softc now. (It was the whole ifnet structure itself that needed to be first in the good old days.) Fix the respective comment accordingly. Add xrefs to ifnet(9) in some other comments while I'm here. Pointed out by: thompsa Notes: svn path=/head/; revision=167894
* Introduce a new toy interface, edsc(4). It's a discard interfaceYaroslav Tykhiy2007-03-261-0/+349
imitating an Ethernet device, so vlan(4) and if_bridge(4) can be attached to it for testing and benchmarking purposes. Its source can be an introduction to the anatomy of a network interface driver due to its simplicity as well as to a bunch of comments in it. (The rest of needed changes were in my previous commit, which got interrupted in the middle. Alas, CVS commits are not atomic.) Notes: svn path=/head/; revision=167892