summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/stable/10' into develRenato Botelho2015-12-281-1/+1
|\
| * MFH: r278640julian2015-12-271-1/+1
| | | | | | | | | | | | Revise default limit for maximum of netgraph data items. With modern internet speeds the limit can be reached even on a single L2TP link.
* | Merge branch 'stable/10' into develRenato Botelho2015-10-072-0/+58
|\ \ | |/
| * MFC r287654: Add support for PPP-Max-Payload PPPoE tag (RFC4638).mav2015-10-062-0/+58
| | | | | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
* | Importing pfSense patch ng_ether_attach_command.diffRenato Botelho2015-08-172-0/+25
| |
* | Importing pfSense patch ng_eiface.RELENG_10.diffRenato Botelho2015-08-172-0/+54
| |
* | Importing pfSense patch ng_iface.RELENG_10.diffRenato Botelho2015-08-172-0/+59
|/
* MFC of r280785, r280871, r280872, r281510, r218511 - callout fixes.rrs2015-04-172-3/+3
| | | | Sponsored by: Netflix Inc.
* MFC r277951:dim2015-02-031-3/+3
| | | | | Fix a bunch of -Wcast-qual warnings in netgraph's ng_parse.c, by using __DECONST. No functional change.
* MFC r263710, r273377, r273378, r273423 and r273455:hselasky2014-10-273-6/+6
| | | | | | | - De-vnet hash sizes and hash masks. - Fix multiple issues related to arguments passed to SYSCTL macros. Sponsored by: Mellanox Technologies
* MFC r267336:trociny2014-06-305-0/+27
| | | | | | | PF_BLUETOOTH protocols: skip initialization of non-virtualized globals for non-default VNET instances. This fixes panic on a vnet initialization when ng_btsocket is loaded.
* MFC r266538:mav2014-06-051-4/+33
| | | | | | | | | Make ng_mppc to not disable the node in case of multiple packet loss. 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>
* Merge r260046: Fix the parse type for NGM_LISTTYPES.glebius2014-01-221-2/+2
|
* Merge 260225:glebius2014-01-221-1/+1
| | | | | | Fix circular math macro. PR: 146082
* MFC r260048:dim2014-01-043-6/+6
| | | | In sys/netgraph/netflow, use __FBSDID() instead of old-style rcs_id[].
* Merge r259681 from head:glebius2014-01-031-10/+17
| | | | | | | | | | 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
* Merge from project branch via main. Uninteresting commits are trimmed.markm2013-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor of /dev/random device. Main points include: * Userland seeding is no longer used. This auto-seeds at boot time on PC/Desktop setups; this may need some tweeking and intelligence from those folks setting up embedded boxes, but the work is believed to be minimal. * An entropy cache is written to /entropy (even during installation) and the kernel uses this at next boot. * An entropy file written to /boot/entropy can be loaded by loader(8) * Hardware sources such as rdrand are fed into Yarrow, and are no longer available raw. ------------------------------------------------------------------------ r256240 | des | 2013-10-09 21:14:16 +0100 (Wed, 09 Oct 2013) | 4 lines Add a RANDOM_RWFILE option and hide the entropy cache code behind it. Rename YARROW_RNG and FORTUNA_RNG to RANDOM_YARROW and RANDOM_FORTUNA. Add the RANDOM_* options to LINT. ------------------------------------------------------------------------ r256239 | des | 2013-10-09 21:12:59 +0100 (Wed, 09 Oct 2013) | 2 lines Define RANDOM_PURE_RNDTEST for rndtest(4). ------------------------------------------------------------------------ r256204 | des | 2013-10-09 18:51:38 +0100 (Wed, 09 Oct 2013) | 2 lines staticize struct random_hardware_source ------------------------------------------------------------------------ r256203 | markm | 2013-10-09 18:50:36 +0100 (Wed, 09 Oct 2013) | 2 lines Wrap some policy-rich code in 'if NOTYET' until we can thresh out what it really needs to do. ------------------------------------------------------------------------ r256184 | des | 2013-10-09 10:13:12 +0100 (Wed, 09 Oct 2013) | 2 lines Re-add /dev/urandom for compatibility purposes. ------------------------------------------------------------------------ r256182 | des | 2013-10-09 10:11:14 +0100 (Wed, 09 Oct 2013) | 3 lines Add missing include guards and move the existing ones out of the implementation namespace. ------------------------------------------------------------------------ r256168 | markm | 2013-10-08 23:14:07 +0100 (Tue, 08 Oct 2013) | 10 lines Fix some just-noticed problems: o Allow this to work with "nodevice random" by fixing where the MALLOC pool is defined. o Fix the explicit reseed code. This was correct as submitted, but in the project branch doesn't need to set the "seeded" bit as this is done correctly in the "unblock" function. o Remove some debug ifdeffing. o Adjust comments. ------------------------------------------------------------------------ r256159 | markm | 2013-10-08 19:48:11 +0100 (Tue, 08 Oct 2013) | 6 lines Time to eat crow for me. I replaced the sx_* locks that Arthur used with regular mutexes; this turned out the be the wrong thing to do as the locks need to be sleepable. Revert this folly. # Submitted by: Arthur Mesh <arthurmesh@gmail.com> (In original diff) ------------------------------------------------------------------------ r256138 | des | 2013-10-08 12:05:26 +0100 (Tue, 08 Oct 2013) | 10 lines Add YARROW_RNG and FORTUNA_RNG to sys/conf/options. Add a SYSINIT that forces a reseed during proc0 setup, which happens fairly late in the boot process. Add a RANDOM_DEBUG option which enables some debugging printf()s. Add a new RANDOM_ATTACH entropy source which harvests entropy from the get_cyclecount() delta across each call to a device attach method. ------------------------------------------------------------------------ r256135 | markm | 2013-10-08 07:54:52 +0100 (Tue, 08 Oct 2013) | 8 lines Debugging. My attempt at EVENTHANDLER(multiuser) was a failure; use EVENTHANDLER(mountroot) instead. This means we can't count on /var being present, so something will need to be done about harvesting /var/db/entropy/... . Some policy now needs to be sorted out, and a pre-sync cache needs to be written, but apart from that we are now ready to go. Over to review. ------------------------------------------------------------------------ r256094 | markm | 2013-10-06 23:45:02 +0100 (Sun, 06 Oct 2013) | 8 lines Snapshot. Looking pretty good; this mostly works now. New code includes: * Read cached entropy at startup, both from files and from loader(8) preloaded entropy. Failures are soft, but announced. Untested. * Use EVENTHANDLER to do above just before we go multiuser. Untested. ------------------------------------------------------------------------ r256088 | markm | 2013-10-06 14:01:42 +0100 (Sun, 06 Oct 2013) | 2 lines Fix up the man page for random(4). This mainly removes no-longer-relevant details about HW RNGs, reseeding explicitly and user-supplied entropy. ------------------------------------------------------------------------ r256087 | markm | 2013-10-06 13:43:42 +0100 (Sun, 06 Oct 2013) | 6 lines As userland writing to /dev/random is no more, remove the "better than nothing" bootstrap mode. Add SWI harvesting to the mix. My box seeds Yarrow by itself in a few seconds! YMMV; more to follow. ------------------------------------------------------------------------ r256086 | markm | 2013-10-06 13:40:32 +0100 (Sun, 06 Oct 2013) | 11 lines Debug run. This now works, except that the "live" sources haven't 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. ------------------------------------------------------------------------ r256084 | markm | 2013-10-06 13:35:29 +0100 (Sun, 06 Oct 2013) | 5 lines Don't use the "real" assembler mnemonics; older compilers may not understand them (like when building CURRENT on 9.x). # Submitted by: Konstantin Belousov <kostikbel@gmail.com> ------------------------------------------------------------------------ r256081 | markm | 2013-10-06 10:55:28 +0100 (Sun, 06 Oct 2013) | 12 lines SNAPSHOT. Simplify the malloc pools; We only need one for this device. Simplify the harvest queue. Marginally improve the entropy pool hashing, making it a bit faster in the process. Connect up the hardware "live" source harvesting. This is simplistic for now, and will need to be made rate-adaptive. All of the above passes a compile test but needs to be debugged. ------------------------------------------------------------------------ r256042 | markm | 2013-10-04 07:55:06 +0100 (Fri, 04 Oct 2013) | 25 lines Snapshot. This passes the build test, but has not yet been finished or debugged. 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) ------------------------------------------------------------------------ r255319 | markm | 2013-09-06 18:51:52 +0100 (Fri, 06 Sep 2013) | 4 lines Yarrow wants entropy estimations to be conservative; the usual idea is that if you are certain you have N bits of entropy, you declare N/2. ------------------------------------------------------------------------ r255075 | markm | 2013-08-30 18:47:53 +0100 (Fri, 30 Aug 2013) | 4 lines Remove short-lived idea; thread to harvest (eg) RDRAND enropy into the usual harvest queues. It was a nifty idea, but too heavyweight. # Submitted by: Arthur Mesh <arthurmesh@gmail.com> ------------------------------------------------------------------------ r255071 | markm | 2013-08-30 12:42:57 +0100 (Fri, 30 Aug 2013) | 4 lines Separate out the Software RNG entropy harvesting queue and thread into its own files. # Submitted by: Arthur Mesh <arthurmesh@gmail.com> ------------------------------------------------------------------------ r254934 | markm | 2013-08-26 20:07:03 +0100 (Mon, 26 Aug 2013) | 2 lines Remove the short-lived namei experiment. ------------------------------------------------------------------------ r254928 | markm | 2013-08-26 19:35:21 +0100 (Mon, 26 Aug 2013) | 2 lines Snapshot; Do some running repairs on entropy harvesting. More needs to follow. ------------------------------------------------------------------------ r254927 | markm | 2013-08-26 19:29:51 +0100 (Mon, 26 Aug 2013) | 15 lines Snapshot of current work; 1) Clean up namespace; only use "Yarrow" where it is Yarrow-specific or close enough to the Yarrow algorithm. For the rest use a neutral name. 2) Tidy up headers; put private stuff in private places. More could be done here. 3) Streamline the hashing/encryption; no need for a 256-bit counter; 128 bits will last for long enough. There are bits of debug code lying around; these will be removed at a later stage. ------------------------------------------------------------------------ r254784 | markm | 2013-08-24 14:54:56 +0100 (Sat, 24 Aug 2013) | 39 lines 1) example (partially humorous random_adaptor, that I call "EXAMPLE") * It's not meant to be used in a real system, it's there to show how the basics of how to create interfaces for random_adaptors. Perhaps it should belong in a manual page 2) Move probe.c's functionality in to random_adaptors.c * rename random_ident_hardware() to random_adaptor_choose() 3) Introduce a new way to choose (or select) random_adaptors via tunable "rngs_want" It's a list of comma separated names of adaptors, ordered by preferences. I.e.: rngs_want="yarrow,rdrand" Such setting would cause yarrow to be preferred to rdrand. If neither of them are available (or registered), then system will default to something reasonable (currently yarrow). If yarrow is not present, then we fall back to the adaptor that's first on the list of registered adaptors. 4) Introduce a way where RNGs can play a role of entropy source. This is mostly useful for HW rngs. The way I envision this is that every HW RNG will use this functionality by default. Functionality to disable this is also present. I have an example of how to use this in random_adaptor_example.c (see modload event, and init function) 5) fix kern.random.adaptors from kern.random.adaptors: yarrowpanicblock to kern.random.adaptors: yarrow,panic,block 6) add kern.random.active_adaptor to indicate currently selected adaptor: root@freebsd04:~ # sysctl kern.random.active_adaptor kern.random.active_adaptor: yarrow # Submitted by: Arthur Mesh <arthurmesh@gmail.com> Submitted by: Dag-Erling Smørgrav <des@FreeBSD.org>, Arthur Mesh <arthurmesh@gmail.com> Reviewed by: des@FreeBSD.org Approved by: re (delphij) Approved by: secteam (des,delphij)
* 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
* ng_ether_ifnet_arrival_event: check interface type before using IFP2NGavg2013-02-041-1/+7
| | | | | | | | | | | The check is copied from vnet_ng_ether_init. Not sure if it covers all the types that we want to support with ng_ether. Reported by: markj Discussed with: zec MFC after: 10 days X-MFC with: r246245
* ng_ether: track interface renamingavg2013-02-021-4/+56
| | | | | | | | | | | Also sanitize interface names that can potentially contain characters that are prohibited in netgraph names. PR: kern/154850 (sanitizing of names) Discussed with: eri, melifaro Submitted by: Nikolay Denev <ndenev@gmail.com> (sanitizing code) Reviewed by: eri, glebius MFC after: 17 days
* Use DEVMETHOD_END, as suggested by hselasky@.rakuco2012-12-261-1/+1
| | | | Approved by: glebius
* Use the correct USB interface macros instead of USB_IF_CSI.rakuco2012-12-261-1/+3
| | | | | | | | | | | | As pointed out by hselasky@, USB_IF_CSI is the wrong macro here since we want to declare the device's interface class, subclass and protocol, not class, subclass and driver info. Follow-up to r244704. PR: kern/174707 Approved by: glebius MFC after: 1 week
* Add vendor IDs for Broadcom USB dongles (BCM20702).glebius2012-12-261-0/+4
| | | | | PR: kern/174707 Submitted by: rakuco
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-0545-112/+112
| | | | | | | | | malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually
* Switch the entire IPv4 stack to keep the IP packet headerglebius2012-10-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | | in network byte order. Any host byte order processing is done in local variables and host byte order values are never[1] written to a packet. After this change a packet processed by the stack isn't modified at all[2] except for TTL. After this change a network stack hacker doesn't need to scratch his head trying to figure out what is the byte order at the given place in the stack. [1] One exception still remains. The raw sockets convert host byte order before pass a packet to an application. Probably this would remain for ages for compatibility. [2] The ip_input() still subtructs header len from ip->ip_len, but this is planned to be fixed soon. Reviewed by: luigi, Maxim Dounin <mdounin mdounin.ru> Tested by: ray, Olivier Cochard-Labbe <olivier cochard.me>
* Mechanically remove the last stray remains of spl* calls from net*/*.andre2012-10-1810-49/+4
| | | | They have been Noop's for a long time now.
* Add NG_NETFLOW_V9INFO_TYPE command to be able to request netflowv9-specificmelifaro2012-10-113-0/+56
| | | | | | | data. Submitted by: Dmitry Luhtionov <dmitryluhtionov at gmail.com> MFC after: 2 weeks
* Revert previous commit...kevlo2012-10-101-1/+1
| | | | Pointyhat to: kevlo (myself)
OpenPOWER on IntegriCloud