summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
* Reshuffle SIOCGIFCONF32 handler from r155224.pluknet2010-10-212-27/+29
| | | | | | | | | | | | | - move all the chunks into one file, which allows to hide SIOCGIFCONF32 global definition as well. - replace __amd64__ with proper COMPAT_FREEBSD32 around. - handle 32bit capacity before going into the handler itself instead of doing internal 32bit specific changes within it (e.g. as it's done for SIOCGDEFIFACE32_IN6). - use explicitely sized types for ABI compat. Approved by: kib (mentor) MFC after: 2 weeks
* Close a race acquiring the IF_ADDR_LOCK() for each entry while iteratingbz2010-10-161-0/+4
| | | | | | | | | over all interfaces to make sure the address will neither change nor be freed while we are working on it. PR: kern/146250 Submitted by: Mikolaj Golub (to.my.trociny gmail.com) MFC after: 1 week
* lltable_drain() has never been used so far, thus #if 0 it for now.bz2010-10-162-0/+6
| | | | | | | While touching it add the missing locking to the now disabled code for the time when we'll resurrect it. MFC after: 3 days
* Only hide the ifa and not the tp under #ifdef INET as the tp is neededbz2010-10-011-1/+1
| | | | | | for locking evenwhen there is no INET. MFC after: 3 days
* - Expand scope of tun/tap softc locks to cover more softc fields andjhb2010-09-222-145/+97
| | | | | | | | | | | | | | | | | 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
* Fix a typo in a comment.jkim2010-09-161-1/+1
| | | | Submitted by: afiveg
* Replace sbuf_overflowed() with sbuf_error(), which returns any errormdf2010-09-101-2/+2
| | | | | | code associated with overflow or with the drain function. While this function is not expected to be used often, it produces more information in the form of an errno that sbuf_overflowed() did.
* MFp4 CH=183259:bz2010-09-021-2/+2
| | | | | | | No reason to use if_free_type() as we don't change our type. Just if_free() is fine. MFC after: 3 days
* Add a sysctl knob to accept input packets on any link in a failover lagg.emaste2010-09-011-1/+9
|
* MFp4 CH=182972:bz2010-08-271-0/+4
| | | | | | | Add explicit linkstate UP/DOWN for the epair. This is needed by carp(4) and other things to work. MFC after: 5 days
* Add an extra comment to the SDT probes definition. This allows us to getrpaulo2010-08-221-5/+9
| | | | | | | | | use '-' in probe names, matching the probe names in Solaris.[1] Add userland SDT probes definitions to sys/sdt.h. Sponsored by: The FreeBSD Foundation Discussed with: rwaston [1]
* When moving an ethernet ifnet from one vnet to another, destroy thezec2010-08-132-0/+34
| | | | | | | | associated ng_ether netgraph node in the current vnet, and create a new one in the target vnet. Reviewed by: julian MFC after: 3 days
* Unbreak LINT by moving all carp hooks to net/if.c / netinet/ip_carp.h, withwill2010-08-113-11/+18
| | | | | | | the appropriate ifdefs. Reviewed by: bz Approved by: ken (mentor)
* Allow carp(4) to be loaded as a kernel module. Follow precedent set bywill2010-08-113-40/+19
| | | | | | | | | | | | | | | bridge(4), lagg(4) etc. and make use of function pointers and pf_proto_register() to hook carp into the network stack. Currently, because of the uncertainty about whether the unload path is free of race condition panics, unloads are disallowed by default. Compiling with CARPMOD_CAN_UNLOAD in CFLAGS removes this anti foot shooting measure. This commit requires IP6PROTOSPACER, introduced in r211115. Reviewed by: bz, simon Approved by: ken (mentor) MFC after: 2 weeks
* Adjust the interface type in the link layer socket address for vlan(4)jhb2010-08-061-0/+5
| | | | | | | | | | | interfaces to be a vlan (IFT_L2VLAN) rather than an Ethernet interface (IFT_ETHER). The code already fixed if_type in the ifnet causing some places to report the interface as a vlan (e.g. arp -a output) and other places to report the interface as Ethernet (getifaddrs(3)). Now they should all report IFT_L2VLAN. Reviewed by: brooks MFC after: 1 month
* Properly set ifi_datalen for compat32 struct if_data32.kib2010-08-031-1/+1
| | | | | | PR: kern/149240 Submitted by: Stef Walter <stef memberwebs com> MFC after: 1 weeks
* Don't check malloc(M_WAITOK) result.glebius2010-07-271-2/+0
|
* Return NULL rather than 0 for a pointer.bz2010-07-271-1/+1
| | | | MFC after: 3 days
* When installing a new ARP entry via 'arp -S', lla_lookup() willglebius2010-07-271-0/+1
| | | | | | | | | | | | | | | either find an existing entry, or allocate a new one. In the latter case an entry would have flags, that were supplied as argument to lla_lookup(). In case of an existing entry, flags aren't modified. This lead to losing LLE_PUB and/or LLE_PROXY flags. We should apply these flags either in lla_rt_output() or in the in.c:in_lltable_lookup(). It seems to me that lla_rt_output() is a more correct choice. PR: kern/148784, kern/146539 Silence from: qingli, 5 days
* Fix an obvious typo from r1.1. We were acquiring an exclusive writer lockjkim2010-07-221-1/+1
| | | | | | regardless of the given flags. MFC after: 3 days
* whitespace cleanupluigi2010-07-151-2/+2
|
* small portability fix to build on linux/windowsluigi2010-07-151-0/+4
|
* Implement flexible BPF timestamping framework.jkim2010-06-153-95/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Allow setting format, resolution and accuracy of BPF time stamps per listener. Previously, we were only able to use microtime(9). Now we can set various resolutions and accuracies with ioctl(2) BIOCSTSTAMP command. Similarly, we can get the current resolution and accuracy with BIOCGTSTAMP command. Document all supported options in bpf(4) and their uses. - Introduce new time stamp 'struct bpf_ts' and header 'struct bpf_xhdr'. The new time stamp has both 64-bit second and fractional parts. bpf_xhdr has this time stamp instead of 'struct timeval' for bh_tstamp. The new structures let us use bh_tstamp of same size on both 32-bit and 64-bit platforms without adding additional shims for 32-bit binaries. On 64-bit platforms, size of BPF header does not change compared to bpf_hdr as its members are already all 64-bit long. On 32-bit platforms, the size may increase by 8 bytes. For backward compatibility, struct bpf_hdr with struct timeval is still the default header unless new time stamp format is explicitly requested. However, the behaviour may change in the future and all relevant code is wrapped around "#ifdef BURN_BRIDGES" for now. - Add experimental support for tagging mbufs with time stamps from a lower layer, e.g., device driver. Currently, mbuf_tags(9) is used to tag mbufs. The time stamps must be uptime in 'struct bintime' format as binuptime(9) and getbinuptime(9) do. Reviewed by: net@
* Update several places that iterate over CPUs to use CPU_FOREACH().jhb2010-06-113-50/+15
|
* Provide a macro for registering a virtualized sysctl handler forzec2010-06-021-0/+8
| | | | | | VNET opaque data. MFC after: 30 days
* This patch fixes the problem where proxy ARP entries cannot be addedqingli2010-05-254-11/+23
| | | | | | over the if_ng interface. MFC after: 3 days
* Ignore failures from removing multicast addresses from the parent (trunk)jhb2010-05-171-13/+14
| | | | | | | | | | | | | | | | | | interface when tearing down a vlan interface. If a trunk interface is detached, all of its multicast addresses are removed before the ifnet departure eventhandlers are invoked. This means that all of the multicast addresses are removed before the vlan interfaces are removed which causes the if_delmulti() calls in the vlan teardown to fail. In the VLAN_ARRAY case, this left vlan interfaces referencing a no longer valid parent interface. In the !VLAN_ARRAY case, the eventhandler gets stuck in an infinite loop retrying vlan_unconfig_locked() forever. In general the callers of vlan_unconfig_locked() do not expect nor handle failure, so I believe it is safer to ignore the errors and tear down as much of the vlan state as possible. Silence from: net@ MFC after: 4 days
* allocate ipv6 flows from the ipv6 flow zonekmacy2010-05-162-1/+1
| | | | | | reported by: rrs@ MFC after: 3 days
* Fix an issue with the dynamic pcpu/vnet data allocators.bz2010-05-141-1/+1
| | | | | | | | | | | | | | | We cannot expect that modspace is the last entry in the linker set and thus that modspace + possible extra space up to PAGE_SIZE would be contiguous. For the moment do not support more than *_MODMIN space and ignore the extra space (*). (*) We know how to get it back but it'll need testing. Discussed with: jeff, rwatson (briefly) Reviewed by: jeff Sponsored by: The FreeBSD Foundation Sponsored by: CK Software GmbH MFC after: 4 days
* workaround bug with ipv6 where a flow can have a null rtentrykmacy2010-05-121-2/+4
|
* Remove page queues locking from all sf_buf_mext()-like functions. The pagealc2010-05-061-2/+0
| | | | | | lock now suffices. Fix a couple nearby style violations.
* Add page locking to the vm_page_cow* functions.alc2010-05-041-2/+0
| | | | | | | Push down the acquisition and release of the page queues lock into vm_page_wire(). Reviewed by: kib
* Add new tunable 'net.link.ifqmaxlen' to set default send interfacesobomax2010-05-035-4/+8
| | | | | | | | | | queue length. The default value for this parameter is 50, which is quite low for many of today's uses and the only way to modify this parameter right now is to edit if_var.h file. Also add read-only sysctl with the same name, so that it's possible to retrieve the current value. MFC after: 1 month
* This is the first step in transitioning responsibility for synchronizingalc2010-05-031-0/+2
| | | | | | access to the page's wire_count from the page queues lock to the page lock. Submitted by: kmacy
* On Alan's advice, rather than do a wholesale conversion on a singlekmacy2010-04-301-0/+2
| | | | | | | | | | | | architecture from page queue lock to a hashed array of page locks (based on a patch by Jeff Roberson), I've implemented page lock support in the MI code and have only moved vm_page's hold_count out from under page queue mutex to page lock. This changes pmap_extract_and_hold on all pmaps. Supported by: Bitgravity Inc. Discussed with: alc, jeffr, and kib
* MFP4: @176978-176982, 176984, 176990-176994, 177441bz2010-04-294-32/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | "Whitspace" churn after the VIMAGE/VNET whirls. Remove the need for some "init" functions within the network stack, like pim6_init(), icmp_init() or significantly shorten others like ip6_init() and nd6_init(), using static initialization again where possible and formerly missed. Move (most) variables back to the place they used to be before the container structs and VIMAGE_GLOABLS (before r185088) and try to reduce the diff to stable/7 and earlier as good as possible, to help out-of-tree consumers to update from 6.x or 7.x to 8 or 9. This also removes some header file pollution for putatively static global variables. Revert VIMAGE specific changes in ipfilter::ip_auth.c, that are no longer needed. Reviewed by: jhb Discussed with: rwatson Sponsored by: The FreeBSD Foundation Sponsored by: CK Software GmbH MFC after: 6 days
* need to initialize the lock before it is usedkmacy2010-04-271-1/+1
| | | | MFC after: 3 days
* MFP4: @177254bz2010-04-271-3/+8
| | | | | | | | | Add missing CURVNET_RESTORE() calls for multiple code paths, to stop leaking the currently cached vnet into callers and to the process. Sponsored by: The FreeBSD Foundation Sponsored by: CK Software GmbH MFC after: 4 days
* Provide compat32 shims for bpf(4), except zero-copy facilities.kib2010-04-252-3/+166
| | | | | | | | | | bd_compat32 field of struct bpf_d is kept unconditionally to not impose the requirement of including "opt_compat.h" on all numerous users of bpfdesc.h. Submitted by: jhb (version for 6.x) Reviewed and tested by: emaste MFC after: 2 weeks
* Provide 32bit compat shims for sysctl net.route NET_RT_IFLIST.kib2010-04-251-1/+101
| | | | | | | | | This allows getifaddrs(3) to work for compat32 binaries. Submitted by: jhb (6.x version) Reviewed by: emaste Tested by: emaste and <pluknet gmail com> MFC after: 2 weeks
* Move two copies of the same definition to a common include file.julian2010-04-142-9/+9
| | | | MFC after: 3 weeks
* When an underlying ioctl(2) handler returns an error, our ioctl(2)delphij2010-04-141-4/+3
| | | | | | | | | | | | | | | | | interface considers that it hits a fatal error, and will not copyout the request structure back for _IOW and _IOWR ioctls, keeping them untouched. The previous implementation of the SIOCGIFDESCR ioctl intends to feed the buffer length back to userland. However, if we return an error, the feedback would be defeated and ifconfig(8) would trap into an infinite loop. This commit changes SIOCGIFDESCR to set buffer field to NULL to indicate the previous ENAMETOOLONG case. Reported by: bschmidt MFC after: 2 weeks
* Take a reference to make sure that the interface cannot go away duringbz2010-04-111-3/+8
| | | | | | | | if_clone_destroy() in case parallel threads try to. PR: kern/116837 Submitted by: Mikolaj Golub (to.my.trociny gmail.com) MFC after: 10 days
* Check that the interface is on the list of cloned interfaces before tryingbz2010-04-111-1/+11
| | | | | | | | | to remove it to avoid panics in case of two threads trying to remove it in parallel. PR: kern/116837 Submitted by: Takahiro Kurosawa (takahiro.kurosawa gmail.com) (orig version) MFC after: 10 days
* Plug reference leaks in the link-layer code ("new-arp") that previouslybz2010-04-111-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | prevented the link-layer entry from being freed. In both in.c and in6.c (though that code path seems to be basically dead) plug a reference leak in case of a pending callout being drained. In if_ether.c consistently add a reference before resetting the callout and in case we canceled a pending one remove the reference for that. In the final case in arptimer, before freeing the expired entry, remove the reference again and explicitly call callout_stop() to clear the active flag. In nd6.c:nd6_free() we are only ever called from the callout function and thus need to remove the reference there as well before calling into llentry_free(). In if_llatbl.c when freeing entire tables make sure that in case we cancel a pending callout to remove the reference as well. Reviewed by: qingli (earlier version) MFC after: 10 days Problem observed, patch tested by: simon on ipv6gw.f.o, Christian Kratzer (ck cksoft.de), Evgenii Davidov (dado korolev-net.ru) PR: kern/144564 Configurations still affected: with options FLOWTABLE
* In if_detach_internal() we cannot hold the af_data lock over thebz2010-04-111-3/+9
| | | | | | | | | dom_ifdetach() calls as they might sleep for callout_drain(). Do as we do in if_attachdomain1() [r121470] and handle if_afdata_initialized earlier and call dom_ifdetach() unlocked. Discussed with: rwatson MFC after: 10 days
* In if_detach_internal() only try to do the detach run if if_attachdomain1()bz2010-04-111-1/+1
| | | | | | | | | has actually succeeded to initialize and attach. There is a theoretical possibility to drop out early in if_attachdomain1() leaving the array uninitialized if we cannot get the lock. Discussed with: rwatson MFC after: 10 days
* Check the pointer to JIT binary filter before its de-allocation.jkim2010-03-291-3/+4
| | | | | Submitted by: Alexander Sack (asack at niksun dot com) MFC after: 3 days
* Add MCS to the list of media types.rpaulo2010-03-231-0/+2
| | | | Sponsored by: iXsystems, inc.
* - boot-time size the ipv4 flowtable and the maximum number of flowskmacy2010-03-221-24/+82
| | | | | | | | | - increase flow cleaning frequency and decrease flow caching time when near the flow limit - stop allocating new flows when within 3% of maxflows don't start allocating again until below 12.5% MFC after: 7 days
OpenPOWER on IntegriCloud