summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
* First step of TSO (TCP segmentation offload) support in our network stack.andre2006-09-061-0/+3
| | | | | | | | | | | | o add IFCAP_TSO[46] for drivers to announce this capability for IPv4 and IPv6 o add CSUM_TSO flag to mbuf pkthdr csum_flags field o add tso_segsz field to mbuf pkthdr o enhance ip_output() packet length check to allow for large TSO packets o extend tcp_maxmtu[46]() with a flag pointer to pass interface capabilities o adjust all callers of tcp_maxmtu[46]() accordingly Discussed on: -current, -net Sponsored by: TCP/IP Optimization Fundraise 2005
* Improve description of if_capabilities, if_capenable and ifi_hwassist.andre2006-09-062-4/+21
| | | | Sponsored by: TCP/IP Optimization Fundraise 2005
* Fix the socket option IP_ONESBCAST by giving it its own case in ip_output()andre2006-09-062-0/+28
| | | | | | | | | | | | and skip over the normal IP processing. Add a supporting function ifa_ifwithbroadaddr() to verify and validate the supplied subnet broadcast address. PR: kern/99558 Tested by: Andrey V. Elsukov <bu7cher-at-yandex.ru> Sponsored by: TCP/IP Optimization Fundraise 2005 MFC after: 3 days
* more juniper dlt'ssam2006-09-041-0/+12
| | | | MFC after: 1 month
* Move the bridge hook after the loopback check so that IFF_SIMPLEX is honouredthompsa2006-08-251-8/+8
| | | | | | on member interfaces. This makes us the same as OpenBSD/NetBSD. MFC after: 3 days
* The bridge cant hear its own transmissions so set IFF_SIMPLEX.thompsa2006-08-251-1/+1
| | | | | | PR: kern/102361 Tested by: Radim Kolar <hsn@netmag.cz> MFC after: 3 days
* Fix spelling.thompsa2006-08-251-1/+1
|
* Correct buffer overflow in the handling of LCP options in ppp(4)cperciva2006-08-231-12/+24
| | | | Security: FreeBSD-SA-06:18.ppp
* Remove unneeded asserts from bridge_ioctl_* since these are justthompsa2006-08-171-64/+0
| | | | extensions of bridge_ioctl() which has the correct locking.
* Remove two lock asserts that are unneeded due to subsequent unlocks.thompsa2006-08-171-2/+0
|
* Call bridge_span before dropping the lock.thompsa2006-08-171-2/+2
| | | | MFC after: 5 days
* This XXX remark was rendered false by rev. 103, which made theyar2006-08-151-1/+0
| | | | VLAN_ARRAY case subject to rw locking, too.
* Make it a tad easier to base other encapsulation schemes on this driveryar2006-08-151-5/+4
| | | | | | by restoring the ifv_proto field in the vlan softc and putting it to use this time. It's a good companion for ifv_encaplen, which has already been used throughout this driver.
* Set IFF_DRV_RUNNING on vlan(4) once in vlan_config(),yar2006-08-151-2/+3
| | | | | | not at many places after each call to vlan_config(). This is consistent with IFF_DRV_RUNNING being unset in vlan_unconfig().
* Add the module version to fix the loading with if_bridge.thompsa2006-08-121-0/+1
| | | | | Reported by: keramida Tested by: keramida
* Optionally pad outgoing frames to the minimum of 60 bytes (excl. FCS)yar2006-08-111-0/+33
| | | | | | | | | | before tagging them. This can help to work around brain-damage in some switches that fail to pad a frame after untagging it if its length drops below the minimum. This option is blessed by IEEE Std 802.1Q (2003 Ed.), paragraph C.4.4.3.b. It's controlled by sysctl net.link.vlan.soft_pad. Idea by: az MFC after: 1 week
* Since bpf_allocbufs() uses malloc() with M_WAITOK, don't check returnrwatson2006-08-091-16/+9
| | | | | | | values for NULL or return an error state. Assert that all three bpf buffer pointers are NULL before starting. MFC after: 1 week
* Add kqueue support to if_tun. Loosely based on if_tap changes.rwatson2006-08-081-1/+119
| | | | | | | | | | Two almost identical patches based on the if_tap work were submitted via GNATS; I started out with the patch in 100796 from David Gilbert, but could have easily started with the patch from Vilmos Nebehaj which I found only later. MFC after: 1 week PR: 93976, 100796
* With exception of the if_name() macro, all definitions in net_osdep.hbrooks2006-08-046-344/+1
| | | | | | | | were unused or already in if_var.h so add if_name() to if_var.h and remove net_osdep.h along with all references to it. Longer term we may want to kill off if_name() entierly since all modern BSDs have if_xname variables rendering it unnecessicary.
* Should vlan_input() ever be called with ifp pointing to a non-Ethernetyar2006-08-031-4/+5
| | | | | | | | | | | | | interface, do not just assign -1 to tag because it breaks the logic of the code to follow. The better way is to handle this case as an unsupported protocol and return unless INVARIANTS is in effect and we can panic. Panic is good there because the scenario can happen only because of a coding error elsewhere. We also should show the interface name in the panic message for easier debugging of the problem, should it ever emerge. Submitted by: qingli (initially)
* Back out rev. 1.107 because it introduced as many problemsyar2006-08-031-9/+15
| | | | | | | | | | | | | | as it tried to solve: - it smuggled hidden 802.1q details into otherwise protocol-neutral code; - it put an important code consistency check under DEBUG, which was never defined by anyone but a developer hacking this file for the moment; - lastly, the former bcopy() call had been correct as long as the "dead" code was there. (A new version of the fix for tag of -1 to come in the next commit.) Agreed by: qingli
* - Use the new bridgestp callback to once again flush our bridge routes when anthompsa2006-08-021-2/+38
| | | | | interface is disabled. - Log port changes to syslog, defaulting to off
* Tell bridgestp that we are about to free the memory so it can cleanup.thompsa2006-08-021-0/+3
|
* Fix style in the last commit, the variable declaration goes at the top of thethompsa2006-08-021-1/+2
| | | | function.
* Add a callback so we can notify the parent bridge that a port state change hasthompsa2006-08-022-4/+43
| | | | | occured, we need to do this from a taskqueue to avoid a LOR with the if_bridge mutex.
* Be sure to disable the port when removing it from STP.thompsa2006-08-021-0/+2
|
* In vlan_input(), if the network interface does not perform h/w basedqingli2006-08-011-15/+9
| | | | | | | | | | | | | vlan tag processing, the code will use bcopy() to remove the vlan tag field but the code copies 2 bytes too many, which essentially overwrites the protocol type field. Also, a tag value of -1 is generated for unrecognized interface type, which would cause an invalid memory access in the vlans[] array. In addition, removed a line of dead code and its associated comments. Reviewed by: sam
* Add some statistics that are needed to support RFC4188 as part of the SoC2006thompsa2006-07-314-1/+161
| | | | | | work on a bridge monitoring module for BSNMP. Submitted by: shteryana (SoC 2006)
* Remove the dependency of bridgestp.h on if_bridgevar.h by moving a couple ofthompsa2006-07-274-52/+50
| | | | private structures to if_bridge.c.
* Fixing compilation bustage: net/if_bridgevar.h depends on net/bridgestp.h.avatar2006-07-272-0/+2
|
* bridgestp is now a seperate module.thompsa2006-07-261-0/+1
|
* Remove stp variables that are already initialised in bstp_attach().thompsa2006-07-261-5/+0
|
* /tmp/cvsuusTrcthompsa2006-07-264-723/+953
|
* Remove variables that are overridden by ether_ifattach(). This clears up anythompsa2006-07-261-3/+0
| | | | confusion especially as *if_output was pointed to a different function.
* add support for 802.11 packet injection via bpfsam2006-07-261-0/+31
| | | | | | Together with: Andrea Bittau <a.bittau@cs.ucl.ac.uk> Reviewed by: arch@ MFC after: 1 month
* Rather than calling mircotime() in catchpacket(), make catchpacket()dwmalone2006-07-241-6/+30
| | | | | | | | | | | | | | | | | | | | | | | take a timeval indicating when the packet was captured. Move microtime() to the calling functions and grab the timestamp as soon as we know that we're going to call catchpacket at least once. This means that we call microtime() once per matched packet, as opposed to once per matched packet per bpf listener. It also means that we return the same timestamp to all bpf listeners, rather than slightly different ones. It would be more accurate to call microtime() even earlier for all packets, as you have to grab (1+#listener) locks before you can determine if the packet will be logged. You could always grab a timestamp before the locks, but microtime() can be costly, so this didn't seem like a good idea. (I guess most ethernet interfaces will have a bpf listener these days because of dhclient. That means that we could be doing two bpf locks on most packets going through the interface.) PR: 71711
* Change semantics of socket close and detach. Add a new protocol switchrwatson2006-07-212-1/+19
| | | | | | | | | | | | | | | | | | | function, pru_close, to notify protocols that the file descriptor or other consumer of a socket is closing the socket. pru_abort is now a notification of close also, and no longer detaches. pru_detach is no longer used to notify of close, and will be called during socket tear-down by sofree() when all references to a socket evaporate after an earlier call to abort or close the socket. This means detach is now an unconditional teardown of a socket, whereas previously sockets could persist after detach of the protocol retained a reference. This faciliates sharing mutexes between layers of the network stack as the mutex is required during the checking and removal of references at the head of sofree(). With this change, pru_detach can now assume that the mutex will no longer be required by the socket layer after completion, whereas before this was not necessarily true. Reviewed by: gnn
* Use TAILQ_FOREACH instead of poking around in the guts of the listbrooks2006-07-151-8/+5
| | | | macros.
* Drop a pointless cast of ifp->if_softc to (struct tap_softc *).brooks2006-07-151-1/+1
|
* Catch up with the revised network interface cloning which takes an optionalthompsa2006-07-101-2/+2
| | | | opaque parameter that can specify configuration parameters.
* Revise network interface cloning to take an optional opaquesam2006-07-0912-35/+73
| | | | | | | | | parameter that can specify configuration parameters: o rev cloner api's to add optional parameter block o add SIOCCREATE2 that accepts parameter data o rev vlan support to use new api (maintain old code) Reviewed by: arch@
* Adjust rt_(set|get)metrics() to do kernel <-> userland timebase conversion.oleg2006-07-061-2/+7
| | | | | | We need it since kernel timebase has changed (time_second -> time_uptime). Approved by: glebius (mentor)
* Fix a braino in the last revision, enc_clone_destroy needs return void insteadthompsa2006-07-041-12/+3
| | | | | | | of int. The clone system will ensure that our first interface is not destroyed so we dont need the extra checking anyway. Tested by: Scott Ullrich
* Adjust descriptor locking to tell the kqueue subsystem that our descriptor iscsjp2006-07-031-3/+1
| | | | | | | | | | | | | | already locked. The reason to do this is to avoid two lock+unlock operations in a row. We need the lock here to serialize access to bd_pid for stats collection purposes. Drop the locks all together on detach, as they will be picked up by knlist_remove. This should fix a failed locking assertion when kqueue is being used with bpf descriptors. Discussed with: jmg
* There is a consensus that ifaddr.ifa_addr should never be NULL,yar2006-06-294-29/+20
| | | | | | | | | | except in places dealing with ifaddr creation or destruction; and in such special places incomplete ifaddrs should never be linked to system-wide data structures. Therefore we can eliminate all the superfluous checks for "ifa->ifa_addr != NULL" and get ready to the system crashing honestly instead of masking possible bugs. Suggested by: glebius, jhb, ru
* Use TAILQ_FOREACH in the __FreeBSD__ case, too.yar2006-06-291-2/+1
| | | | Funnily enough, rev. 1.15 changed the __Net and __Open cases only.
* Use TAILQ_FOREACH.yar2006-06-291-4/+1
|
* Use the nifty TAILQ_FOREACH.yar2006-06-291-2/+1
|
* Detach the interface first, do vlan_unconfig() then.yar2006-06-291-9/+3
| | | | | | | | | | | | | | | Previously, another thread could get a pointer to the interface by scanning the system-wide list and sleep on the global vlan mutex held by vlan_unconfig(). The interface was gone by the time the other thread woke up. In order to be able to call vlan_unconfig() on a detached interface, remove the purely cosmetic bzero'ing of IF_LLADDR from the function because a detached interface has no addresses. Noticed by: a stress-testing script by maxim Reviewed by: glebius
* Remove a few unused things.yar2006-06-291-12/+8
| | | | Fix some style and consistency points.
OpenPOWER on IntegriCloud