summaryrefslogtreecommitdiffstats
path: root/sys/netinet
Commit message (Collapse)AuthorAgeFilesLines
* initialize a couple of variables, gcc 4.2.4-4 (linux) reportsluigi2009-01-281-1/+2
| | | | some possible uninitialized uses and the warning does make sense.
* For some reason (probably dating ages ago) an #ifdef SYSCTL_NODE / #endifluigi2009-01-281-2/+5
| | | | | | | | | | section included a lot of stuff that did not belong there. So split the block in multiple components each around the relevant stuff. This said, I wonder if building a kernel where SYSCTL_NODE is not defined is supported at all. Submitted by: Marta Carbone
* For consistency with prison_{local,remote,check}_ipN renamebz2009-01-252-5/+5
| | | | | | | prison_getipN to prison_get_ipN. Submitted by: jamie (as part of a larger patch) MFC after: 1 week
* Add externs to fix build with VIMAGE_GLOBALS after r187289.bz2009-01-221-0/+2
|
* remove too noisy DIAGNOSTIC codesam2009-01-181-3/+0
| | | | Reviewed by: qingli
* Silent userland warnings about missing prototypes.piso2009-01-153-0/+3
| | | | Submitted by: Roman Divacky <rdivacky@freebsd.org>
* Add TCP Appropriate Byte Counting (RFC 3465) support to kernel.lstewart2009-01-155-10/+68
| | | | | | | | | | | | | The new behaviour is on by default, and can be disabled by setting the net.inet.tcp.rfc3465 sysctl to 0 to obtain previous behaviour. The patch changes struct tcpcb in sys/netinet/tcp_var.h which breaks the ABI. Bump __FreeBSD_version to 800061 accordingly. User space tools that rely on the size of struct tcpcb (e.g. sockstat) need to be recompiled. Reviewed by: rpaulo, gnn Approved by: gnn, kmacy (mentors) Sponsored by: FreeBSD Foundation
* Since we allow conditional allocation of labels on syncache entries,rwatson2009-01-111-2/+0
| | | | remove historic assertion that labels are always present.
* Restrict arp, ndp and theoretically the FIB listing (if notbz2009-01-091-0/+4
| | | | | | | | | | | | | | | | | read with libkvm) to the addresses of a prison, when inside a jail. [1] As the patch from the PR was pre-'new-arp', add checks to the llt_dump handlers as well. While touching RTM_GET in route_output(), consistently use curthread credentials rather than the creds from the socket there. [2] PR: kern/68189 Submitted by: Mark Delany <sxcg2-fuwxj@qmda.emu.st> [1] Discussed with: rwatson [2] Reviewed by: rwatson MFC after: 4 weeks
* Fix fat-fingered comment.adrian2009-01-091-1/+1
| | | | Noticed-by: julian
* Fix indentation; add FALLTHROUGH.adrian2009-01-091-3/+4
| | | | Thanks Max!
* Better comment what the socket option does. Thanks to Sam Leffleradrian2009-01-091-1/+2
| | | | for suggesting this.
* Comment some potentially confusing logic.adrian2009-01-091-0/+5
| | | | | | Nitpicking by: mlaier MFC after: 2 weeks
* Implement a new IP option (not compiled/enabled by default) to allowadrian2009-01-094-1/+28
| | | | | | | | | | | | | | | | | | | | | | applications to specify a non-local IP address when bind()'ing a socket to a local endpoint. This allows applications to spoof the client IP address of connections if (obviously!) they somehow are able to receive the traffic normally destined to said clients. This patch doesn't include any changes to ipfw or the bridging code to redirect the client traffic through the PCB checks so TCP gets a shot at it. The normal behaviour is that packets with a non-local destination IP address are not handled locally. This can be dealth with some IPFW hackery; modifications to IPFW to make this less hacky will occur in subsequent commmits. Thanks to Julian Elischer and others at Ironport. This work was approved and donated before Cisco acquired them. Obtained from: Julian Elischer and others MFC after: 2 weeks
* Make SIOCGIFADDR and related, as well as SIOCGIFADDR_IN6 and relatedbz2009-01-091-1/+9
| | | | | | | | | | | | | | | | jail-aware. Up to now we returned the first address of the interface for SIOCGIFADDR w/o an ifr_addr in the query. This caused problems for programs querying for an address but running inside a jail, as the address returned usually did not belong to the jail. Like for v6, if there was an ifr_addr given on v4, you could probe for more addresses on the interfaces that you were not allowed to see from inside a jail. Return an error (EADDRNOTAVAIL) in that case now unless the address is on the given interface and valid for the jail. PR: kern/114325 Reviewed by: rwatson MFC after: 4 weeks
* Set a minimum of information in the routing message (like version and type)harti2009-01-091-0/+4
| | | | | so that generic routing message parsing code can parse the messages for L2 info that are retrieved via the sysctl interface.
* Addresses Roberts comments on comments. Also addsrrs2009-01-061-11/+9
| | | | | | | the KASSERT and checks suggested. Reviewed by: The udp tunneling was discussed on net@ under the thread entitled "Heads up -- Thinking about UDP and tunneling"
* Add the ability of an alternate transport protocolrrs2009-01-062-8/+89
| | | | | | to easily tunnel over udp by providing a hook function that will be called instead of appending to the socket buffer.
* Allow the IP_MINTTL socket option to be set to 0 so that it can berwatson2009-01-031-1/+1
| | | | | | | | | disabled entirely, which is its default state before set to a non-zero value. PR: 128790 Submitted by: Nick Hilliard <nick at foobar dot org> MFC after: 3 weeks
* Some modules such as SCTP supplies a valid route entry as an input argumentqingli2009-01-031-1/+2
| | | | | | | | | | | | | | | to ip_output(). The destionation is represented in a sockaddr{} object that may contain other pieces of information, e.g., port number. This same destination sockaddr{} object may be passed into L2 code, which could be used to create a L2 entry. Since there exists a L2 table per address family, the L2 lookup function can make address family specific comparison instead of the generic bcmp() operation over the entire sockaddr{} structure. Note in the IPv6 case the sin6_scope_id is not compared because the address is currently stored in the embedded form inside the kernel. The in6_lltable_lookup() has to account for the scope-id if this storage format were to change in the future.
* For consistency use LLE_IS_VALID() in this 4th place that is actuallybz2008-12-281-1/+1
| | | | | interested in the (void *)-1 return value hack. This way we can easily identify those special parts of the code.
* This checkin addresses a couple of issues:qingli2008-12-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. The "route" command allows route insertion through the interface-direct option "-iface". During if_attach(), an sockaddr_dl{} entry is created for the interface and is part of the interface address list. This sockaddr_dl{} entry describes the interface in detail. The "route" command selects this entry as the "gateway" object when the "-iface" option is present. The "arp" and "ndp" commands also interact with the kernel through the routing socket when adding and removing static L2 entries. The static L2 information is also provided through the "gateway" object with an AF_LINK family type, similar to what is provided by the "route" command. In order to differentiate between these two types of operations, a RTF_LLDATA flag is introduced. This flag is set by the "arp" and "ndp" commands when issuing the add and delete commands. This flag is also set in each L2 entry returned by the kernel. The "arp" and "ndp" command follows a convention where a RTM_GET is issued first followed by a RTM_ADD/DELETE. This RTM_GET request fills in the fields for a "rtm" object, which is reinjected into the kernel by a subsequent RTM_ADD/DELETE command. The entry returend from RTM_GET is a prefix route, so the RTF_LLDATA flag must be specified when issuing the RTM_ADD/DELETE messages. 2. Enforce the convention that NET_RT_FLAGS with a 0 w_arg is the specification for retrieving L2 information. Also optimized the code logic. Reviewed by: julian
* Fix missed unlock and reference drop of llekmacy2008-12-241-6/+6
| | | | Found by: pho
* Remove long unused netinet/ipprotosw.h (basically since r82884).bz2008-12-231-98/+0
| | | | | Discussed with: rwatson MFC after: 4 weeks
* Don't create a bogus ARP entry for 0.0.0.0.qingli2008-12-231-15/+16
|
* The proxy-arp code was broken and responds to ARPqingli2008-12-191-57/+52
| | | | requests for addresses that are not proxied locally.
* Another step assimilating IPv[46] PCB code:bz2008-12-171-1/+1
| | | | | | | | | normalize IN6P_* compat flags usage to their equialent INP_* counterpart. Discussed with: rwatson Reviewed by: rwatson MFC after: 4 weeks
* Use inc_flags instead of the inc_isipv6 alias which so farbz2008-12-178-33/+35
| | | | | | | | | | | | | | had been the only flag with random usage patterns. Switch inc_flags to be used as a real bit field by using INC_ISIPV6 with bitops to check for the 'isipv6' condition. While here fix a place or two where in case of v4 inc_flags were not properly initialized before.[1] Found by: rwatson during review [1] Discussed with: rwatson Reviewed by: rwatson MFC after: 4 weeks
* default to doing lla_lookup with shared afdata lock and returning akmacy2008-12-171-9/+10
| | | | | shared lock on the lle - thus restoring parallel performance to pre-arpv2 level
* IPFW's pfil hook/unhook code ignores the return values of pfil_add_hook()rwatson2008-12-161-8/+16
| | | | | | and pfil_remove_hook(), so cast them to (void). MFC after: pretty soon
* ipfw doesn't use the radix node head lock to protect the radix tree - remove ↵kmacy2008-12-161-2/+0
| | | | acquisition
* check pointer against NULLkmacy2008-12-161-2/+3
| | | | add new line after declaration for style
* don't unlock lle if it is NULLkmacy2008-12-161-1/+2
|
* unlock and destroy an llentry's lock before freeingkmacy2008-12-161-0/+2
| | | | Found by: sam
* Another step assimilating IPv[46] PCB code - directly usebz2008-12-153-8/+8
| | | | | | | | | | | | | | the inpcb names rather than the following IPv6 compat macros: in6pcb,in6p_sp, in6p_ip6_nxt,in6p_flowinfo,in6p_vflag, in6p_flags,in6p_socket,in6p_lport,in6p_fport,in6p_ppcb and sotoin6pcb(). Apart from removing duplicate code in netipsec, this is a pure whitespace, not a functional change. Discussed with: rwatson Reviewed by: rwatson (version before review requested changes) MFC after: 4 weeks (set the timer and see then)
* This main goals of this project are:qingli2008-12-1515-571/+491
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. separating L2 tables (ARP, NDP) from the L3 routing tables 2. removing as much locking dependencies among these layers as possible to allow for some parallelism in the search operations 3. simplify the logic in the routing code, The most notable end result is the obsolescent of the route cloning (RTF_CLONING) concept, which translated into code reduction in both IPv4 ARP and IPv6 NDP related modules, and size reduction in struct rtentry{}. The change in design obsoletes the semantics of RTF_CLONING, RTF_WASCLONE and RTF_LLINFO routing flags. The userland applications such as "arp" and "ndp" have been modified to reflect those changes. The output from "netstat -r" shows only the routing entries. Quite a few developers have contributed to this project in the past: Glebius Smirnoff, Luigi Rizzo, Alessandro Cerri, and Andre Oppermann. And most recently: - Kip Macy revised the locking code completely, thus completing the last piece of the puzzle, Kip has also been conducting active functional testing - Sam Leffler has helped me improving/refactoring the code, and provided valuable reviews - Julian Elischer setup the perforce tree for me and has helped me maintaining that branch before the svn conversion
* Add a check, that is currently under discussion for 8 but that we needbz2008-12-141-0/+4
| | | | | | | | | | | | | | | | | | to keep for 7-STABLE when MFCing in_pcbladdr() to not change the behaviour there. With this a destination route via a loopback interface is treated as a valid and reachable thing for IPv4 source address selection, even though nothing of that network is ever directly reachable, but it is more like a blackhole route. With this the source address will be selected and IPsec can grab the packets before we would discard them at a later point, encapsulate them and send them out from a different tunnel endpoint IP. Discussed on: net Reported by: Frank Behrens <frank@harz.behrens.de> Tested by: Frank Behrens <frank@harz.behrens.de> MFC after: 4 weeks (just so that I get the mail)
* De-virtualize the MD5 context for TCP initial seq number generationbz2008-12-132-12/+10
| | | | | | | | and make it a function local variable like we do almost everywhere inside the kernel. Discussed with: rwatson, silby MFC after: 4 weeks
* version that will compilekmacy2008-12-131-2/+3
|
* radix node head lock needs to be held when calling rnh_addaddrkmacy2008-12-131-0/+2
|
* don't acquire lock recursivelykmacy2008-12-131-1/+1
|
* Second round of putting global variables, which were virtualizedbz2008-12-136-7/+23
| | | | | | | | | | | but formerly missed under VIMAGE_GLOBAL. Put the extern declarations of the virtualized globals under VIMAGE_GLOBAL as the globals themsevles are already. This will help by the time when we are going to remove the globals entirely. Sponsored by: The FreeBSD Foundation
* Put a global variables, which were virtualized but formerlybz2008-12-117-7/+20
| | | | | | | | | | | | | missed under VIMAGE_GLOBAL. Start putting the extern declarations of the virtualized globals under VIMAGE_GLOBAL as the globals themsevles are already. This will help by the time when we are going to remove the globals entirely. While there garbage collect a few dead externs from ip6_var.h. Sponsored by: The FreeBSD Foundation
* Use the correct INIT_VNET_INET() as the virtualized variable herebz2008-12-111-1/+1
| | | | | | are in vinet.h not in vinet6.h Sponsored by: The FreeBSD Foundation
* Conditionally compile out V_ globals while instantiating the appropriatezec2008-12-1018-53/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | container structures, depending on VIMAGE_GLOBALS compile time option. Make VIMAGE_GLOBALS a new compile-time option, which by default will not be defined, resulting in instatiations of global variables selected for V_irtualization (enclosed in #ifdef VIMAGE_GLOBALS blocks) to be effectively compiled out. Instantiate new global container structures to hold V_irtualized variables: vnet_net_0, vnet_inet_0, vnet_inet6_0, vnet_ipsec_0, vnet_netgraph_0, and vnet_gif_0. Update the VSYM() macro so that depending on VIMAGE_GLOBALS the V_ macros resolve either to the original globals, or to fields inside container structures, i.e. effectively #ifdef VIMAGE_GLOBALS #define V_rt_tables rt_tables #else #define V_rt_tables vnet_net_0._rt_tables #endif Update SYSCTL_V_*() macros to operate either on globals or on fields inside container structs. Extend the internal kldsym() lookups with the ability to resolve selected fields inside the virtualization container structs. This applies only to the fields which are explicitly registered for kldsym() visibility via VNET_MOD_DECLARE() and vnet_mod_register(), currently this is done only in sys/net/if.c. Fix a few broken instances of MODULE_GLOBAL() macro use in SCTP code, and modify the MODULE_GLOBAL() macro to resolve to V_ macros, which in turn result in proper code being generated depending on VIMAGE_GLOBALS. De-virtualize local static variables in sys/contrib/pf/net/pf_subr.c which were prematurely V_irtualized by automated V_ prepending scripts during earlier merging steps. PF virtualization will be done separately, most probably after next PF import. Convert a few variable initializations at instantiation to initialization in init functions, most notably in ipfw. Also convert TUNABLE_INT() initializers for V_ variables to TUNABLE_FETCH_INT() in initializer functions. Discussed at: devsummit Strassburg Reviewed by: bz, julian Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation
* Remove inconsistent white space from in_pcballoc().rwatson2008-12-101-2/+0
| | | | MFC after: pretty soon
* Move syncache flag definitions below data structure, compress some verticalrwatson2008-12-101-10/+12
| | | | | | whitespace. MFC after: pretty soon
* Move flag definitions for t_flags and t_oobflags below the definition ofrwatson2008-12-101-28/+36
| | | | | | | struct tcpcb so that the structure definition is a bit more vertically compact. Can't yet fit it on one printed page, though. MFC after: pretty soon
* unlock when donekmacy2008-12-101-1/+1
|
* don't reference if_addr_mtx directlykmacy2008-12-101-2/+2
|
OpenPOWER on IntegriCloud