summaryrefslogtreecommitdiffstats
path: root/sys/netinet/raw_ip.c
Commit message (Collapse)AuthorAgeFilesLines
* Improved connection establishment performance by doing local port lookups viadg1998-01-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a hashed port list. In the new scheme, in_pcblookup() goes away and is replaced by a new routine, in_pcblookup_local() for doing the local port check. Note that this implementation is space inefficient in that the PCB struct is now too large to fit into 128 bytes. I might deal with this in the future by using the new zone allocator, but I wanted these changes to be extensively tested in their current form first. Also: 1) Fixed off-by-one errors in the port lookup loops in in_pcbbind(). 2) Got rid of some unneeded rehashing. Adding a new routine, in_pcbinshash() to do the initialial hash insertion. 3) Renamed in_pcblookuphash() to in_pcblookup_hash() for easier readability. 4) Added a new routine, in_pcbremlists() to remove the PCB from the various hash lists. 5) Added/deleted comments where appropriate. 6) Removed unnecessary splnet() locking. In general, the PCB functions should be called at splnet()...there are unfortunately a few exceptions, however. 7) Reorganized a few structs for better cache line behavior. 8) Killed my TCP_ACK_HACK kludge. It may come back in a different form in the future, however. These changes have been tested on wcarchive for more than a month. In tests done here, connection establishment overhead is reduced by more than 50 times, thus getting rid of one of the major networking scalability problems. Still to do: make tcp_fastimo/tcp_slowtimo scale well for systems with a large number of connections. tcp_fastimo is easy; tcp_slowtimo is difficult. WARNING: Anything that knows about inpcb and tcpcb structs will have to be recompiled; at the very least, this includes netstat(1).
* Call in_pcballoc() at splnet(). As near as I can tell, this won't fixdg1997-12-181-4/+9
| | | | | any instability problems, but it was wrong nonetheless and will be required in an upcoming round of PCB changes.
* Update network code to use poll support.peter1997-09-141-2/+2
|
* Fix all areas of the system (or at least all those in LINT) to avoid storingwollman1997-08-161-9/+9
| | | | | | | | socket addresses in mbufs. (Socket buffers are the one exception.) A number of kernel APIs needed to get fixed in order to make this happen. Also, fix three protocol families which kept PCBs in mbufs to not malloc them instead. Delete some old compatibility cruft while we're at it, and add some new routines in the in_cksum family.
* Removed unused #includes.bde1997-08-021-3/+1
|
* Disallow writing raw IP packets shorter than the IP header.fenner1997-05-221-2/+3
|
* The long-awaited mega-massive-network-code- cleanup. Part I.wollman1997-04-271-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | This commit includes the following changes: 1) Old-style (pr_usrreq()) protocols are no longer supported, the compatibility glue for them is deleted, and the kernel will panic on boot if any are compiled in. 2) Certain protocol entry points are modified to take a process structure, so they they can easily tell whether or not it is possible to sleep, and also to access credentials. 3) SS_PRIV is no more, and with it goes the SO_PRIVSTATE setsockopt() call. Protocols should use the process pointer they are now passed. 4) The PF_LOCAL and PF_ROUTE families have been updated to use the new style, as has the `raw' skeleton family. 5) PF_LOCAL sockets now obey the process's umask when creating a socket in the filesystem. As a result, LINT is now broken. I'm hoping that some enterprising hacker with a bit more time will either make the broken bits work (should be easy for netipx) or dike them out.
* Reorganize elements of the inpcb struct to take better advantage ofdg1997-04-031-4/+4
| | | | | | | | cache lines. Removed the struct ip proto since only a couple of chars were actually being used in it. Changed the order of compares in the PCB hash lookup to take advantage of partial cache line fills (on PPro). Discussed-with: wollman
* Improved performance of hash algorithm while (hopefully) not reducingdg1997-03-031-2/+2
| | | | | | | | the quality of the hash distribution. This does not fix a problem dealing with poor distribution when using lots of IP aliases and listening on the same port on every one of them...some other day perhaps; fixing that requires significant code changes. The use of xor was inspired by David S. Miller <davem@jenolan.rutgers.edu>
* Convert raw IP from mondo-switch-statement-from-Hell towollman1997-02-181-155/+127
| | | | | | | | | pr_usrreqs. Collapse duplicates with udp_usrreq.c and tcp_usrreq.c (calling the generic routines in uipc_socket2.c and in_pcb.c). Calling sockaddr()_ or peeraddr() on a detached socket now traps, rather than harmlessly returning an error; this should never happen. Allow the raw IP buffer sizes to be controlled via sysctl.
* Provide PRC_IFDOWN and PRC_IFUP support for IP. Now, when an interfacewollman1997-02-131-1/+63
| | | | | | | | is administratively downed, all routes to that interface (including the interface route itself) which are not static will be deleted. When it comes back up, and addresses remaining will have their interface routes re-added. This solves the problem where, for example, an Ethernet interface is downed by traffic continues to flow by way of ARP entries.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Use queue macros for the list of interfaces. Next stop: ifaddrs!wollman1996-12-111-3/+3
|
* Add the IP_RECVIF socket option, which supplies a packet's incoming interfacefenner1996-11-111-11/+23
| | | | | | | | using a sockaddr_dl. Fix the other packet-information socket options (SO_TIMESTAMP, IP_RECVDSTADDR) to work for multicast UDP and raw sockets as well. (They previously only worked for unicast UDP).
* Don't allow reassembly to create packets bigger than IP_MAXPACKET, and countfenner1996-10-251-1/+9
| | | | | | | | | attempts to do so. Don't allow users to source packets bigger than IP_MAXPACKET. Make UDP length and ipovly's protocol length unsigned short. Reviewed by: wollman Submitted by: (partly by) kml@nas.nasa.gov (Kevin Lahey)
* All three files: make COMPAT_IPFW==0 case work again.wollman1996-10-071-2/+2
| | | | | | | ip_input.c: - delete some dusty code - _IP_VHL - use fast inline header checksum when possible
* Oops, send the operation type, not the name to the NAT code...sos1996-08-271-2/+2
|
* Add hooks for an IP NAT module, much like the firewall stuff...sos1996-08-211-4/+11
| | | | | Move the sockopt definitions for the firewall code from ip_fw.h to in.h where it belongs.
* Eliminate some more references to separate ip_v and ip_hl fields.wollman1996-07-241-3/+5
|
* Removed extraneous return.alex1996-07-201-2/+1
|
* Conditionalize calls to IPFW code on COMPAT_IPFW. This is done slightlywollman1996-05-221-1/+10
| | | | | | | | | | | | | | unconventionally: If COMPAT_IPFW is not defined, or if it is defined to 1, enable; otherwise, disable. This means that these changes actually have no effect on anyone at the moment. (It just makes it easier for me to keep my code in sync.) In the future, the `not defined' part of the hack should be eliminated, but doing this now would require everyone to change their config files. The same conditionals need to be made in ip_input.c as well for this to ave any useful effect, but I'm not ready to do that right now.
* Make rip_input() take the header lengthfenner1996-03-261-3/+3
| | | | | | Move ipip_input() and rsvp_input() prototypes to ip_var.h Remove unused prototype for rip_ip_input() from ip_var.h Remove unused variable *opts from rip_output()
* Fix ip option processing for raw IP sockets. This whole thing is a compromisepst1996-03-131-4/+10
| | | | | | | | | | | between ignoring options specified in the setsockopt call if IP_HDRINCL is set (the UCB choice when VJ's code was brought in) vs allowing them (what everyone else did, and what is assumed by programs everywhere...sigh). Also perform some checking of the passed down packet to avoid running off the end of a mbuf chain. Reviewed by: fenner
* Move or add #include <queue.h> in preparation for upcoming struct socketdg1996-03-111-2/+2
| | | | changes.
* Make getsockopt() capable of handling more than one mbuf worth of data.phk1996-02-241-11/+10
| | | | | Use this to read rules out of ipfw. Add the lkm code to ipfw.c
* Big sweep over the IPFIREWALL and IPACCT code.phk1996-02-231-22/+2
| | | | | | | | | | | | | | Close the ip-fragment hole. Waste less memory. Rewrite to contemporary more readable style. Kill separate IPACCT facility, use "accept" rules in IPFIREWALL. Filter incoming >and< outgoing packets. Replace "policy" by sticky "deny all" rule. Rules have numbers used for ordering and deletion. Remove "rerorder" code entirely. Count packet & bytecount matches for rules. Code in -current & -stable is now the same.
* Staticize.phk1995-12-091-4/+4
|
* New style sysctl & staticize alot of stuff.phk1995-11-141-3/+3
|
* Fix panic caused by PRU_CONTROL not being dealt with properly. Bug pointeddg1995-10-211-2/+8
| | | | out by David Maltz <dmaltz@orval.mach.cs.cmu.edu>, but this fix is by me.
* Merge with 4.4-Lite-2: fix bug that caused getsockopt of IP_HDRINCLwollman1995-09-211-15/+15
| | | | | | to fail. Obtained from: 4.4BSD-Lite-2
* Completely turn off RSVP intercept when a socket being used for that purposewollman1995-07-241-1/+2
| | | | | is PRU_DETACHed. This solves the problem that RSVP would not come up inm raw mode if previously killed.
* Kernel side of 3.5 multicast routing code, based on work by Bill Fennerwollman1995-06-131-31/+20
| | | | | and other work done here. The LKM support is probably broken, but it still compiles and will be fixed later.
* Remove trailing whitespace.rgrimes1995-05-301-4/+4
|
* Fix getsockopt(IP_ACCT_*) to not panic kernelache1995-05-121-3/+2
| | | | Submitted by: Bill Fenner <fenner@parc.xerox.com>
* Implemented PCB hashing. Includes new functions in_pcbinshash, in_pcbrehash,dg1995-04-091-6/+14
| | | | and in_pcblookuphash.
* This set of patches enables IP multicasting to work under FreeBSD. I amwollman1995-03-161-3/+24
| | | | | | | | | | | | | | | | | | | | submitting them as context diffs for the following files: sys/netinet/ip_mroute.c sys/netinet/ip_var.h sys/netinet/raw_ip.c usr.sbin/mrouted/igmp.c usr.sbin/mrouted/prune.c The routine rip_ip_input in raw_ip.c is suggested by Mark Tinguely (tinguely@plains.nodak.edu). I have been running mrouted with these patches for over a week and nothing has seemed seriously wrong. It is being run in two places on our network as a tunnel on one and a subnet querier on the other. The only problem I have run into is that mrouted on the tunnel must start up last or the pruning isn't done correctly and multicast packets flood your subnets. Submitted by: Soochon Radee <slr@mitre.org>
* YFfix.phk1995-02-141-2/+3
|
* Make sure to disable RSVP intercept when the socket is closed.wollman1995-02-071-1/+3
|
* Correct long-standing error in the RSVP hooks (would initialize but neverwollman1995-01-261-3/+3
| | | | return success).
* Actual firewall change.ugen1995-01-121-16/+16
| | | | | | | 1) Firewall is not subdivided on forwarding / blocking chains anymore.Actually only one chain left-it was the blocking one. 2) LKM support.ip_fwdef.c is function pointers definition and goes into kernel along with all INET stuff.
* Fixed mbuf lossage when level != IPPROTO_IP. Problem reported by Robertdg1995-01-121-2/+5
| | | | Dobbs, hint from Charles Hannum, fix by me.
* Add clear one accounting entry control.ugen1994-12-131-1/+2
| | | | Structure fields changed to seem more standart.
* Add match by interface from which packet arrived (via)ugen1994-12-121-3/+1
| | | | | Handle right fragmented packets. Remove checking option from kernel..
* Ugen J.S.Antsilevich's latest, happiest, IP firewall code.jkh1994-11-161-1/+18
| | | | | Poul: Please take this into BETA. It's non-intrusive, and a rather substantial improvement over what was there before.
* 2 11th-hour fixes from Ugen (not Uben, sorry!) J.S.Antsilevich.jkh1994-11-071-3/+6
| | | | | | | I think it's time for Ugen to get a freefall account, just so I can direct mail at him directly and let him drop off patches for us here. Ugen? Done! Submitted by: ugen
* IP Firewall code from Daniel Boulet and J.S.Antsilevichjkh1994-10-281-1/+23
| | | | Submitted by: danny ugen
* GCC cleanup.phk1994-10-021-6/+7
| | | | | | Reviewed by: Submitted by: Obtained from:
* Shuffle some functions and variables around to make it possible forwollman1994-09-141-9/+1
| | | | | multicast routing to be implemented as an LKM. (There's still a bit of work to do in this area.)
* Initial get-the-easy-case-working upgrade of the multicast codewollman1994-09-061-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to something more recent than the ancient 1.2 release contained in 4.4. This code has the following advantages as compared to previous versions (culled from the README file for the SunOS release): - True multicast delivery - Configurable rate-limiting of forwarded multicast traffic on each physical interface or tunnel, using a token-bucket limiter. - Simplistic classification of packets for prioritized dropping. - Administrative scoping of multicast address ranges. - Faster detection of hosts leaving groups. - Support for multicast traceroute (code not yet available). - Support for RSVP, the Resource Reservation Protocol. What still needs to be done: - The multicast forwarder needs testing. - The multicast routing daemon needs to be ported. - Network interface drivers need to have the `#ifdef MULTICAST' goop ripped out of them. - The IGMP code should probably be bogon-tested. Some notes about the porting process: In some cases, the Berkeley people decided to incorporate functionality from later releases of the multicast code, but then had to do things differently. As a result, if you look at Deering's patches, and then look at our code, it is not always obvious whether the patch even applies. Let the reader beware. I ran ip_mroute.c through several passes of `unifdef' to get rid of useless grot, and to permanently enable the RSVP support, which we will include as standard. Ported by: Garrett Wollman Submitted by: Steve Deering and Ajit Thyagarajan (among others)
* Added $Id$dg1994-08-021-0/+1
|
OpenPOWER on IntegriCloud