#
303975 |
|
11-Aug-2016 |
gjb |
Copy stable/11@r303970 to releng/11.0 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, and rename it to RC1.
Update __FreeBSD_version.
Use the quarterly branch for the default FreeBSD.conf pkg(8) repo and the dvd1.iso packages population.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
#
302408 |
|
08-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation
|
#
289718 |
|
21-Oct-2015 |
emaste |
if_tap: correct typo in sysctl description (Enably)
Sponsored by: The FreeBSD Foundation
|
#
281363 |
|
10-Apr-2015 |
glebius |
Redo r274966. Instead of global all-interface all-vnet undocumented sysctl, use per-interface flag, and document it.
Sponsored by: Nginx, Inc.
|
#
274966 |
|
24-Nov-2014 |
philip |
Add a sysctl `net.link.tap.deladdrs_on_close' to configure whether tap should delete configured addresses and routes when the interface is closed. Default is enabled (preserve current behaviour).
MFC after: 1 week
|
#
271867 |
|
19-Sep-2014 |
glebius |
Mechanically convert to if_inc_counter().
|
#
267992 |
|
28-Jun-2014 |
hselasky |
Pull in r267961 and r267973 again. Fix for issues reported will follow.
|
#
267985 |
|
27-Jun-2014 |
gjb |
Revert r267961, r267973:
These changes prevent sysctl(8) from returning proper output, such as:
1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory
|
#
267961 |
|
27-Jun-2014 |
hselasky |
Extend the meaning of the CTLFLAG_TUN flag to automatically check if there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel.
Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change.
MFC after: 2 weeks Sponsored by: Mellanox Technologies
|
#
260394 |
|
07-Jan-2014 |
melifaro |
Teach every SIOCGIFSTATUS provider to fill in ifs->ascii anyway. Remove old bits of data concat for 'ascii' field. Remove special SIOCGIFSTATUS handling from if.c (which Coverity yells at).
Reported by: Coverity Coverity CID: 1147174 MFC after: 2 weeks
|
#
257696 |
|
05-Nov-2013 |
glebius |
Drop support for historic ioctls and also undefine them, so that code that checks their presence via ifdef, won't use them.
Bump __FreeBSD_version as safety measure.
|
#
257176 |
|
26-Oct-2013 |
glebius |
The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 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.
|
#
257078 |
|
24-Oct-2013 |
grehan |
Fix panic in the tap driver when a tap and vmnet interface were created after each other e.g.
ifconfig tap0 ifconfig vmnet0 <panic>
Appears to be a cut'n'paste error from the tap code to the vmnet code where the name string wasn't updated in the call to make_dev().
Reviewed by: glebius MFC after: 3 days
|
#
256008 |
|
02-Oct-2013 |
glebius |
Clear knlist before destroying it in tap(4) and tun(4). This fixes later crash, when a kqueue descriptor tries to dereference appropriate knotes.
Approved by: re (kib)
|
#
255360 |
|
07-Sep-2013 |
davide |
Don't clear the unused SI_CHEAPCLONE flag in tap_create()/tuncreate().
Reviewed by: kib
|
#
243882 |
|
05-Dec-2012 |
glebius |
Mechanically substitute flags from historic mbuf allocator with malloc(9) flags within sys.
Exceptions:
- sys/contrib not touched - sys/mbuf.h edited manually
|
#
243615 |
|
27-Nov-2012 |
davidxu |
Pass allocated unit number to make_dev, otherwise kernel panics later while cloning second tap.
Reviewed by: kevlo,ed
|
#
241610 |
|
16-Oct-2012 |
glebius |
Make the "struct if_clone" opaque to users of the cloning API. Users 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
|
#
240945 |
|
26-Sep-2012 |
emaste |
Correct misspelling in debug output.
|
#
240938 |
|
25-Sep-2012 |
emaste |
Avoid INVARIANTS panic destroying an in-use tap(4)
The requirement (implied by the KASSERT in tap_destroy) that the tap is closed isn't valid; destroy_dev will block in devdrn while other threads are in d_* functions.
Note: if_tun had the same issue, addressed in SVN revisions r186391, r186483 and r186497. The use of the condvar there appears to be redundant with the functionality provided by destroy_dev.
Sponsored by: ADARA Networks Reviewed by: dwhite MFC after: 2 weeks
|
#
238183 |
|
06-Jul-2012 |
emaste |
Implement SIOCGIFMEDIA for if_tap(4)
Appease certain if_tap(4) consumers by providing simulated Ethernet media status.
DragonFly commit 70d9a675bf5441cc854a843ead702d08928c37f3
Obtained from: DragonFly BSD
|
#
236725 |
|
07-Jun-2012 |
trociny |
Sort includes.
Submitted by: Daan Vreeken <pa4dan Bliksem.VEHosting.nl> MFC after: 3 days
|
#
236724 |
|
07-Jun-2012 |
trociny |
Add VIMAGE support to if_tap.
PR: kern/152047, kern/158686 Submitted by: Daan Vreeken <pa4dan Bliksem.VEHosting.nl> MFC after: 1 week
|
#
227459 |
|
11-Nov-2011 |
brooks |
In r191367 the need for if_free_type() was removed and a new member if_alloctype was used to store the origional interface type. Take advantage of this change by removing all existing uses of if_free_type() in favor of if_free().
MFC after: 1 Month
|
#
227309 |
|
07-Nov-2011 |
ed |
Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.
The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static.
|
#
226500 |
|
18-Oct-2011 |
ed |
Get rid of D_PSEUDO.
It seems the D_PSEUDO flag was meant to allow make_dev() to return NULL. Nowadays we have a different interface for that; make_dev_p(). There's no need to keep it there.
While there, remove an unneeded D_NEEDMINOR from the gpio driver.
Discussed with: gonzo@ (gpio)
|
#
225177 |
|
25-Aug-2011 |
attilio |
Fix a deficiency in the selinfo interface: If a selinfo object is recorded (via selrecord()) and then it is quickly destroyed, with the waiters missing the opportunity to awake, at the next iteration they will find the selinfo object destroyed, causing a PF#.
That happens because the selinfo interface has no way to drain the waiters before to destroy the registered selinfo object. Also this race is quite rare to get in practice, because it would require a selrecord(), a poll request by another thread and a quick destruction of the selrecord()'ed selinfo object.
Fix this by adding the seldrain() routine which should be called before to destroy the selinfo objects (in order to avoid such case), and fix the present cases where it might have already been called. Sometimes, the context is safe enough to prevent this type of race, like it happens in device drivers which installs selinfo objects on poll callbacks. There, the destruction of the selinfo object happens at driver detach time, when all the filedescriptors should be already closed, thus there cannot be a race. For this case, mfi(4) device driver can be set as an example, as it implements a full correct logic for preventing this from happening.
Sponsored by: Sandvine Incorporated Reported by: rstone Tested by: pluknet Reviewed by: jhb, kib Approved by: re (bz) MFC after: 3 weeks
|
#
213028 |
|
22-Sep-2010 |
jhb |
- Expand scope of tun/tap softc locks to cover more softc fields and driver-maintained ifnet fields (such as if_drv_flags). - Use soft locks as the mutex that protects each interface's knote list rather than using the global knote list lock. Also, use the softc for kn_hook instead of the cdev. - Use mtx_sleep() instead of tsleep() when blocking in the read routines. This fixes a lost wakeup race. - Remove D_NEEDGIANT now that the cdevsw routines use the softc lock where locking is needed. - Lock IFQ when calculating the result for FIONREAD in tap(4). tun(4) already did this. - Remove remaining spl calls.
Submitted by: Marcin Cieslak saper of saper|info (3) MFC after: 2 weeks
|
#
205222 |
|
16-Mar-2010 |
qingli |
Verify interface up status using its link state only if the interface has such capability. The interface capability flag indicates whether such capability exists. This approach is much more backward compatible. Physical device driver changes will be part of another commit.
Also updated the ifconfig utility to show the LINKSTATE capability if present.
Reviewed by: rwatson, imp, juli MFC after: 3 days
|
#
205024 |
|
11-Mar-2010 |
qingli |
The if_tap interface is of IFT_ETHERNET type, but it does not set or update the if_link_state variable. As such RT_LINK_IS_UP() fails for the if_tap interface.
Also, the RT_LINK_IS_UP() needs to bypass all loopback interfaces because loopback interfaces are considered up logically as long as the system is running.
This patch fixes the above issues by setting and updating the if_link_state variable when the tap interface is opened or closed respectively. Similary approach is already done in the if_tun device.
MFC after: 3 days
|
#
204464 |
|
28-Feb-2010 |
kib |
In both if_tun and if_tap:
Do not do additional dev_ref() on the newly created interface in the if_clone create method [1]. This reference is not needed and never removed, causing struct cdevpriv leakage. Remove the setting of SI_CHEAPCLONE flag as well, since it is unused.
For dev_clone handlers, create cdevs with the call make_dev_credf(MAKEDEV_REF) instead of calling make_dev() and then dev_ref(), to avoid a race.
Call drain_dev_clone_events() at the module unload time after dev_clone handler is deinstalled.
Submitted by: Mikolaj Golub <to.my.trociny gmail com> [1] MFC after: 1 week
|
#
194990 |
|
25-Jun-2009 |
kib |
Change the type of uio_resid member of struct uio from int to ssize_t. Note that this does not actually enable full-range i/o requests for 64 architectures, and is done now to update KBI only.
Tested by: pho Reviewed by: jhb, bde (as part of the review of the bigger patch)
|
#
193951 |
|
10-Jun-2009 |
kib |
Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. Use vnode interlock to protect the knote fields [1]. The locking assumes that shared vnode lock is held, thus we get exclusive access to knote either by exclusive vnode lock protection, or by shared vnode lock + vnode interlock.
Do not use kl_locked() method to assert either lock ownership or the fact that curthread does not own the lock. For shared locks, ownership is not recorded, e.g. VOP_ISLOCKED can return LK_SHARED for the shared lock not owned by curthread, causing false positives in kqueue subsystem assertions about knlist lock.
Remove kl_locked method from knlist lock vector, and add two separate assertion methods kl_assert_locked and kl_assert_unlocked, that are supposed to use proper asserts. Change knlist_init accordingly.
Add convenience function knlist_init_mtx to reduce number of arguments for typical knlist initialization.
Submitted by: jhb [1] Noted by: jhb [2] Reviewed by: jhb Tested by: rnoland
|
#
189907 |
|
17-Mar-2009 |
scf |
Remove the splimp()/splx() calls around the setting of the MTU. They are no-op's that I inadvertently added. Even if locking is needed in general for the ioctl's, setting a single long will not need it due to the operation being atomic.
Reported by: rwatson
|
#
189866 |
|
16-Mar-2009 |
scf |
Add the SIOCSIFMTU ioctl handling directly to tap(4) permitting it to have its MTU set higher than 1500 (ETHERMTU). Its new limit is now 65535 as enforced by ifhwioctl() in if.c
This allows a tap(4) device to be added to a bridge, which requires all interface members to have the same MTU, with an interface configured for jumbo frames. QEMU may now connect to a network via tap(4) without requiring the real interface to have its MTU set to 1500 or lower.
Reviewed by: rpaulo, bms MFC after: 1 week
|
#
184205 |
|
23-Oct-2008 |
des |
Retire the MALLOC and FREE macros. They are an abomination unto style(9).
MFC after: 3 months
|
#
183397 |
|
27-Sep-2008 |
ed |
Replace all calls to minor() with dev2unit().
After I removed all the unit2minor()/minor2unit() calls from the kernel yesterday, I realised calling minor() everywhere is quite confusing. Character devices now only have the ability to store a unit number, not a minor number. Remove the confusion by using dev2unit() everywhere.
This commit could also be considered as a bug fix. A lot of drivers call minor(), while they should actually be calling dev2unit(). In -CURRENT this isn't a problem, but it turns out we never had any problem reports related to that issue in the past. I suspect not many people connect more than 256 pieces of the same hardware.
Reviewed by: kib
|
#
183381 |
|
26-Sep-2008 |
ed |
Remove unit2minor() use from kernel code.
When I changed kern_conf.c three months ago I made device unit numbers equal to (unneeded) device minor numbers. We used to require bitshifting, because there were eight bits in the middle that were reserved for a device major number. Not very long after I turned dev2unit(), minor(), unit2minor() and minor2unit() into macro's. The unit2minor() and minor2unit() macro's were no-ops.
We'd better not remove these four macro's from the kernel, because there is a lot of (external) code that may still depend on them. For now it's harmless to remove all invocations of unit2minor() and minor2unit().
Reviewed by: kib
|
#
182880 |
|
08-Sep-2008 |
emax |
Add new TAPGIFNAME tap(4) character device ioctl. This is a convenient shortcut to obtain network interface name using file descriptor for character device.
Obtained from: NetBSD MFC after: 1 week
|
#
179726 |
|
11-Jun-2008 |
ed |
Don't enforce unique device minor number policy anymore.
Except for the case where we use the cloner library (clone_create() and friends), there is no reason to enforce a unique device minor number policy. There are various drivers in the source tree that allocate unr pools and such to provide minor numbers, without using them themselves.
Because we still need to support unique device minor numbers for the cloner library, introduce a new flag called D_NEEDMINOR. All cdevsw's that are used in combination with the cloner library should be marked with this flag to make the cloning work.
This means drivers can now freely use si_drv0 to store their own flags and state, making it effectively the same as si_drv1 and si_drv2. We still keep the minor() and dev2unit() routines around to make drivers happy.
The NTFS code also used the minor number in its hash table. We should not do this anymore. If the si_drv0 field would be changed, it would no longer end up in the same list.
Approved by: philip (mentor)
|
#
178221 |
|
15-Apr-2008 |
emax |
Fix possible buffer overrun on 64-bit arch when generating MAC address for tap interface.
Reported by: Marc Lorner < marc dot loerner at hob dot de > Reviewed by: bms MFC after: 3 days
|
#
167713 |
|
19-Mar-2007 |
bms |
Add a sysctl net.link.tap.up_on_open which defaults to zero; when it is non-zero, tap(4) instances will be marked IFF_UP on attach.
PR: 110383 Requested by: Frank Behrens MFC after: 2 weeks
|
#
166514 |
|
05-Feb-2007 |
bms |
Fix devfs cloning for non-superusers when net.link.tap.user_open is non-zero. Note: 'ifconfig tapX create' still requires PRIV_NET_IFCREATE privilege.
Reviewed by: rwatson
|
#
166497 |
|
04-Feb-2007 |
bms |
Implement ifnet cloning for tun(4)/tap(4). Make devfs cloning a sysctl/tunable which defaults to on.
If devfs cloning is enabled, only the super-user may create tun(4)/tap(4)/vmnet(4) instances. Devfs cloning is still enabled by default; it may be disabled from the loader or via sysctl with "net.link.tap.devfs_cloning" and "net.link.tun.devfs_cloning".
Disabling its use affects potentially all tun(4)/tap(4) consumers including OpenSSH, OpenVPN and VMware.
PR: 105228 (potentially also 90413, 105570) Submitted by: Landon Fuller Tested by: Andrej Tobola Approved by: core (rwatson) MFC after: 4 weeks
|
#
166443 |
|
03-Feb-2007 |
bms |
Drop unicast Ethernet frames not destined for the configured address of a tap(4) instance, if IFF_PROMISC is not set.
In tap(4), we should emulate the effect IFF_PROMISC would have on hardware, otherwise we risk introducing layer 2 loops if tap(4) is used with bridges. This means not even bpf(4) gets to see them.
This patch has been tested in a variety of situations. Multicast and broadcast frames are correctly allowed through. I have observed this behaviour causing problems with multiple QEMU instances hosted on the same FreeBSD machine.
The checks in in ether_demux() [if_ethersubr.c, rev 1.222, line 638] are insufficient to prevent this bug from occurring, as ifp->if_vlantrunk will always be NULL for the non-vlan case.
MFC after: 3 weeks PR: 86429 Submitted by: Pieter de Boer (with changes)
|
#
166438 |
|
02-Feb-2007 |
bms |
Use int instead of u_int for the 'extra' argument to the clone_create() KPI. This fixes a signedness bug in unit number comparisons.
Submitted by: imp, Landon Fuller PR: kern/105228 MFC after: 2 weeks
|
#
164033 |
|
06-Nov-2006 |
rwatson |
Sweep kernel replacing suser(9) calls with priv(9) calls, assigning specific privilege names to a broad range of privileges. These may require some future tweaking.
Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
|
#
163986 |
|
04-Nov-2006 |
csjp |
Currently, we initialize "error" to zero when it's declared, then we never initialize it to anything else. However, in the case that m_uiotombuf fails, we return error (effectively reporting success).
This appears to be a relic of an older revision of this file, where "error" used to be doing something useful. (See revision 1.1, where error is used in a loop with uiomove() instead of using m_uiotomubf).
So instead on unconditionally reporting success in the case there is a failure in m_uiotombuf, explicitly return ENOBUFS. While we are here, garbage collect the error variable since it's no longer required.
MFC after: 2 weeks
|
#
163915 |
|
02-Nov-2006 |
andre |
Rename m_getm() to m_getm2() and rewrite it to allocate up to page sized mbuf clusters. Add a flags parameter to accept M_PKTHDR and M_EOR mbuf chain flags. Provide compatibility macro for m_getm() calling m_getm2() with M_PKTHDR set.
Rewrite m_uiotombuf() to use m_getm2() for mbuf allocation and do the uiomove() in a tight loop over the mbuf chain. Add a flags parameter to accept mbuf flags to be passed to m_getm2(). Adjust all callers for the extra parameter.
Sponsored by: TCP/IP Optimization Fundraise 2005 MFC after: 3 month
|
#
162711 |
|
27-Sep-2006 |
ru |
Fix our ioctl(2) implementation when the argument is "int". New ioctls passing integer arguments should use the _IOWINT() macro. This fixes a lot of ioctl's not working on sparc64, most notable being keyboard/syscons ioctls.
Full ABI compatibility is provided, with the bonus of fixing the handling of old ioctls on sparc64.
Reviewed by: bde (with contributions) Tested by: emax, marius MFC after: 1 week
|
#
160376 |
|
15-Jul-2006 |
brooks |
Drop a pointless cast of ifp->if_softc to (struct tap_softc *).
|
#
159079 |
|
30-May-2006 |
marius |
Revert the (int *) -> (intptr_t *) conversion done as part of rev. 1.59 for IOCTLs where casting data to intptr_t * isn't the right thing to do as _IO() isn't used for them but _IOR(..., int)/_IOW(..., int) are (i.e. for all IOCTLs except VMIO_SIOCSIFFLAGS), fixing tap(4) on big-endian LP64 machines.
PR: sparc64/98084 OK'ed by: emax MFC after: 1 week
|
#
158697 |
|
17-May-2006 |
emax |
Do not call knlist_destroy() in tapclose(). Instead call it when device is actually destroyed. Also move call to knlist_init() into tapcreate(). This should fix panic described in kern/95357.
PR: kern/95357 No response from: freebsd-current@ MFC after: 3 days
|
#
156783 |
|
16-Mar-2006 |
emax |
Add kqueue(2) support on if_tap(4) interfaces. While I'm here, replace K&R style function declarations with ANSI style. Also fix endian bugs accessing ioctl arguments that are passed by value.
PR: kern/93897 Submitted by: Vilmos Nebehaj < vili at huwico dot hu > MFC after: 1 week
|
#
152315 |
|
11-Nov-2005 |
ru |
- Store pointer to the link-level address right in "struct ifnet" rather than in ifindex_table[]; all (except one) accesses are through ifp anyway. IF_LLADDR() works faster, and all (except one) ifaddr_byindex() users were converted to use ifp->if_addr.
- Stop storing a (pointer to) Ethernet address in "struct arpcom", and drop the IFP2ENADDR() macro; all users have been converted to use IF_LLADDR() instead.
|
#
148887 |
|
09-Aug-2005 |
rwatson |
Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field.
Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so.
Reviewed by: pjd, bz MFC after: 7 days
|
#
148868 |
|
08-Aug-2005 |
rwatson |
Merge the dev_clone and dev_clone_cred event handlers into a single event handler, dev_clone, which accepts a credential argument. Implementors of the event can ignore it if they're not interested, and most do. This avoids having multiple event handler types and fall-back/precedence logic in devfs.
This changes the kernel API for /dev cloning, and may affect third party packages containg cloning kernel modules.
Requested by: phk MFC after: 3 days
|
#
147256 |
|
10-Jun-2005 |
brooks |
Stop embedding struct ifnet at the top of driver softcs. Instead the struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com.
This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go.
Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr.
Reviewed by: sobomax, sam
|
#
146620 |
|
25-May-2005 |
peadar |
Separate out address-detaching part of if_detach into if_purgeaddrs, so if_tap doesn't need to rely on locally-rolled code to do same.
The observable symptom of if_tap's bzero'ing the address details was a crash in "ifconfig tap0" after an if_tap device was closed.
Reported By: Matti Saarinen (mjsaarin at cc dot helsinki dot fi)
|
#
145883 |
|
04-May-2005 |
emax |
Change m_uiotombuf so it will accept offset at which data should be copied to the mbuf. Offset cannot exceed MHLEN bytes. This is currently used to fix Ethernet header alignment problem on alpha and sparc64. Also change all users of m_uiotombuf to pass proper offset.
Reviewed by: jmg, sam Tested by: Sten Spans "sten AT blinkenlights DOT nl" MFC after: 1 week
|
#
144979 |
|
13-Apr-2005 |
mdodd |
Provide a sysctl (net.link.tap.user_open) to allow unpriviliged acces to tap(4) device nodes based on file system permission.
Duplicate the 'debug.if_tap_debug' sysctl under the 'net.link.tap' hierarchy.
|
#
144389 |
|
31-Mar-2005 |
phk |
Explicitly hold a reference to the cdev we have just cloned. This closes the race where the cdev was reclaimed before it ever made it back to devfs lookup.
|
#
139823 |
|
07-Jan-2005 |
imp |
/* -> /*- for license, minor formatting changes
|
#
139207 |
|
22-Dec-2004 |
phk |
Don't include filedesc.h Include fcntl.h Include selinfo.h (don't rely on vnode.h to do so) Check O_NONBLOCK instead of IO_NDELAY Don't include vnode.h
|
#
137101 |
|
31-Oct-2004 |
glebius |
Utilize m_uiotombuf() in device write method, instead of home-grown implementation. This also gives a performance improvement, because m_uiotombuf() utilizes clusters.
Approved by: julian (mentor) MFC after: 1 month
|
#
135354 |
|
17-Sep-2004 |
rwatson |
Destroy global tapmtx when the if_tap module is unloaded.
RELENG_5 candidated.
|
#
133460 |
|
11-Aug-2004 |
emax |
Set IFF_RUNNING flag on the interface as soon as the control device is opened.
|
#
130640 |
|
17-Jun-2004 |
phk |
Second half of the dev_t cleanup.
The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev()
Various minor adjustments including handling of userland access to kernel space struct cdev etc.
|
#
130585 |
|
16-Jun-2004 |
phk |
Do the dreaded s/dev_t/struct cdev */ Bump __FreeBSD_version accordingly.
|
#
129880 |
|
30-May-2004 |
phk |
add missing #include <sys/module.h>
|
#
127170 |
|
18-Mar-2004 |
rwatson |
Correct a bug introduced with the recent clone API chang: when the clone event handler for if_tap fails, make sure to clean up clone state to prevent a clone memory leak.
|
#
127165 |
|
18-Mar-2004 |
rwatson |
sAdd a comment indicating why there continues to be a race condition in the tap driver, even with Giant over the cdev operation vector, due to a non-atomic test-and-set of the si_drv1 field in the dev_t. This bug exists with Giant under high memory pressure, as malloc() may sleep in tapcreate(), but is less likely to occur. The resolution will probably be to cover si_drv1 using the global tapmtx since no softc is available, but I need to think about this problem more generally across a range of drivers using si_drv1 in combination with SI_CHEAPCLONE to defer expensive allocation to open().
Correct what appears to be a bug in the original if_tap implementation, in which tapopen() will panic if a tap device instance is opened more than once due to an incorrect assertion -- only triggered if INVARIANTS is compiled in (i.e., when built into a kernel). Return EBUSY instead.
Expand mtx_lock() coverage using tp->tap_mtx to include tp->ether_addr.
|
#
127098 |
|
17-Mar-2004 |
rwatson |
Add tap_mtx to tap_softc in order to protect per-softc variables (tap_pid, tap_flags). if_tap should now be entirely MPSAFE.
Committed from: Bamboo house by ocean in Taiwan Tropical paradise provided by: Chia-liang Kao <clkao@clkao.org>
|
#
127003 |
|
15-Mar-2004 |
rwatson |
Lock down global variables in if_tap (primarily, the tap softc list); add tapmtx, which protects globale variables.
Notes:
- The EBUSY check in MOD_UNLOAD may be subject to a race. Moving the event handler unregister inside the mutex grab may prevent that race.
- Locking of global variables safely is now possible because tapclones is only modified when the module is loading or unloading, thanks to phk's recent chang to clone_setup().
- softc locking to follow.
|
#
126845 |
|
11-Mar-2004 |
phk |
Add clone_setup() function rather than rely on lazy initialization.
Requested by: rwatson
|
#
126796 |
|
10-Mar-2004 |
phk |
Fix handling of tap/vmnet flag in relation to cloning and properly enforce largest supported unit number for this device driver.
Reported by: Kaho Toshikazu <kaho@easy.es.tuat.ac.jp>
|
#
126188 |
|
24-Feb-2004 |
bde |
Don't set d_flags twice. The second setting clobbered D_NOGIANT.
|
#
126080 |
|
21-Feb-2004 |
phk |
Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION.
Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
|
#
126077 |
|
21-Feb-2004 |
phk |
Device megapatch 2/6:
This commit adds a couple of functions for pseudodrivers to use for implementing cloning in a manner we will be able to lock down (shortly).
Basically what happens is that pseudo drivers get a way to ask for "give me the dev_t with this unit number" or alternatively "give me a dev_t with the lowest guaranteed free unit number" (there is unfortunately a lot of non-POLA in the exact numeric value of this number, just live with it for now)
Managing the unit number space this way removes the need to use rman(9) to do so in the drivers this greatly simplifies the code in the drivers because even using rman(9) they still needed to manage their dev_t's anyway.
I have taken the if_tun, if_tap, snp and nmdm drivers through the mill, partly because they (ab)used makedev(), but mostly because together they represent three different problems for device-cloning:
if_tun and snp is the plain case: just give me a device.
if_tap has two kinds of devices, with a flag for device type.
nmdm has paired devices (ala pty) can you can clone either of them.
|
#
122352 |
|
09-Nov-2003 |
tanimura |
- Implement selwakeuppri() which allows raising the priority of a thread being waken up. The thread waken up can run at a priority as high as after tsleep().
- Replace selwakeup()s with selwakeuppri()s and pass appropriate priorities.
- Add cv_broadcastpri() which raises the priority of the broadcast threads. Used by selwakeuppri() if collision occurs.
Not objected in: -arch, -current
|
#
121816 |
|
31-Oct-2003 |
brooks |
Replace the if_name and if_unit members of struct ifnet with new members if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance.
This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics.
Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname)
|
#
111815 |
|
03-Mar-2003 |
phk |
Gigacommit to improve device-driver source compatibility between branches:
Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values.
This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386.
Approved by: re(scottl)
|
#
111748 |
|
02-Mar-2003 |
des |
More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9).
|
#
111742 |
|
02-Mar-2003 |
des |
Clean up whitespace, s/register //, refrain from strong urge to ANSIfy.
|
#
111741 |
|
02-Mar-2003 |
des |
uiomove-related caddr_t -> void * (just the low-hanging fruit)
|
#
111119 |
|
19-Feb-2003 |
imp |
Back out M_* changes, per decision of the TRB.
Approved by: trb
|
#
110097 |
|
30-Jan-2003 |
phk |
NODEVFS cleanup: unifdef
|
#
109623 |
|
21-Jan-2003 |
alfred |
Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
|
#
109526 |
|
19-Jan-2003 |
phk |
Originally when DEVFS was added, a global variable "devfs_present" was used to control code which were conditional on DEVFS' precense since this avoided the need for large-scale source pollution with #include "opt_geom.h"
Now that we approach making DEVFS standard, replace these tests with an #ifdef to facilitate mechanical removal once DEVFS becomes non-optional.
No functional change by this commit.
|
#
106939 |
|
15-Nov-2002 |
sam |
network interface and link layer changes:
o on input don't strip the Ethernet header from packets o input packet handling is now done with if_input o track changes to ether_ifattach/ether_ifdetach API o track changes to bpf tapping o call ether_ioctl for default handling of ioctl's o use constants from net/ethernet.h where possible
Reviewed by: many Approved by: re
|
#
105228 |
|
16-Oct-2002 |
phk |
Be consistent about functions being static.
Spotted by: FlexeLint
|
#
104393 |
|
03-Oct-2002 |
truckman |
In an SMP environment post-Giant it is no longer safe to blindly dereference the struct sigio pointer without any locking. Change fgetown() to take a reference to the pointer instead of a copy of the pointer and call SIGIO_LOCK() before copying the pointer and dereferencing it.
Reviewed by: rwatson
|
#
102052 |
|
18-Aug-2002 |
sobomax |
Increase size of ifnet.if_flags from 16 bits (short) to 32 bits (int). To avoid breaking application ABI use unused ifreq.ifru_flags[1] for upper 16 bits in SIOCSIFFLAGS and SIOCGIFFLAGS ioctl's.
Reviewed by: -hackers, -net
|
#
96122 |
|
06-May-2002 |
alfred |
Make funsetown() take a 'struct sigio **' so that the locking can be done internally.
Ensure that no one can fsetown() to a dying process/pgrp. We need to check the process for P_WEXIT to see if it's exiting. Process groups are already safe because there is no such thing as a pgrp zombie, therefore the proctree lock completely protects the pgrp from having sigio structures associated with it after it runs funsetownlst.
Add sigio lock to witness list under proctree and allproc, but over proc and pgrp.
Seigo Tanimura helped with this.
|
#
95883 |
|
01-May-2002 |
alfred |
Redo the sigio locking.
Turn the sigio sx into a mutex.
Sigio lock is really only needed to protect interrupts from dereferencing the sigio pointer in an object when the sigio itself is being destroyed.
In order to do this in the most unintrusive manner change pgsigio's sigio * argument into a **, that way we can lock internally to the function.
|
#
93752 |
|
04-Apr-2002 |
luigi |
Replace (deprecated ?) FREE() macro with direct calls to free()
|
#
93593 |
|
01-Apr-2002 |
jhb |
Change the suser() API to take advantage of td_ucred as well as do a general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag.
Discussed on: smp@
|
#
93084 |
|
24-Mar-2002 |
bde |
Fixed some style bugs in the removal of __P(()). The main ones were not removing tabs before "__P((", and not outdenting continuation lines to preserve non-KNF lining up of code with parentheses. Switch to KNF formatting and/or rewrap the whole prototype in some cases.
|
#
92725 |
|
19-Mar-2002 |
alfred |
Remove __P.
|
#
90227 |
|
05-Feb-2002 |
dillon |
Get rid of the twisted MFREE() macro entirely.
Reviewed by: dg, bmilekic MFC after: 3 days
|
#
87914 |
|
14-Dec-2001 |
jlemon |
whitespace fixes.
|
#
83805 |
|
21-Sep-2001 |
jhb |
Use the passed in thread to selrecord() instead of curthread.
|
#
83366 |
|
12-Sep-2001 |
julian |
KSE Milestone 2 Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process.
Sorry john! (your next MFC will be a doosie!)
Reviewed by: peter@freebsd.org, dillon@freebsd.org
X-MFC after: ha ha ha ha
|
#
83043 |
|
05-Sep-2001 |
brooks |
Add cloning support for the tap(4) device similar to that in the tun(4) device.
Submitted by: Maksim Yevmenkin <myevmenk@digisle.net>
|
#
74810 |
|
26-Mar-2001 |
phk |
Send the remains (such as I have located) of "block major numbers" to the bit-bucket.
|
#
71921 |
|
02-Feb-2001 |
brian |
Pass the minor number rather than the unit number to make_dev() from the clone handler.
|
#
71602 |
|
24-Jan-2001 |
phk |
DEVFS cloning for if_tap.
Submitted by: Maksim Yevmenkin <m_evmenkin@yahoo.com>
|
#
69781 |
|
08-Dec-2000 |
dwmalone |
Convert more malloc+bzero to malloc+M_ZERO.
Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
|
#
66067 |
|
19-Sep-2000 |
phk |
Rename lminor() to dev2unit(). This function gives a linear unit number which hides the 'hole' in the minor bits.
Introduce unit2minor() to do the reverse operation.
Fix some some make_dev() calls which didn't use UID_* or GID_* macros.
Kill the v_hashchain alias macro, it hides the real relationship.
Introduce experimental SI_CHEAPCLONE flag set it on cloned bpfs.
|
#
63861 |
|
25-Jul-2000 |
nsayer |
Change to support vmware... SIOCSIFADDR on the character device sets the (notional) "remote" ethernet address.
Submitted by: vsilyaev@mindspring.com
|
#
63803 |
|
24-Jul-2000 |
nsayer |
Sundry changes to debugging code. Add spl/splx to various sensitive spots Change semantics of the vmnet version of the device to keep VMware happy (don't junk state when the device is closed)
Submitted by: vsilyaev@mindspring.com
|
#
63670 |
|
20-Jul-2000 |
nsayer |
Add the tap driver.
The tap driver is used to present a virtual Ethernet interface to the system. Packets presented by the network stack to the interface are made available to a character device in /dev. With tap and the bridge code, you can make remote bridge configurations where both sides of the bridge are separated by userland daemons.
This driver also has a special naming hack to allow it to serve a similar purpose to the vmware port.
Submitted by: myevmenkin@att.com, vsilyaev@mindspring.com
|