summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
Commit message (Collapse)AuthorAgeFilesLines
...
* Prefer NULL over 0 for pointerskevlo2012-10-091-1/+1
|
* Fix typo: s/unknow/unknownkevlo2012-10-091-1/+1
|
* After r241245 it appeared that in_delayed_cksum(), which still expectsglebius2012-10-081-3/+3
| | | | | | | | | | | | | | host byte order, was sometimes called with net byte order. Since we are moving towards net byte order throughout the stack, the function was converted to expect net byte order, and its consumers fixed appropriately: - ip_output(), ipfilter(4) not changed, since already call in_delayed_cksum() with header in net byte order. - divert(4), ng_nat(4), ipfw_nat(4) now don't need to swap byte order there and back. - mrouting code and IPv6 ipsec now need to switch byte order there and back, but I hope, this is temporary solution. - In ipsec(4) shifted switch to net byte order prior to in_delayed_cksum(). - pf_route() catches up on r241245 changes to ip_output().
* The USB Bluetooth driver should only grab its own interfaces. This allows thehselasky2012-09-301-4/+16
| | | | | | | USB bluetooth driver to co-exist with other USB device classes and drivers. Reported by: Geoffrey Levand MFC after: 1 week
* Ensure that all cases that enqueue a netgraph item for delivery by arstone2012-09-271-1/+1
| | | | | | | | | | | | | ngthread properly set the item's depth to 1. In particular, prior to this change if ng_snd_item failed to acquire a lock on a node, the item's depth would not be set at all. This fix ensures that the error code from rcvmsg/ rcvdata is properly passed back to the apply callback. For example, this fixes a bug where an error from rcvmsg/rcvdata would not previously propagate back to a libnetgraph consumer when the message was queued. Reviewed by: mav MFC after: 1 month Sponsored by: Sandvine Incorporated
* o Create directory sys/netpfil, where all packet filters shouldglebius2012-09-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reside, and move there ipfw(4) and pf(4). o Move most modified parts of pf out of contrib. Actual movements: sys/contrib/pf/net/*.c -> sys/netpfil/pf/ sys/contrib/pf/net/*.h -> sys/net/ contrib/pf/pfctl/*.c -> sbin/pfctl contrib/pf/pfctl/*.h -> sbin/pfctl contrib/pf/pfctl/pfctl.8 -> sbin/pfctl contrib/pf/pfctl/*.4 -> share/man/man4 contrib/pf/pfctl/*.5 -> share/man/man5 sys/netinet/ipfw -> sys/netpfil/ipfw The arguable movement is pf/net/*.h -> sys/net. There are future plans to refactor pf includes, so I decided not to break things twice. Not modified bits of pf left in contrib: authpf, ftp-proxy, tftp-proxy, pflogd. The ipfw(4) movement is planned to be merged to stable/9, to make head and stable match. Discussed with: bz, luigi
* Remove duplicate check.mav2012-08-031-1/+1
| | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
* Add version so others can depend on this moduleemaste2012-07-271-0/+2
|
* Make radix lookup on src and dst flow addresses optionalmelifaro2012-06-183-92/+113
| | | | | | | | | | | | | and configurable on per-interface basis. Remove __inline__ for several functions being called once per flow (e.g once per 10-20 packets on common traffic flows). Update manual page to simplify search for BPF data link types. Sponsored by Yandex LLC Reviewed by: glebius Approved by: ae(mentor) MFC after: 2 weeks
* Simplify IP pointer recovery in case of mbuf reallocation.melifaro2012-06-181-53/+15
| | | | | | Reviewed by: glebius (previous version) Approved by: ae(mentor) MFC after: 2 weeks
* Use time_uptime instead of getnanotime for accouting integer number of seconds.melifaro2012-06-161-6/+4
| | | | | | Reviewed by: glebius Approved by: ae(mentor) MFC after: 1 week
* Set netflow v9 observation domain value to fib number instead of node id.melifaro2012-06-161-1/+1
| | | | | | | | This fixes multi-fib netflow v9 export. Reviewed by: glebius Approved by: kib(mentor) MFC after: 1 week
* Fix improper L4 header handling for IPv6 packets passed via DLT_RAW.melifaro2012-06-161-1/+1
| | | | | | | Reported by: Emil Muratov <gpm@hotplug.ru> Reviewed by: glebius Approved by: ae(mentor) MFC after: 1 week
* Revert my local not yet properly tested changes, that leaked inglebius2012-05-251-16/+23
| | | | with r235923.
* Revert r220768 for ng_ksocket. This node is special andglebius2012-05-242-24/+19
| | | | | | | when it is cloning, its constructor method may be called in a context that isn't allowed to sleep. Noticed by: Vadim Goncharov
* Fix panic in ng_patch(4) caused by checksum flags being added to mbuf flags.melifaro2012-04-221-1/+1
| | | | | | | Tested by: Maxim Ignatenko <gelraen.ua@gmail.com> Approved by: kib(mentor) MFC after: 3 days
* #include <net/vnet.h> is no longer needed here.zec2012-04-161-1/+0
| | | | | Spotted by: Ed Maste MFC after: 3 days.
* Fix compiler warnings, mostly signed issues,hselasky2012-04-021-6/+6
| | | | | | when USB modules are compiled with WARNS=9. MFC after: 1 weeks
* Use rt_numfibs variable instead of compile-time RT_NUMFIBS.melifaro2012-03-133-4/+13
| | | | | Reviewed by: glebius (previous version) Approved by: kib(mentor), ae(mentor)
* Upgrade the netgraph vlan node to support 802.1q, encapsulation type,adrian2012-03-112-150/+427
| | | | | | | | | | | | | | | | | | | | | | | | PCP and CFI fields. * Ethernet_type for VLAN encapsulation is tunable, default is 0x8100; * PCP (Priority code point) and CFI (canonical format indicator) is tunable per VID; * Tunable encapsulation to support 802.1q * Encapsulation/Decapsulation code improvements New messages have been added for this netgraph node to support the new features. However, the legacy "vlan" id is still supported and compiled in by default. It can be disabled in a future release. TODO: * Documentation * Examples PR: kern/161908 Submitted by: Ivan <rozhuk.im@gmail.com>
* Revert r231829, that was my braino.glebius2012-02-221-2/+2
|
* Refactor the name hash and the ID hash, that are used to address nodes:glebius2012-02-162-71/+178
| | | | | | | | | | | | | | | | | | - Make hash sizes growable, to satisfy users running large mpd installations, having thousands of nodes. - NG_NAMEHASH() proved to give a very bad distribution in real life name sets, while generic hash32_str(name, HASHINIT) proved to give an even one, so you the latter for name hash. - Do not store unnamed nodes in slot 0 of name hash, no reason for that. - Use the ID hash in cases when we need to run through all nodes: the NGM_LISTNODES command and in the vnet_netgraph_uninit(). - Implement NGM_LISTNODES and NGM_LISTNAMES as separate code, the former iterates through the ID hash, and the latter through the name hash. - Keep count of all nodes and of named nodes, so that we don't need to count nodes in NGM_LISTNODES and NGM_LISTNAMES. The counters are also used to estimate whether we need to grow hashes. - Close a race between two threads running ng_name_node() assigning same name to different nodes.
* Specify correct loading order for core of netgraph(4).glebius2012-02-161-2/+2
|
* Supply correct "how" argument to the uma_zcreate().glebius2012-02-161-2/+2
|
* In ng_getsockaddr() allocate memory prior to obtaining lock.glebius2012-02-161-11/+8
| | | | Reported & tested by: Mykola Dzham <i levsha.me>
* Fix includes list.glebius2012-02-151-2/+1
| | | | Submitted by: bde
* Trim double empty lines.glebius2012-02-151-8/+0
|
* Remove testing stuff, reducing kernel memory footprint by 1 Kb.glebius2012-02-151-29/+0
| | | | | Anyway, when we are building a LINT kernel, all these macros are tested via nodes.
* In ng_bypass() add more protection against potential raceglebius2012-02-151-0/+4
| | | | with ng_rmnode() and its followers.
* style(9): sort includes.glebius2012-02-151-6/+6
|
* No need to optimise for a node with no hooks, my braino.glebius2012-02-131-5/+2
|
* - Use fixed-width integer types.fjoe2012-02-122-21/+21
| | | | | | | | - Prefer to use C99 stdint types. This fixes ng_cisco on 64-bit architectures. MFC after: 1 week
* Remove direct access to si_name.ed2012-02-101-2/+3
| | | | | | | | Code should just use the devtoname() function to obtain the name of a character device. Also add const keywords to pieces of code that need it to build properly. MFC after: 2 weeks
* Provide a findhook method for ng_socket(4). The node stores aglebius2012-01-231-2/+101
| | | | | | | | | | | | | | | | | hash with names of its hooks. It starts with size of 16, and grows when number of hooks reaches twice the current size. A failure to grow (memory is allocated with M_NOWAIT) isn't fatal, however. I used standard hash(9) function for the hash. With 25000 hooks named in the mpd (ports/net/mpd5) manner of "b%u", the distributions is the following: 72.1% entries consist of one element, 22.1% consist of two, 5.2% consist of three and 0.6% of four. Speedup in a synthetic test that creates 25000 hooks and then runs through a long cyclce dereferencing them in a random order is over 25 times.
* In ng_socket(4) expose less kernel internals to userland. This commitglebius2012-01-232-17/+16
| | | | breaks ABI, but makes probability of ABI breakage in future less.
* Convert locks that protect name hash, ID hash and typelist fromglebius2012-01-231-60/+61
| | | | | | | | mutex(9) to rwlock(9) based locks. While here remove dropping lock when processing NGM_LISTNODES, and NGM_LISTTYPES generic commands. We don't need to drop it since memory allocation is done with M_NOWAIT.
* The newhook method can be called in ISR context atglebius2012-01-171-2/+3
| | | | certain circumstances, so better use M_NOWAIT in it.
* Add missing static.glebius2012-01-161-1/+1
|
* Remove some disabled NOTYET code. Probability of enabling it is low,glebius2012-01-161-78/+0
| | | | if anyone wants, he/she can take it from svn.
* Use strchr() and strrchr().ed2012-01-021-3/+3
| | | | | | | | It seems strchr() and strrchr() are used more often than index() and rindex(). Therefore, simply migrate all kernel code to use it. For the XFS code, remove an empty line to make the code identical to the code in the Linux kernel.
* style(9), whitespace and spelling nits.glebius2011-12-301-104/+78
|
* In r191367 the need for if_free_type() was removed and a new memberbrooks2011-11-111-1/+1
| | | | | | | | 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
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.ed2011-11-077-8/+9
| | | | | | 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.
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.ed2011-11-0726-32/+38
| | | | This means that their use is restricted to a single C file.
* - Fix potential double mbuf free: M_PREPEND may free mbuf chain and returnfjoe2011-11-061-1/+3
| | | | | | NULL but item will still have the reference ot the mbuf chain and will free it upon destruction. - Fix memory leak (unfree'd item on error path).
* Fix potential double mbuf free: M_PREPEND may free mbuf chain and returnfjoe2011-11-061-1/+2
| | | | | NULL but item will still have the reference ot the mbuf chain and will free it upon destruction.
* Constify "address" argument of ng_address_path().fjoe2011-11-062-2/+2
|
* - If KDB & NETGRAPH_DEBUG are on, print traces on discovered failedglebius2011-10-272-2/+9
| | | | | invariants. - Reduce tautology in NETGRAPH_DEBUG output.
* Free mbuf in case when protocol in unknown in ng_ipfw_rcvdata().melifaro2011-10-101-9/+7
| | | | | | | | This change fixes (theoretically) possible mbuf leak introduced in r225586. Reorder code a bit and change return codes to be more specific Reviewed by: glebius Approved by: kib (mentor)
* Add IPv6 support to the ng_ipfw(4) [1]. Also add ifdefs to be ableae2011-09-151-12/+42
| | | | | | | | | build it with and without INET/INET6 support. Submitted by: Alexander V. Chernikov <melifaro at yandex-team.ru> [1] Tested by: Alexander V. Chernikov <melifaro at yandex-team.ru> [1] Approved by: re (bz) MFC after: 2 weeks
OpenPOWER on IntegriCloud