summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
Commit message (Collapse)AuthorAgeFilesLines
* Remove any stale mbuf tags from packets being injected into a netgraphzec2014-07-011-0/+3
| | | | | | | | graph. In particular, this solves some issues with (probably leaked) IPSec-related tags being looped back through netgraph to the inbound path which then misinterpreted the stale tags. MFC after: 7 days
* Pull in r267961 and r267973 again. Fix for issues reported will follow.hselasky2014-06-282-9/+3
|
* Revert r267961, r267973:gjb2014-06-272-3/+9
| | | | | | | | | | 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
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifhselasky2014-06-272-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* PF_BLUETOOTH protocols: skip initialization of non-virtualized globalstrociny2014-06-105-0/+27
| | | | | | | | for non-default VNET instances. This fixes panic on a vnet initialization when ng_btsocket is loaded. MFC after: 1 week
* Use M_WAITOK for the NGM_PIPE_SET_CFG control message. We expect it toglebius2014-05-281-1/+1
| | | | | | arrive from userland only. Submitted by: Dmitry Luhtionov <dmitryluhtionov gmail.com>
* Make ng_mppc to not disable the node in case of multiple packet loss.mav2014-05-221-4/+33
| | | | | | | | | Quite often it can be just packet reorder, and killing link in such case is inconvenient. Add few sysctl's to control that behavior. PR: kern/182212 Submitted by: Eugene Grosbein <egrosbein@rdtc.ru> MFC after: 2 weeks
* Use NG_WAITOK as ng_package_msg() argument instead of M_WAITOK.mav2014-05-221-1/+1
| | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
* Remove AppleTalk support.glebius2014-03-144-18/+2
| | | | | | | | | | AppleTalk was a network transport protocol for Apple Macintosh devices in 80s and then 90s. Starting with Mac OS X in 2000 the AppleTalk was a legacy protocol and primary networking protocol is TCP/IP. The last Mac OS X release to support AppleTalk happened in 2009. The same year routing equipment vendors (namely Cisco) end their support. Thus, AppleTalk won't be supported in FreeBSD 11.0-RELEASE.
* Remove IPX support.glebius2014-03-144-16/+1
| | | | | | | | | | | IPX was a network transport protocol in Novell's NetWare network operating system from late 80s and then 90s. The NetWare itself switched to TCP/IP as default transport in 1998. Later, in this century the Novell Open Enterprise Server became successor of Novell NetWare. The last release that claimed to still support IPX was OES 2 in 2007. Routing equipment vendors (e.g. Cisco) discontinued support for IPX in 2011. Thus, IPX won't be supported in FreeBSD 11.0-RELEASE.
* Be much more specific (and correct) about the device id matching.adrian2014-01-091-16/+16
| | | | | | | | | | These device IDs have an AR3012 bluetooth device that shows up with bcdDevice=1 when it doesn't have the firmware loaded, and bcdDevice=2 when it's ready to speak full HCI. Tested: * AR5B225 PCIe - AR9485 + AR3012
* Fix circular math macro.glebius2014-01-031-1/+1
| | | | | | Submitted by: Lutz Donnerhacke via Dmitry Luhtionov German lesson at: http://lutz.donnerhacke.de/Blog/Der-Fluch-der-Stabilitaet PR: 146082
* Fix !INET6 build for various platforms.delphij2014-01-021-0/+2
|
* - Use counter(9) for node stats updated at a high rate.glebius2014-01-014-131/+135
| | | | | | | | | - Use simple ++ for rare events. - Use uma_zone_get_cur() to get knowledge about space left in cache. - Convert many fields of struct ng_netflow_info to 64 bit. Tested by: Viktor Velichkin <avisom yandex.ru> Sponsored by: Nginx, Inc.
* In sys/netgraph/netflow, use __FBSDID() instead of old-style rcs_id[].dim2013-12-293-6/+6
| | | | MFC after: 3 days
* Fix the parse type for NGM_LISTTYPES.glebius2013-12-291-2/+2
| | | | | | | | | Actually, text versions of generic commands are not used, since ngctl(8) uses binary messages for them. And to request a text command one needs a working ngctl(8). That's why the bug was never discovered. I'm pondering on removing the text support for generic commands. Found by: dim with clang 3.4
* In r248885 I have reduced size of fake uio resid that ng_ksocket(4) passesglebius2013-12-211-10/+17
| | | | | | | | | | | | | | | | | | | | | to the soreceive(). This exposed a bug. When reading from a raw socket, when our fake limit is depleted, we receive a truncated mbuf chain, with m->m_pkthdr.len > m_length(m). The first problem is that MSG_TRUNC was not handled. The second one is that we didn't reinit uio_resid in our endless loop (neither flags), and if socket buffer contained several records, then we quickly deplete our fake limit. The third bug, actually introduced in r248885, is that MJUMPAGESIZE isn't enough to handle maximum packet that ng_ksocket(4) can theoretically receive. Changes: - Reinit uio_resid and flags before every call to soreceive(). - Set maximum acceptable size of packet to IP_MAXPACKET. As for now the module doesn't support INET6. - Properly handle MSG_TRUNC return from soreceive(). PR: 184601 Submitted & tested by: Viktor Velichkin <avisom yandex.ru> Sponsored by: Nginx, Inc.
* Eliminate duplicated & dead code.zec2013-11-081-29/+0
| | | | MFC after: 3 days
* Restore the entropy gathering from the m_data pointer value, not theadrian2013-11-021-1/+1
| | | | | | m_data payload. After talking with markm/bde, this is what markm actually intended.
* Teach the netgraph code to use a const char * pointer too.adrian2013-11-021-1/+1
| | | | Pointy hat to: adrian
* Axe ng_fec(4). It has never been a real netgraph(4) module, sinceglebius2013-10-282-1477/+0
| | | | | | | | | it had no hooks. It has abused ifnet's if_afdata slot and actually abused every subsystem it touched. lagg(4) is a proper trunking solution at ifnet(9) layer. ng_one2many(4) is a proper trunking solution in netgraph(4).
* Include necessary headers that now are available due to pollutionglebius2013-10-283-0/+3
| | | | | | | via if_var.h. Sponsored by: Netflix Sponsored by: Nginx, Inc.
* The r48589 promised to remove implicit inclusion of if_var.h soon. Prepareglebius2013-10-268-0/+8
| | | | | | | | 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.
* Remove unsigned < 0 comparison.glebius2013-10-261-1/+1
|
* Improve locking model used to protect netgraph topology:melifaro2013-10-151-22/+26
| | | | | | | | | use rwlocks instead of mutexes on node traversal. Reviewed by: glebius Tested by: Eugene Grosbein <egrosbein@rdtc.ru> MFC after: 2 weeks Sponsored by: Yandex LLC
* Debug run. This now works, except that the "live" sources haven'tmarkm2013-10-061-1/+1
| | | | | | | | | | | | been tested. With all sources turned on, this unlocks itself in a couple of seconds! That is no my box, and there is no guarantee that this will be the case everywhere. * Cut debug prints. * Use the same locks/mutexes all the way through. * Be a tad more conservative about entropy estimates.
* Snapshot. This passes the build test, but has not yet been finished or debugged.markm2013-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Contains: * Refactor the hardware RNG CPU instruction sources to feed into the software mixer. This is unfinished. The actual harvesting needs to be sorted out. Modified by me (see below). * Remove 'frac' parameter from random_harvest(). This was never used and adds extra code for no good reason. * Remove device write entropy harvesting. This provided a weak attack vector, was not very good at bootstrapping the device. To follow will be a replacement explicit reseed knob. * Separate out all the RANDOM_PURE sources into separate harvest entities. This adds some secuity in the case where more than one is present. * Review all the code and fix anything obviously messy or inconsistent. Address som review concerns while I'm here, like rename the pseudo-rng to 'dummy'. Submitted by: Arthur Mesh <arthurmesh@gmail.com> (the first item)
* MFCmarkm2013-09-062-1/+2
|\
| * Make default cache size more modern.glebius2013-09-041-1/+1
| | | | | | | | Requested by: Slawa Olhovchenkov <slw zxy.spb.ru>
| * Add support for the BCM20702A0 chipset, ASUS USB-BT400.eadler2013-09-011-0/+1
| | | | | | | | | | PR: kern/181728 Submitted by: rakuco
* | MFCmarkm2013-08-311-0/+60
|\ \ | |/
| * Sync USB bluetooth product list with Linux.hselasky2013-08-311-0/+60
| | | | | | | | MFC after: 1 week
* | Snapshot; Do some running repairs on entropy harvesting. More needs to follow.markm2013-08-261-2/+1
|/
* Add constant for PPP-Max-PayLoad tag.glebius2013-07-232-0/+3
| | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov gmail.com>
* PR: kern/168520rodrigc2013-07-151-9/+1
| | | | Revert GRN 253255. It is not needed now that GRN 253346 is committed.
* PR: 168520 170096rodrigc2013-07-152-1/+6
| | | | | | | | | | | | | | | | | | | | Submitted by: adrian, zec Fix multiple kernel panics when VIMAGE is enabled in the kernel. These fixes are based on patches submitted by Adrian Chadd and Marko Zec. (1) Set curthread->td_vnet to vnet0 in device_probe_and_attach() just before calling device_attach(). This fixes multiple VIMAGE related kernel panics when trying to attach Bluetooth or USB Ethernet devices because curthread->td_vnet is NULL. (2) Set curthread->td_vnet in if_detach(). This fixes kernel panics when detaching networking interfaces, especially USB Ethernet devices. (3) Use VNET_DOMAIN_SET() in ng_btsocket.c (4) In ng_unref_node() set curthread->td_vnet. This fixes kernel panics when detaching Netgraph nodes.
* PR: kern/168520rodrigc2013-07-121-1/+9
| | | | | | | | | | | | | | | Submitted by: "YAMAMOTO, Shigeru" <shigeru@iij.ad.jp> Reviewed by: adrian In PC-BSD 9.1, VIMAGE is enabled in the kernel config. For laptops with Bluetooth capability, such as the HP Elitebook 8460p, the kernel will panic upon bootup, because curthread->td_vnet is not initialized. Properly initialize curthread->td_vnet when initializing the Bluetooth stack. This allows laptops such as the HP Elitebook 8460p laptop to properly boot with VIMAGE kernels.
* Fix several typoseadler2013-05-121-1/+1
| | | | | | PR: kern/176054 Submitted by: Christoph Mallon <christoph.mallon@gmx.de> MFC after: 3 days
* Fxi a bunch of typos.eadler2013-05-101-1/+1
| | | | | PR: misc/174625 Submitted by: Jeremy Chadwick <jdc@koitsu.org>
* Add const qualifier to the dst parameter of the ifnet if_output method.glebius2013-04-262-11/+11
|
* - Correct mispellings of the word necessarygabor2013-04-171-1/+1
| | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de> (via private mail)
* Attempt to clean up spacing and long lines.glebius2013-04-121-98/+112
|
* Add blacklist entries for Atheros bluetooth device IDs that are known toadrian2013-04-051-0/+33
| | | | | | | | need firmware before they will re-attach as correctly functioning bluetooth devices. Reviewed by: maksim Obtained from: Linux ath3k device driver
* Revamp mbuf handling in ng_ksocket_incoming2():glebius2013-03-291-12/+22
| | | | | | | | | | | | | | | - Clear code that workarounded a bug in FreeBSD 3, and even predated import of netgraph(4). - Clear workaround for m_nextpkt pointing into next record in buffer (fixed in r248884). Assert that m_nextpkt is clear. - Do not rely on SOCK_STREAM sockets containing M_PKTHDR mbufs. Create a header ourselves and attach chain to it. This is correct fix for kern/154676. PR: kern/154676 Sponsored by: Nginx, Inc
* Whitespace.glebius2013-03-291-10/+10
|
* Non-functional cleanup of ng_ksocket_incoming2().glebius2013-03-291-8/+8
|
* Return ENOMEM if malloc() fails.glebius2013-03-261-1/+1
|
* Cleanup: wrap long lines, cleanup comments, etc.glebius2013-03-262-113/+141
|
* Add NGM_NAT_LIBALIAS_INFO command, that reports internal statsglebius2013-03-212-0/+73
| | | | | | of libalias instance. To be used in the mpd5 daemon. Submitted by: Dmitry Luhtionov <dmitryluhtionov gmail.com>
* Fix compilation warning.glebius2013-02-151-2/+4
| | | | Sponsored by: Nginx, Inc
OpenPOWER on IntegriCloud