summaryrefslogtreecommitdiffstats
path: root/sys/netinet
Commit message (Collapse)AuthorAgeFilesLines
* initialize local variable explicitlysuz2002-04-111-0/+2
| | | | | | Reviewed by: ume Obtained from: Fujitsu guys MFC after: 1 week
* Remove some ISN generation code which has been unused since thesilby2002-04-104-58/+6
| | | | | | syncache went in. MFC after: 3 days
* Totally nuke IPPORT_USERRESERVED, it is no longer used anywhere, updatesilby2002-04-101-4/+2
| | | | | | | remaining comments to reflect new ephemeral port range. Reminded by: Maxim Konovalov <maxim@macomnet.ru> MFC after: 3 days
* Unconditionalize the definition of INET_ADDRSTRLEN andmike2002-04-101-2/+0
| | | | | INET6_ADDRSTRLEN. Doing this helps expose bogus redefinitions in 3rd party software.
* Remove the code that masks an EEXIST returned from rtinit() whenbrian2002-04-101-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | calling ioctl(SIOC[AS]IFADDR). This allows the following: ifconfig xx0 inet 1.2.3.1 netmask 0xffffff00 ifconfig xx0 inet 1.2.3.17 netmask 0xfffffff0 alias ifconfig xx0 inet 1.2.3.25 netmask 0xfffffff8 alias ifconfig xx0 inet 1.2.3.26 netmask 0xffffffff alias but would (given the above) reject this: ifconfig xx0 inet 1.2.3.27 netmask 0xfffffff8 alias due to the conflicting netmasks. I would assert that it's wrong to mask the EEXIST returned from rtinit() as in the above scenario, the deletion of the 1.2.3.25 address will leave the 1.2.3.27 address as unroutable as it was in the first place. Offered for review on: -arch, -net Discussed with: stephen macmanus <stephenm@bayarea.net> MFC after: 3 weeks
* Don't add host routes for interface addresses of 0.0.0.0/8 -> 0.255.255.255.brian2002-04-101-6/+18
| | | | | | | | | | This change allows bootp to work with more than one interface, at the expense of some rather ``wrong'' looking code. I plan to MFC this in place of luigi's recent #ifdef BOOTP stuff that was committed to this file in -stable, as that's slightly more wrong that this is. Offered for review on: -arch, -net MFC after: 2 weeks
* Change the first argument of prison_xinpcb() to be a thread pointer insteadjhb2002-04-093-6/+5
| | | | of a proc pointer so that prison_xinpcb() can use td_ucred.
* Update comments to reflect the recent ephemeral port rangesilby2002-04-091-3/+4
| | | | | | | change. Noticed by: ru MFC After: 1 day
* Retire this copy; it now lives in sys/net/fddi.h.mdodd2002-04-051-87/+0
|
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-042-2/+2
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-018-15/+14
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* o Implement <sys/_types.h>, a new header for storing types that aremike2002-04-011-10/+27
| | | | | | | | | | | | | | | MI, not required to be a fixed size, and used in multiple headers. This will grow in time, as more things move here from <sys/types.h> and <machine/ansi.h>. o Add missing type definitions (uint16_t and uint32_t) to <arpa/inet.h> and <netinet/in.h>. o Reduce pollution in <sys/types.h> by using `#if _FOO_T_DECLARED' widgets to avoid including <sys/stdint.h>. o Add some missing type definitions to <unistd.h> and note the ones that still need to be added. o Make use of <sys/_types.h> primitives in <grp.h> and <sys/types.h>. Reviewed by: bde
* Fixed some style bugs in the removal of __P(()). Continuation linesbde2002-03-248-15/+14
| | | | | were not outdented to preserve non-KNF lining up of code with parentheses. Switch to KNF formatting.
* Merge from TrustedBSD MAC branch:rwatson2002-03-224-13/+13
| | | | | | | | | | | | | | Move the network code from using cr_cansee() to check whether a socket is visible to a requesting credential to using a new function, cr_canseesocket(), which accepts a subject credential and object socket. Implement cr_canseesocket() so that it does a prison check, a uid check, and add a comment where shortly a MAC hook will go. This will allow MAC policies to seperately instrument the visibility of sockets from the visibility of processes. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Prevent icmp_reflect() from calling ip_output() with a NULL routeru2002-03-223-9/+8
| | | | | | | | | | | | | | pointer which will then result in the allocated route's reference count never being decremented. Just flood ping the localhost and watch refcnt of the 127.0.0.1 route with netstat(1). Submitted by: jayanth Back out ip_output.c,v 1.143 and ip_mroute.c,v 1.69 that allowed ip_output() to be called with a NULL route pointer. The previous paragraph shows why this was a bad idea in the first place. MFC after: 0 days
* Change the ephemeral port range from 1024-5000 to 49152-65535.silby2002-03-221-2/+2
| | | | | | | | | This increases the number of concurrent outgoing connections from ~4000 to ~16000. Other OSes (Solaris, OS X, NetBSD) and many other NAT products have already made this change without ill effects, so we should not run into any problems. MFC after: 1 week
* Send periodic ARP requests when ARP entries for hosts we are sendingorion2002-03-201-0/+15
| | | | | | | | | | to are about to expire. This prevents high packet rate flows from experiencing packet drops at the sender following ARP cache entry timeout. PR: kern/25517 Reviewed by: luigi MFC after: 7 days
* Switch vm_zone.h with uma.h. Change over to uma interfaces.jeff2002-03-208-35/+35
|
* Remove __P.alfred2002-03-1938-261/+260
|
* This is the first part of the new kernel memory allocator. This replacesjeff2002-03-192-2/+3
| | | | | | malloc(9) and vm_zone with a slab like allocator. Reviewed by: arch@
* NAI DBA updaterwatson2002-03-141-1/+1
|
* o Add INET_ADDRSTRLEN and INET6_ADDRSTRLEN defines to <arpa/inet.h>mike2002-03-101-0/+2
| | | | | | | for POSIX.1-2001 conformance. o Add magic to <netinet/in.h> and <netinet6/in6.h> to prevent redefining INET_ADDRSTRLEN and INET6_ADDRSTRLEN. o Add a note about missing typedefs in <arpa/inet.h>.
* o Don't require long long support in bswap64() functions.mike2002-03-091-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | o In i386's <machine/endian.h>, macros have some advantages over inlines, so change some inlines to macros. o In i386's <machine/endian.h>, ungarbage collect word_swap_int() (previously __uint16_swap_uint32), it has some uses on i386's with PDP endianness. Submitted by: bde o Move a comment up in <machine/endian.h> that was accidentially moved down a few revisions ago. o Reenable userland's use of optimized inline-asm versions of byteorder(3) functions. o Fix ordering of prototypes vs. redefinition of byteorder(3) functions, so that the non-GCC (libc asm) case has proper prototypes. o Add proper prototypes for byteorder(3) functions in <sys/param.h>. o Prevent redundant duplicate prototypes by making use of the _BYTEORDER_PROTOTYPED define. o Move the bswap16(), bswap32(), bswap64() C functions into MD space for platforms in which asm versions don't exist. This significantly reduces the complexity of some things at the cost of duplicate code. Reviewed by: bde
* - Set inc_isipv6 in tcp6_usr_connect().ume2002-02-282-0/+2
| | | | | | | - When making a pcb from a sync cache, do not forget to copy inc_isipv6. Obtained from: KAME MFC After: 1 week
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-278-22/+22
| | | | reference.
* Change the wording of the inline comments from the previous commit.cjc2002-02-272-16/+6
| | | | Objection from: ru
* More IPV6 const fixes.alfred2002-02-272-2/+2
|
* Introduce a version field to `struct xucred' in place of one of thedd2002-02-273-25/+5
| | | | | | | | | | | | spares (the size of the field was changed from u_short to u_int to reflect what it really ends up being). Accordingly, change users of xucred to set and check this field as appropriate. In the kernel, this is being done inside the new cru2x() routine which takes a `struct ucred' and fills out a `struct xucred' according to the former. This also has the pleasant sideaffect of removing some duplicate code. Reviewed by: rwatson
* Staticize an extern that no one else used.brooks2002-02-262-3/+1
|
* Enforce inbound IPsec SPDjedgar2002-02-261-1/+11
| | | | Reviewed by: fenner
* Document what inpcb->inp_vflag is for.alfred2002-02-251-1/+1
| | | | Submitted by: Marco Molteni <molter@tin.it>
* The TCP code did not do sufficient checks on whether incoming packetscjc2002-02-252-14/+26
| | | | | | | | | | | | | were destined for a broadcast IP address. All TCP packets with a broadcast destination must be ignored. The system only ignored packets that were _link-layer_ broadcasts or multicast. We need to check the IP address too since it is quite possible for a broadcast IP address to come in with a unicast link-layer address. Note that the check existed prior to CSRG revision 7.35, but was removed. This commit effectively backs out that nine-year-old change. PR: misc/35022
* BUGFIX: make use of the pointer to the target of skipto rules,luigi2002-02-201-2/+4
| | | | | | | | | so that after the first time we can follow the pointer instead of having to scan the list. This was the intended behaviour from day one. PR: 34639 MFC-after: 3 days
* When expanding a syncache entry into a socket, inherit the socket optionsjlemon2002-02-201-1/+1
| | | | | from the current listen socket instead of the cached (and possibly stale) TCB pointer.
* o Move NTOHL() and associated macros into <sys/param.h>. These aremike2002-02-189-53/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | deprecated in favor of the POSIX-defined lowercase variants. o Change all occurrences of NTOHL() and associated marcros in the source tree to use the lowercase function variants. o Add missing license bits to sparc64's <machine/endian.h>. Approved by: jake o Clean up <machine/endian.h> files. o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>. o Remove prototypes for non-existent bswapXX() functions. o Include <machine/endian.h> in <arpa/inet.h> to define the POSIX-required ntohl() family of functions. o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>, and <sys/param.h>. o Prepend underscores to the ntohl() family to help deal with complexities associated with having MD (asm and inline) versions, and having to prevent exposure of these functions in other headers that happen to make use of endian-specific defines. o Create weak aliases to the canonical function name to help deal with third-party software forgetting to include an appropriate header. o Remove some now unneeded pollution from <sys/types.h>. o Add missing <arpa/inet.h> includes in userland. Tested on: alpha, i386 Reviewed by: bde, jake, tmm
* Moved the 127/8 check below so that IPF redirects have a chance of working.ru2002-02-151-10/+10
| | | | MFC after: 1 day
* When a duplicate SYN arrives which matches an entry in the syncache,jlemon2002-02-121-0/+5
| | | | | | update our lazy reference to the inpcb structure, as it may have changed. Found by: dima
* Silence unused variable warning in the !KLD_MODULE case.dd2002-02-101-0/+2
| | | | Submitted by: archie
* Pre-KSE/M3 commit.julian2002-02-071-2/+2
| | | | | | | | | | this is a low-functionality change that changes the kernel to access the main thread of a process via the linked list of threads rather than assuming that it is embedded in the process. It IS still embeded there but remove all teh code that assumes that in preparation for the next commit which will actually move it out. Reviewed by: peter@freebsd.org, gallatin@cs.duke.edu, benno rice,
* In tcp_respond(), correctly reset returned IPv6 header. This is essentialume2002-02-042-0/+6
| | | | | | | when the original packet contains an IPv6 extension header. Obtained from: KAME MFC after: 1 week
* WARNS=n and lint(1) silencer. Declare an array of (const) stringsmarkm2002-02-031-1/+1
| | | | as const char.
* The ipfw(8) 'tee' action simply hasn't worked on incoming packets forcjc2002-01-261-0/+3
| | | | | | | | | | | | some time. _All_ packets, regardless of destination, were accepted by the machine as if addressed to it. Jump back to 'pass' processing for a teed packet instead of falling through as if it was ours. PR: kern/31130 Reviewed by: -net, luigi MFC after: 2 weeks
* The ENDPTS_EQ macro was comparing the one of the fports to itself. Fix.jlemon2002-01-221-1/+1
| | | | Submitted by: emy@boostworks.com
* - Check the address family of the destination cached in a PCB.ume2002-01-212-4/+12
| | | | | | | | - Clear the cached destination before getting another cached route. Otherwise, garbage in the padding space (which might be filled in if it was used for IPv4) could annoy rtalloc. Obtained from: KAME
* RFC1122 requires that addresses of the form { 127, <any> } MUST NOTru2002-01-211-1/+11
| | | | | | | | appear outside a host. PR: 30792, 33996 Obtained from: ip_input.c MFC after: 1 week
* Fix a panic condition in icmp_reflect() introduced in rev. 1.61.ru2002-01-111-2/+2
| | | | | | | | | | (We should be able to handle locally originated IP packets, and these do not have m_pkthdr.rcvif set.) PR: kern/32806, kern/33766 Reviewed by: luigi Fix tested by: Maxim Konovalov <maxim@macomnet.ru>, Erwin Lansing <erwin@lansing.dk>
* Initialise the intrq_present fields at runtime, not link time. This allowsmsmith2002-01-081-1/+1
| | | | | | us to load protocols at runtime, and avoids the use of common variables. Also fix the ip6_intrq assignment so that it works at all.
* Fix a missing "ipfw:" in a syslog message.cjc2002-01-071-1/+1
| | | | MFC after: 1 day
* Pre-calculate the checksum for multicast packets sourced on afenner2002-01-051-0/+12
| | | | | | multicast router. This is overkill; it should be possible to delay to hardware interfaces and only pre-calculate when forwarding to a tunnel.
* o Spelling fix in comment: tcp_ouput -> tcp_outputrwatson2002-01-042-2/+2
|
OpenPOWER on IntegriCloud