summaryrefslogtreecommitdiffstats
path: root/sys/netinet
Commit message (Collapse)AuthorAgeFilesLines
* First pass at separating per-vnet initializer functionszec2009-04-068-64/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from existing functions for initializing global state. At this stage, the new per-vnet initializer functions are directly called from the existing global initialization code, which should in most cases result in compiler inlining those new functions, hence yielding a near-zero functional change. Modify the existing initializer functions which are invoked via protosw, like ip_init() et. al., to allow them to be invoked multiple times, i.e. per each vnet. Global state, if any, is initialized only if such functions are called within the context of vnet0, which will be determined via the IS_DEFAULT_VNET(curvnet) check (currently always true). While here, V_irtualize a few remaining global UMA zones used by net/netinet/netipsec networking code. While it is not yet clear to me or anybody else whether this is the right thing to do, at this stage this makes the code more readable, and makes it easier to track uncollected UMA-zone-backed objects on vnet removal. In the long run, it's quite possible that some form of shared use of UMA zone pools among multiple vnets should be considered. Bump __FreeBSD_version due to changes in layout of structs vnet_ipfw, vnet_inet and vnet_net. Approved by: julian (mentor)
* If KTR_SUBSYS is compiled in, it does not necessarily mean that userkan2009-04-051-1/+1
| | | | | | is interested in being spammed by mcast-related printfs. Use proper check against ktr_mask instead KTR_COMPILE.
* Fix mbuf chain layout pessimization:bms2009-04-041-4/+8
| | | | | | | | in the case where a single mbuf is allocated due to m_getcl() returning NULL, we already call MH_ALIGN, so do not increment m->m_data in this case. Found during MLDv2 port.
* Do not obliterate QQI with MAXRESP.bms2009-04-041-2/+2
| | | | Found during MLDv2 port.
* Many bug fixes (from the IETF hack-fest):rrs2009-04-0410-2119/+365
| | | | | | | | | | | | | | | | - PR-SCTP had major issues when skipping through a multi-part message. o Did not look at socket buffer. o Did not properly handle the reassmebly queue. o The MARKED segments could interfere and un-skip a chunk causing a problem with the proper FWD-TSN. o No FR of FWD-TSN's was being done. - NR-Sack code was basically disabled. It needed fixes that never got into the real code. - CMT code had issues when the two paths were NOT the same b/w. We found a few small bugs, but also the critcal one here was not dividing the rwnd amongst the paths. Obtained from: Michael Tuexen and myself at the IETF hack-fest ;-)
* Implement an ipfw action to reassemble ip packets: reass.piso2009-04-013-1/+62
|
* Don't call m_freem() after ip_output(), as it always consumesbms2009-03-241-1/+0
| | | | | | the mbuf chain provided to it. Found by: Pierre Guinoiseau
* Remove local in6_addr variables for local and foreign addresses in sysctl_drop,jmallett2009-03-221-3/+3
| | | | | | | | | | they were passed uninitialized to in6_pcblookup_hash. Instead, do as is done for IPv4 and use the addresses within the sockaddr structure, which are correctly populated. This fixes tcpdrop(8) for IPv6 address pairs. Reviewed by: bz
* Fix brainos introduced during mechanical KTR change.bms2009-03-201-5/+6
| | | | Pointy hat to: bms
* Cleanup: Nuke debug.mrtdebug, and replace it with KTR.bms2009-03-191-142/+68
|
* Introduce a number of changes to the MROUTING code.bms2009-03-192-632/+415
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is purely a forwarding plane cleanup; no control plane code is involved. Summary: * Split IPv4 and IPv6 MROUTING support. The static compile-time kernel option remains the same, however, the modules may now be built for IPv4 and IPv6 separately as ip_mroute_mod and ip6_mroute_mod. * Clean up the IPv4 multicast forwarding code to use BSD queue and hash table constructs. Don't build our own timer abstractions when ratecheck() and timevalclear() etc will do. * Expose the multicast forwarding cache (MFC) and virtual interface table (VIF) as sysctls, to reduce netstat's dependence on libkvm for this information for running kernels. * bandwidth meters however still require libkvm. * Make the MFC hash table size a boot/load-time tunable ULONG, net.inet.ip.mfchashsize (defaults to 256). * Remove unused members from struct vif and struct mfc. * Kill RSVP support, as no current RSVP implementation uses it. These stubs could be moved to raw_ip.c. * Don't share locks or initialization between IPv4 and IPv6. * Don't use a static struct route_in6 in ip6_mroute.c. The v6 code is still using a cached struct route_in6, this is moved to mif6 for the time being. * More cleanup remains to be merged from ip_mroute.c to ip6_mroute.c. v4 path tested using ports/net/mcast-tools. v6 changes are mostly mechanical locking and *have not* been tested. As these changes partially break some kernel ABIs, they will not be MFCed. There is a lot more work to be done here. Reviewed by: Pavlin Radoslavov
* Comment IGMP_PIM as being very historic, as in, don't use.bms2009-03-191-1/+1
|
* Deal with the case where ifma_protospec may be NULL, duringbms2009-03-173-6/+37
| | | | | | | | | | | | | | | | | | any IPv4 multicast operations which reference it. There is a potential race because ifma_protospec is set to NULL when we discover the underlying ifnet has gone away. This write is not covered by the IF_ADDR_LOCK, and it's difficult to widen its scope without making it a recursive lock. It isn't clear why this manifests more quickly with 802.11 interfaces, but does not seem to manifest at all with wired interfaces. With this change, the 802.11 related panics reported by sam@ and cokane@ should go away. It is not the right fix, that requires more thought before 8.0. Idea from: sam Tested by: cokane
* Remove IFF_NEEDSGIANT, a compatibility infrastructure introducedrwatson2009-03-152-33/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in FreeBSD 5.x to allow network device drivers to run with Giant despite the network stack being Giant-free. This significantly simplifies calls into ioctl() on network interfaces, especially in the multicast code, as well as eliminates deferred invocation of interface if_start routines. Disable the build on device drivers still depending on IFF_NEEDSGIANT as they no longer compile. They will be removed in a few weeks if they haven't been made MPSAFE in that time. Disabled drivers: if_ar if_axe if_aue if_cdce if_cue if_kue if_ray if_rue if_rum if_sr if_udav if_ural if_zyd Drivers that were already disabled because of tty changes: if_ppp if_sl Discussed on: arch@
* Correct a number of evolved problems with inp_vflag and inp_flags:rwatson2009-03-157-104/+102
| | | | | | | | | | | | | | | | | | | | | certain flags that should have been in inp_flags ended up in inp_vflag, meaning that they were inconsistently locked, and in one case, interpreted. Move the following flags from inp_vflag to gaps in the inp_flags space (and clean up the inp_flags constants to make gaps more obvious to future takers): INP_TIMEWAIT INP_SOCKREF INP_ONESBCAST INP_DROPPED Some aspects of this change have no effect on kernel ABI at all, as these are UDP/TCP/IP-internal uses; however, netstat and sockstat detect INP_TIMEWAIT when listing TCP sockets, so any MFC will need to take this into account. MFC after: 1 week (or after dependencies are MFC'd) Reviewed by: bz
* Opps.. I missed a file on the commit :-)rrs2009-03-141-1/+2
|
* Namespace: Defining htonl() and friends here instead of arpa/inet.h isdas2009-03-141-2/+2
| | | | a BSD extension.
* Fixes several PR-SCTP releated bugs.rrs2009-03-148-143/+361
| | | | | | | | - When sending large PR-SCTP messages over a lossy link we would incorrectly calculate the fwd-tsn - When receiving large multipart pr-sctp packets we would incorrectly send back a SACK that would renege improperly on already received packets thus causing unneeded retransmissions.
* Add INP_INHASHLIST flag for inpcb->inp_flags to indicate whetherrwatson2009-03-112-4/+11
| | | | | | | | | | or not the inpcb is currenty on various hash lookup lists, rather than using (lport != 0) to detect this. This means that the full 4-tuple of a connection can be retained after close, which should lead to more sensible netstat output in the window between TCP close and socket close. MFC after: 2 weeks
* Remove unused v6 macro aliases for inpcb fields:rwatson2009-03-101-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | in6p_ip6_nxt in6p_vflag in6p_flags in6p_socket in6p_lport in6p_fport in6p_ppcb Remove unused v6 macro aliases for inpcb flags: IN6P_HIGHPORT IN6P_LOWPORT IN6P_ANONPORT IN6P_RECVIF IN6P_MTUDISC IN6P_FAITH IN6P_CONTROLOPTS References to in6p_lport and in6_fport in sockstat are also replaced with normal inp_lport and inp_fport references. MFC after: 3 days Reviewed by: bz
* Don't print inm_print() chatter when KTR_IGMPV3 is not enabledbms2009-03-101-0/+3
| | | | | | in the KTR_COMPILE mask. Found by: gnn
* Remove now-unused INP_UNMAPPABLEOPTS.rwatson2009-03-101-2/+0
| | | | | MFC after: 3 days Discussed with: bz
* Fix uninitialized use of ifp for ii.bms2009-03-091-1/+3
| | | | Found by: Peter Holm
* Merge IGMPv3 and Source-Specific Multicast (SSM) to the FreeBSDbms2009-03-0913-1274/+5694
| | | | | | | | | | | IPv4 stack. Diffs are minimized against p4. PCS has been used for some protocol verification, more widespread testing of recorded sources in Group-and-Source queries is needed. sizeof(struct igmpstat) has changed. __FreeBSD_version is bumped to 800070.
* On architectures with strict alignment requirements compensatemarius2009-03-071-4/+18
| | | | | | | | the misalignment of the IP header that prepending the EtherIP header might have caused. PR: 131921 MFC after: 1 week
* Fixes for window probes:rrs2009-03-062-50/+70
| | | | | | 1) WP should never be marked unless flight size is 0 2) When recovering from wp if the peer ack's it we don't mark for retran 3) When recovering, we must assure a timer is still running.
* - PR-SCTP bug, where the CUM-ACK was not being updatedrrs2009-03-043-16/+27
| | | | | | | | | | into the advance_peer_ack point so we would incorrectly send a wrong value in the FWD-TSN - PR-SCTP bug, where an PR packet is used for a window probe which could incorrectly get the packet moved back into the send_queue, which will cause major issues and should not happen. - Fix a trace to use the proper macro.
* In ip_output(), do not acquire the IN_MULTI_LOCK(),bms2009-03-041-17/+14
| | | | | | | | | | | | | | | | | | | | and do not attempt to perform a group lookup. This is a socket layer lock, and the bottom half of IP really has no business taking it. Use the value of the in_mcast_loop sysctl to determine if we should loop back by default, in the absence of any multicast socket options. Because the check on group membership is now deferred to the input path, an m_copym() is now required. This should increase multicast send performance where the source has not requested loopback, although this has not been benchmarked or measured. It is also a necessary change for IN_MULTI_LOCK to become non-recursive, which is required in order to implement IGMPv3 in a thread-safe way.
* Add sysctl net.inet.ip.mcast.loop. This controls whether or notbms2009-03-041-1/+8
| | | | | | IPv4 multicast sends are looped back to senders by default on a stack-wide basis, rather than relying on the socket option. Note that the sysctl only applies to newly created multicast sockets.
* Merge header file definitions used by the new IGMPv3 implementation.bms2009-03-041-38/+68
| | | | | This is a partial merge. Compatibility defines are retained for the existing IGMPv2 implementation.
* Add various defines/macros required by IGMPv3:bms2009-03-041-1/+10
| | | | | | | | * MCAST_UNDEFINED state. * in_allhosts() macro (group is 224.0.0.1). This uses a const endian comparison. * IP_MAX_GROUP_SRC_FILTER, IP_MAX_SOCK_SRC_FILTER default resource limits.
* Add function ip_checkrouteralert(), which will be usedbms2009-03-042-0/+62
| | | | | by IGMPv3 to check for the IPv4 Router Alert [RFC2113] option in a pulled-up IP mbuf chain.
* Start removing IPv6 Type 0 Routing header code.bz2009-03-031-1/+1
| | | | | | | | | | RH0 was deprecated by RFC 5095. While most of the code had been disabled by #if 0 already, leave a bit of infrastructure for possible RH2 code and a log message under BURN_BRIDGES in case a user still tries to send RH0 packets. Reviewed by: gnn (a bit back, earlier version)
* curr_time is a 64 bit variable so SYSCTL_LONG is not appropriateluigi2009-03-021-0/+2
| | | | | | | | as a handler. The variable was exported only for debugging, but there is little reason to do it now that the timekeeping is supported by various other variables. For the time being just comment out the sysctl, but I think this should go away.
* fw_debug has been unused for ages, so remove it from the listluigi2009-03-022-5/+1
| | | | | | | | | | of sysctl_variables. I would also remove it from the VNET record but I am unsure if there is any ABI issue -- so for the time being just mark it as unused in ip_fw.h, and then we will collect the garbage at some appropriate time in the future. MFC after: 3 days
* Add size-guards evaluated at compile-time to the main struct vnet_*bz2009-03-011-0/+3
| | | | | | | | | | which are not in a module of their own like gif. Single kernel compiles and universe will fail if the size of the struct changes. Th expected values are given in sys/vimage.h. See the comments where how to handle this. Requested by: peter
* Remove unreachable code for generating RST segments from tcp_twcheck();rwatson2009-02-281-45/+0
| | | | | | | this code became stale when T/TCP support was removed. Discussed with: bz, sam MFC after: 1 month
* Fix the add stream feature of strm-reset to really work:rrs2009-02-275-49/+133
| | | | | | | | | | | - Fix the copy, we can't do a blind copy but must transfer the data from the old to the new. - Fix the ACK processing so we properly stop retransmitting the thing. - Fix it so if we get a retran we will properly reply with the saved response without doing anything. MFC after: 1 month
* For all files including net/vnet.h directly include opt_route.h andbz2009-02-2710-0/+12
| | | | | | | | | | | | | | net/route.h. Remove the hidden include of opt_route.h and net/route.h from net/vnet.h. We need to make sure that both opt_route.h and net/route.h are included before net/vnet.h because of the way MRT figures out the number of FIBs from the kernel option. If we do not, we end up with the default number of 1 when including net/vnet.h and array sizes are wrong. This does not change the list of files which depend on opt_route.h but we can identify them now more easily.
* Change the functions to ANSI in those cases where it breaks promotionrdivacky2009-02-241-4/+1
| | | | | | | | to int rule. See ISO C Standard: SS6.7.5.3:15. Approved by: kib (mentor) Reviewed by: warner Tested by: silence on -current
* In tcp_usr_shutdown() and tcp_usr_send(), I missed converting NULLrwatson2009-02-241-2/+3
| | | | | | | | | | | checks for the tcpcb, previously used to detect complete disconnection, with INP_DROPPED checks. Correct that, preventing shutdown() from improperly generating a TCP segment with destination IP and port of 0.0.0.0:0. PR: kern/132050 Reported by: david gueluy <david.gueluy at netasq.com> MFC after: 3 weeks
* In in_rtqkill(), assert the radix head lock, and pass RTF_RNH_LOCKEDrwatson2009-02-231-1/+4
| | | | | | | | | | to in_rtrequest(); the radix head lock is already acquired before rnh_walktree is called in in_rtqtimo_one(). This avoids a recursive acquisition that is no longer permitted in 8.x due to use of an rwlock for the radix head lock. Reported by: dikshie <dikshie at gmail.com> MFC after: 3 days
* Add the add-stream capability. Still needs morerrs2009-02-2010-36/+281
| | | | | | testing.. MFC after: 1 month
* Fix a bug. The sending was being restricted improperly byrrs2009-02-201-2/+2
| | | | | | | | the max_burst. It should only be gated by cwnd in the lower level send. Obtained from: Michael Tuexen MFC after: 1 week.
* correct some #includeluigi2009-02-162-3/+2
|
* remove dependency on eventhandler.h, we only need a forward declarationluigi2009-02-161-1/+2
|
* remove dependency on net/if.h of this headerluigi2009-02-161-0/+1
|
* use a const format string in the log message so we can check theluigi2009-02-161-6/+11
| | | | arguments (if/when we enable those checks)
* remove unnecessary #include from vnet.h and vinet.hluigi2009-02-151-3/+0
| | | | Approved by: Marko Zec
* This commit fixes the issue with alias_sctp.c. Norrs2009-02-143-693/+58
| | | | | | | | | | | | | | longer do we require SCTP to be in the kernel for the lib to be able to handle SCTP. We do this by moving the CRC32c checksum into libkern/crc32.c and then adjusting all routines to use the common methods. Note that this will improve the performance of iSCSI since they were using the old single 256 bit table lookup versus the slicing 8 algorithm (which gives a 4x speed up in CRC32c calculation :-D) Reviewed by:rwatson, gnn, scottl, paolo MFC after: 4 week? (assuming we MFC the alias_sctp changes)
OpenPOWER on IntegriCloud