summaryrefslogtreecommitdiffstats
path: root/sys/netinet
Commit message (Collapse)AuthorAgeFilesLines
* Further cleanup of UDPv4:rwatson2007-07-102-98/+96
| | | | | | | | | | | | | | - Move udp_sendspace and udp_recvspace global variables and associated sysctls to the top of the file where most other such things are present. - Rename static variable 'blackhole' to 'udp_blackhole' and unstaticize so that we can add blackhole support for UDPv6 using the same MIB variable. - Move udp_append() above udp_input() to match the function order in udp6_usrreq.c. Approved by: re (kensmith)
* Fix a regression in IPv4 multicast join path (IP_ADD_MEMBERSHIP).bms2007-07-091-11/+26
| | | | | | | | | | | | | | | With the in_mcast.c code, if an interface for an IPv4 multicast join was not specified, and a route did not exist for the specified group in the unicast forwarding tables, the join would be rejected with the error EADDRNOTAVAIL. This change restores the old behaviour whereby if no interface is specified, and no route exists for the group destination, the IPv4 address list is walked to find a non-loopback, multicast-capable interface to satisfy the join request. This should resolve problems with starting multicast services during system boot or when a default forwarding entry does not exist. Approved by: re (rwatson)
* Minor UDPv4 cleanup: capitalize comment, move statistics update after mbufrwatson2007-07-071-3/+3
| | | | | | | free to be consistent with other error handling, and release socket buffer lock before freeing mbufs and statistics updates rather than after. Approved by: re (kensmith)
* Fix a second warning, introduced by my last "fix". I committed the wrongpeter2007-07-051-2/+2
| | | | | | | diff from the wrong machine. Pointy hat to: peter Approved by: re (rwatson - blanket, several days ago)
* Fix cast-qualifiers warning when INET6 is not presentpeter2007-07-053-4/+3
| | | | Approved by: re (rwatson)
* Link pf 4.1 to the build:mlaier2007-07-031-8/+6
| | | | | | | | - move ftp-proxy from libexec to usr.sbin - add tftp-proxy - new altq mtag link Approved by: re (kensmith)
* Commit the change from FAST_IPSEC to IPSEC. The FAST_IPSECgnn2007-07-0317-75/+75
| | | | | | | | option is now deprecated, as well as the KAME IPsec code. What was FAST_IPSEC is now IPSEC. Approved by: re Sponsored by: Secure Computing
* - Consolidate the code that free's chunks to actually alsorrs2007-07-027-43/+97
| | | | | | | | | | | | | | | call the sctp_free_remote_address() function. - Assure that when we allocate a chunk the whoTo is NULL, also when we free it and place it into the cache we NULL it (that way the consolidation code will always work). - Fix a small race, when a empty data holder is left on the stream out queue, and both sides do a shutdown, the empty data holder would prevent us from sending a SHUTDOWN-ACK and at the same time we never would cleanup the empty holder (since nothing was ever in queue). We now add a utility function that a) cleans up empty holders and b) properly determines if there are still pending data chunks on the stream out wheel. Approved by: re@freebsd.org (Ken Smith)
* Continue pre-7.0 privilege cleanup: update suser(9) comments to be priv(9)rwatson2007-07-021-1/+1
| | | | | | comments. Approved by: re (bmah)
* Fix a dangling netinet6 to netipsec transition for SCTP include files.gnn2007-07-011-1/+1
| | | | Approved by: re
* Commit IPv6 support for FAST_IPSEC to the tree.gnn2007-07-0118-382/+55
| | | | | | | | | This commit includes only the kernel files, the rest of the files will follow in a second commit. Reviewed by: bz Approved by: re Supported by: Secure Computing
* - When a SCTP socket is closed, but the last datarrs2007-06-291-13/+0
| | | | | | SACK is lost, we would incorrectly abort the association instead of retransmitting the SACK. Approved by: re@freebsd.org (Ken Smith)
* - Update bindx address checking to properly screen out addressrrs2007-06-251-1/+11
| | | | | | | per the socket api, adding port validation. We allow port 0 or the already bound port number and no others. Approved by: re@freebsd.org (Ken Smith)
* - Fix type casts in calling sctp_m_getptr, it expects a int notrrs2007-06-221-2/+2
| | | | | | an unsigned (returned by sizeof) also add cast to comparison check for size bounds. Approved by: re(bmah@freebsd.org)
* - Fix stream reset so it limits the number of streams that can be listedrrs2007-06-225-198/+240
| | | | | | | | | - Fix fwd-tsn to use proper accessor so it does not overrun mbufs - Fix stream reset error reporting to actually work (it has always been broken if the peer rejects a stream reset) - Some 64 bit friendly changes Approved by: re(bmah@freebsd.org)
* - Two more static analisys bugs found by cisco's tool on a subsequentrrs2007-06-182-3/+5
| | | | run.
* - Fixes cstatic issues found by cisco sa tool (missing frees and suchrrs2007-06-186-5/+23
| | | | | on error legs) - align sctp_sockstore to 64 bit boundary ..
* o Make ipfw set more robust -- now it is possible:maxim2007-06-181-18/+60
| | | | | | | | | | | | - to show a specific set: ipfw set 3 show - to delete rules from the set: ipfw set 9 delete 100 200 300 - to flush the set: ipfw set 4 flush - to reset rules counters in the set: ipfw set 1 zero PR: kern/113388 Submitted by: Andrey V. Elsukov Approved by: re (kensmith) MFC after: 6 weeks
* Add additional logging level mask for packet_logging too.rrs2007-06-183-9/+19
|
* - The packet log needs to copy all of the buffer not to the end.rrs2007-06-171-2/+3
|
* Back out last change to inpcb_free. Turns out we needrrs2007-06-171-3/+14
| | | | | | | to hold off freeing if there is data pending ... someone might do send/close. Which means we want the data to go and then close it after startup. Added comments to the code as well to note that this is done for a reason.
* Make gcc4.2 happy and zero save_ip for the unlikely (blackhole != 0)mjacob2007-06-171-0/+2
| | | | codepath.
* - For sctp_input/sctp6_input add announcment when a packet arrives (debug)rrs2007-06-173-8/+7
| | | | | | | | | | - re-factor the packet drop in sctp_output a bit more, we don't need the trim after all, but the size calc is now corrected. - When a assoc is in the COOKIE-ECHO/COOKIE-WAIT state and the user closes, it should not matter if data is queued, the assoc should be purged. - In error leg a missing free_chunk when iph comes in NULL (should not happen but just in case).
* Replace incorrect local OFFSET_OF macro with the correct and genericmjacob2007-06-172-6/+1
| | | | offsetof macro.
* Simplification to quiet a gcc4.2 warning. Just by setting match.s_addrmjacob2007-06-171-14/+9
| | | | | | | to nonzero you fulfill the same function as the variable 'cmp'. so you might as well zero match and test against it later. Reviewed by: timeout on review request
* - Better handle sending large pkt-drops. We were not trimingrrs2007-06-161-12/+20
| | | | | the data with m_adj if a large pkt arrived with a bad csum some systems can't handle you not triming the tail (think panda :-D)
* - Raise max range of sctp_logging sysctl so panda does not disallowrrs2007-06-161-1/+1
| | | | us to turn on logging levels.
* - Matthew's changes to get inlines out, plus a few of my ownrrs2007-06-166-23/+20
| | | | | to deal with the VRF inline function -> becomes a macro now. Submitted by: Matthew Jacobs
* Garbage collect some debug code that not only no longer couldmjacob2007-06-151-6/+0
| | | | | work but in fact probably causes a random pointer dereferences. Garbage collect the tp variable too.
* Name change SCTP_KTR_SUBSYS -> KTR_SCTPrrs2007-06-151-21/+21
|
* Remove extraneous extern (its gotten from sctp_sysctl.h)rrs2007-06-151-5/+0
|
* When removing a stream from the output-stream-wheel, if its therrs2007-06-151-0/+10
| | | | | first stream we saw we must update the starting point in the wheel, else we may loop in an endless loop.
* - Update the comment lines in sctp_input.crrs2007-06-152-6/+6
| | | | | - We need to init the INP_LOCK since otherwise for non-SMP kernels you crash when you set the TOS.
* Stub out imported IGMPv3 definitions which clash with those ofbms2007-06-151-0/+2
| | | | | the XORP router; the IGMPv3 definitions will be updated at a later point in time when IGMPv3/MLDv2 support is fully merged.
* - Issue one, new stack reduction left packet_drop handling stillrrs2007-06-153-24/+44
| | | | | | | | | thinking it had the whole chunk. This could cause a crash if a large packet drop came in. Fixed by adjusting the trunc length down to the limit. - Large sacks with lots of segments could also have same issue. Changed duplicate and segment handling to use proper get_m_ptr function to pull each block from mbuf chains.
* - Add VRF id to sctp_ifa structure, needed mainly in panda but usefulrrs2007-06-153-1/+7
| | | | during deletes of ifa's in diff VRF's when applicable.
* KTR_GEN -> KTR_SUBSYS (for Kris).rrs2007-06-152-3/+3
|
* - Fix so ifn's are properly deleted when the ref count goes to 0.rrs2007-06-1420-1235/+1120
| | | | | | | | | | - Fix so VRF's will clean themselves up when no references are around. - Allow sctp_ifa to be passed into inpcb_bind, addr_mgmt_ep_sa to bypass normal validation checks. - turn auto-asconf off for subset bound sockets - Moves all logging to use KTR. This gets rid of most of the logging #ifdef's with a few exceptions reducing the number of config options for SCTP.
* - fix bindx to check addresses against socket's protocol familyrrs2007-06-131-0/+34
|
* Remove IPX over IP tunneling support, which allows IPX routing over IPrwatson2007-06-131-15/+0
| | | | | | | | | | tunnels, and was not MPSAFE. The code can be easily restored in the event that someone with an IPX over IP tunnel configuration can work with me to test patches. This removes one of five remaining consumers of NET_NEEDS_GIANT. Approved by: re (kensmith)
* - Fixed cookie handling to calc an RTO whenrrs2007-06-139-58/+57
| | | | | | | | | | its an INIT collision case. - Fixed RTO calc to maintain a seperate variable to track if a RTO calc as been done, this allows the RTO var to be doubled during initial timeouts. - Reduces the amount of stack used by process control. - Use a constant for the peer chunk overhead. - Name change to spell candidate correctly.
* Import rewrite of IPv4 socket multicast layer to support source-specificbms2007-06-1213-704/+2181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and protocol-independent host mode multicast. The code is written to accomodate IPv6, IGMPv3 and MLDv2 with only a little additional work. This change only pertains to FreeBSD's use as a multicast end-station and does not concern multicast routing; for an IGMPv3/MLDv2 router implementation, consider the XORP project. The work is based on Wilbert de Graaf's IGMPv3 code drop for FreeBSD 4.6, which is available at: http://www.kloosterhof.com/wilbert/igmpv3.html Summary * IPv4 multicast socket processing is now moved out of ip_output.c into a new module, in_mcast.c. * The in_mcast.c module implements the IPv4 legacy any-source API in terms of the protocol-independent source-specific API. * Source filters are lazy allocated as the common case does not use them. They are part of per inpcb state and are covered by the inpcb lock. * struct ip_mreqn is now supported to allow applications to specify multicast joins by interface index in the legacy IPv4 any-source API. * In UDP, an incoming multicast datagram only requires that the source port matches the 4-tuple if the socket was already bound by source port. An unbound socket SHOULD be able to receive multicasts sent from an ephemeral source port. * The UDP socket multicast filter mode defaults to exclusive, that is, sources present in the per-socket list will be blocked from delivery. * The RFC 3678 userland functions have been added to libc: setsourcefilter, getsourcefilter, setipv4sourcefilter, getipv4sourcefilter. * Definitions for IGMPv3 are merged but not yet used. * struct sockaddr_storage is now referenced from <netinet/in.h>. It is therefore defined there if not already declared in the same way as for the C99 types. * The RFC 1724 hack (specify 0.0.0.0/8 addresses to IP_MULTICAST_IF which are then interpreted as interface indexes) is now deprecated. * A patch for the Rhyolite.com routed in the FreeBSD base system is available in the -net archives. This only affects individuals running RIPv1 or RIPv2 via point-to-point and/or unnumbered interfaces. * Make IPv6 detach path similar to IPv4's in code flow; functionally same. * Bump __FreeBSD_version to 700048; see UPDATING. This work was financially supported by another FreeBSD committer. Obtained from: p4://bms_netdev Submitted by: Wilbert de Graaf (original work) Reviewed by: rwatson (locking), silence from fenner, net@ (but with encouragement)
* - Restructure so bindx functions are not done inline to socket optionrrs2007-06-129-239/+296
| | | | | | | but are a seperate call that can be re-used if needed. - 64 bit issues o re-arrange cookie so it is better 64 bit aligned o For wire level things we need the packed attribute.
* Eliminate now-unused SUSER_ALLOWJAIL arguments to priv_check_cred(); inrwatson2007-06-126-34/+14
| | | | | | | | | | | | | | | some cases, move to priv_check() if it was an operation on a thread and no other flags were present. Eliminate caller-side jail exception checking (also now-unused); jail privilege exception code now goes solely in kern_jail.c. We can't yet eliminate suser() due to some cases in the KAME code where a privilege check is performed and then used in many different deferred paths. Do, however, move those prototypes to priv.h. Reviewed by: csjp Obtained from: TrustedBSD Project
* Fix a case in tcp_do_segment() where tcp_update_sack_list() wouldandre2007-06-101-2/+1
| | | | | | | | | | | | | be called with an incorrect segment end value. tcp_reass() may trim segments when they overlap with already existing ones in the reassembly queue. Instead of saving the segment end value before the call to tcp_reass() compute it on the fly based on the effective segment length afterwards. This bug was not really problematic as no information got lost and the eventual SACK information computation was correct nontheless. MFC after: 1 week
* Fix style for comments, be more verbose and add some more.andre2007-06-101-23/+34
|
* Make the handling of the tcp window explicit for the SYN_SENT caseandre2007-06-091-4/+10
| | | | | | | | | in tcp_outout(). This is currently not strictly necessary but paves the way to simplify the entire SYN options handling quite a bit. Clarify comment. No change in effective behavour with this commit. RFC1323 requires the window field in a SYN (i.e., a <SYN> or <SYN,ACK>) segment itself never be scaled.
* Remove some bogosity from the SYN_SENT case in tcp_do_segmentandre2007-06-091-6/+8
| | | | | | | | | | and simplify handling of the send/receive window scaling. No change in effective behavour. RFC1323 requires the window field in a SYN (i.e., a <SYN> or <SYN,ACK>) segment itself never be scaled. Noticed by: yar
* Don't send pure window updates when the peer has closed the connectionandre2007-06-091-1/+4
| | | | and won't ever send more data.
* Handle a race condition on >2 core machines in tcp_timer() whenandre2007-06-091-2/+8
| | | | | | | | | a timer issues a shutdown and a simultaneous close on the socket happens. This race condition is inherent in the current socket/ inpcb life cycle system but can be handled well. Reported by: kris Tested by: kris (on 8-core machine)
OpenPOWER on IntegriCloud