summaryrefslogtreecommitdiffstats
path: root/sys/netinet
Commit message (Collapse)AuthorAgeFilesLines
* Add syntactic sugar missed in r226437 and then not added either when movingbz2011-10-171-1/+1
| | | | | | | things around in r226448 but desperately needed to always make things compile successfully. MFC after: 1 week
* Move the tcp_sendspace and tcp_recvspace sysctl's fromandre2011-10-163-14/+10
| | | | | | | | the middle of tcp_usrreq.c to the top of tcp_output.c and tcp_input.c respectively next to the socket buffer autosizing controls. MFC after: 1 week
* Remove the ss_fltsz and ss_fltsz_local sysctl's which haveandre2011-10-163-53/+3
| | | | | | | | | | long been superseded by the RFC3390 initial CWND sizing. Also remove the remnants of TCP_METRICS_CWND which used the TCP hostcache to set the initial CWND in a non-RFC compliant way. MFC after: 1 week
* VNET virtualize tcp_sendspace/tcp_recvspace and change theandre2011-10-163-11/+16
| | | | | | | type to INT. A long is not necessary as the TCP window is limited to 2**30. A larger initial window isn't useful. MFC after: 1 week
* - change "is is" to "is" or "it is"eadler2011-10-161-1/+1
| | | | | | | | - change "the the" to "the" Approved by: lstewart Approved by: sahil (mentor) MFC after: 3 days
* Update the comment and description of tcp_sendspace and tcp_recvspaceandre2011-10-161-5/+4
| | | | | to better reflect their purpose. MFC after: 1 week
* Forward declare mbuf and inpcb.ed2011-10-161-0/+3
| | | | | | | | | | | This fixes a compiler warning at WARNS=6 when including the header files as follows: #include <sys/types.h> #include <netinet/in.h> #include <netinet/ip_var.h> #include <netinet/udp.h> #include <netinet/udp_var.h>
* Add support for IPv4 /31 prefixes, as described in RFC3021.glebius2011-10-152-4/+11
| | | | | | | To run a /31 network, participating hosts MUST drop support for directed broadcasts, and treat the first and last addresses on subnet as unicast. The broadcast address for the prefix should be the link local broadcast address, INADDR_BROADCAST.
* Remove last remnants of classful addressing:glebius2011-10-154-52/+18
| | | | | | | | | | | | - Remove ia_net, ia_netmask, ia_netbroadcast from struct in_ifaddr. - Remove net.inet.ip.subnetsarelocal, I bet no one need it in 2011. - fix bug when we were not forwarding to a host which matches classful net address. For example router having 192.168.x.y/16 network attached, would not forward traffic to 192.168.*.0, which are legal IPs in CIDR world. - For compatibility, leave autoguessing of mask based on class. Reviewed by: andre, bz, rwatson
* Never switch directly from INIT to MASTER, since this producesglebius2011-10-141-18/+4
| | | | | | | | nasty status flaps. PR: kern/161123 Submitted by: Damien Fleuriot <dam my.gd> OpenBSD: ip_carp.c, rev. 1.115
* De-spl(9).glebius2011-10-131-3/+1
|
* Make sure the inp wasn't dropped when rexmt let go of the inp andnp2011-10-121-0/+7
| | | | | | | pcbinfo locks. Reviewed by: andre@ MFC after: 7 days
* Use the most significant 6 bits of the dscp instead of the leasttuexen2011-10-111-7/+7
| | | | | | | | | significant ones. This has changed in the latest version of the socket API ID and provides backwards compatibility and gets it in syn with the usage of the IP_TOS socket option. MFC after: 3 days.
* All indirect routes will fail the rtcheck, except for a special hostqingli2011-10-101-25/+17
| | | | | | | | | | | | route where the destination IP and the gateway IP is the same. This special case handling is only meant for backward compatibility reason. The last commit introduced a bug in the route check logic, where a valid special case is treated as an error. This patch fixes that bug along with some code cleanup. Suggested by: gleb Reviewed by: kmacy, discussed with gleb MFC after: 1 day
* Get struct sctp_net_route in tune with struct route.tuexen2011-10-101-0/+2
| | | | | | | | struct route was changed in http://svn.freebsd.org/changeset/base/225698 and since then SCTP support was broken. This needs to be MFCed to stable/9 to unbreak SCTP support in 9.0 MFC after: 3 days.
* When moving an stcb to a new inp and we copy over the list oftuexen2011-10-101-0/+3
| | | | | | | bound addresses, update the last used address pointer. If not, it might result in a crash if the old inp goes away. MFC after: 3 days.
* Update the inp stored in a HB-timer when moving an stcb to a new inp.tuexen2011-10-092-1/+2
| | | | | | | Use only this stored inp when processing a HB timeout. This fixes a bug which results in a crash. MFC after: 3 days.
* Do not try removing an ARP entry associated with a given interfaceqingli2011-10-071-1/+2
| | | | | | | | | | address if that interface does not support ARP. Otherwise the system will generate error messages unnecessarily due to the missing entry. PR: kern/159602 Submitted by: pluknet MFC after: 3 days
* Remove the reference held on the loopback route when the interfaceqingli2011-10-071-1/+3
| | | | | | | | | | | address is being deleted. Only the last reference holder deletes the loopback route. All other delete operations just clear the IFA_RTSELF flag. PR: kern/159601 Submitted by: pluknet Reviewed by: discussed on net@ MFC after: 3 days
* Prevent TCP sessions from stalling indefinitely in reassemblyandre2011-10-071-2/+28
| | | | | | | | | | | | | | | | | | | | when reaching the zone limit of reassembly queue entries. When the zone limit was reached not even the missing segment that would complete the sequence space could be processed preventing the TCP session forever from making any further progress. Solve this deadlock by using a temporary on-stack queue entry for the missing segment followed by an immediate dequeue again by delivering the contiguous sequence space to the socket. Add logging under net.inet.tcp.log_debug for reassembly queue issues. Reviewed by: lsteward (previous version) Tested by: Steven Hartland <killing-at-multiplay.co.uk> MFC after: 3 days
* Add back the IP header length to the total packet length field onandre2011-10-071-0/+7
| | | | | | | | | | | | | | raw IP sockets. It was deducted in ip_input() in preparation for protocols interested only in the payload. On raw sockets the IP header should be delivered as it at came in from the network except for the byte order swaps in some fields. This brings us in line with all other OS'es that provide raw IP sockets. Reported by: Matthew Cini Sarreo <mcins1-at-gmail.com> MFC after: 3 days
* For the INP_TIMEWAIT case, there is no valid tcpcb object tied to theattilio2011-10-061-16/+0
| | | | | | | | | | | | inpcb object. Skip the TCP_SIGNATURE check in that case as it is consistent with the output path (no TCP_SIGNATURE for outcoming packets in TIMEWAIT state) and also because for TIMEWAIT state the verify may be less effective. Sponsored by: Sandvine Incorporated Reported by: rwatson No objections by: rwatson MFC after: 3 days
* A system may have multiple physical interfaces, all of which are on theqingli2011-10-031-5/+34
| | | | | | | | | | | | same prefix. Since a single route entry is installed for the prefix (without RADIX_MPATH), incoming packets on the interfaces that are not associated with the prefix route may trigger an error message about unable to allocation LLE entry, and fails L2. This patch makes sure a valid route is present in the system, and allow the aforementioned condition to exist and treats as valid. Reviewed by: bz MFC after: 5 days
* This patch allows ARP to work properly in the presence ofqingli2011-10-031-14/+21
| | | | | | | self-referencing routes. This patch is a rework of r223862. Reviewed by: bz, zec MFC after: 5 days
* Unbreak no-ip and no-inet6 module builds with ipfw. For now continue tobz2011-09-271-3/+3
| | | | | | | | | | | build the ip_fw_pfil.c hooks and ipfw even in case of no-ip under the assumption that the private L2 hook (which hopefully eventually will be a pfil hook as well) can still be useful. Allow building the module without inet as well. Glanced at by: jhb MFC after: 3 days
* Cleanup the iterator code, remove code that is never executed.tuexen2011-09-193-38/+8
| | | | | Approved by: re MFC after: 1 month.
* Fix the enabling/disabling of Heartbeats and path MTUtuexen2011-09-175-20/+40
| | | | | | discovery when using the SCTP_PEER_ADDR_PARAMS socket option. Approved by: re MFC after: 1 month.
* Fix a typo introduced intuexen2011-09-151-1/+1
| | | | | | | | http://svn.freebsd.org/changeset/base/225571 Reported by Ilya A. Arkhipov. Approved by: re MFC after: 1 month.
* Make sure that SCTP rejects broadcast, multicast and wildcard addressestuexen2011-09-155-13/+51
| | | | | | | as remote addresses. Approved by: re MFC after: 1 month.
* Ensure that 1-to-1 style SCTP sockets can only be connected once.tuexen2011-09-144-59/+32
| | | | | | | | Allow implicit setup also for 1-to-1 style sockets as described in the latest version of the socket API ID. Approved by: re MFC after: 1 month
* Fix the handling of the flowlabel and DSCP value in the SCTP_PEER_ADDR_PARAMStuexen2011-09-146-64/+137
| | | | | | | | socket option. Honor the net.inet6.ip6.auto_flowlabel sysctl setting. Approved by: re (bz) MFC after: 1 month.
* Allow the ipfw.ko module built with a kernel to honor any IPFIREWALL_*jhb2011-09-126-6/+6
| | | | | | | | | | options defined in the kernel config. This more closely matches the behavior of other modules which inherit configuration settings from the kernel configuration during a kernel + modules build. Reviewed by: luigi Approved by: re (kib) MFC after: 1 week
* Improve implementation of the Nagle algorithm for SCTP:tuexen2011-09-091-6/+12
| | | | | | | Don't delay the final fragment of a fragmented user message. Approved by: re MFC after: 4 weeks
* When an interface address route is removed from the system, anotherqingli2011-08-281-1/+2
| | | | | | | | | | | | | route with the same prefix is searched for as a replacement. The current code did not bypass routes that have non-operational interfaces. This patch fixes that bug and will find a replacement route with an active interface. PR: kern/159603 Submitted by: pluknet, ambrisko at ambrisko dot com Reviewed by: discussed on net@ Approved by: re (bz) MFC after: 3 days
* Increase the defaults for the maximum socket buffer limit,bz2011-08-252-2/+2
| | | | | | | | | | | | | | | | | | and the maximum TCP send and receive buffer limits from 256kB to 2MB. For sb_max_adj we need to add the cast as already used in the sysctl handler to not overflow the type doing the maths. Note that this is just the defaults. They will allow more memory to be consumed per socket/connection if needed but not change the default "idle" memory consumption. All values are still tunable by sysctls. Suggested by: gnn Discussed on: arch (Mar and Aug 2011) MFC after: 3 weeks Approved by: re (kib)
* Fix compilation in case of defined(INET) && defined(IPFIREWALL_FORWARD)bz2011-08-201-5/+2
| | | | | | | | | | but no INET6. Reported by: avg Tested by: avg MFC after: 4 weeks X-MFC with: r225044 Approved by: re (kib)
* Add support for IPv6 to ipfw fwd:bz2011-08-208-55/+168
| | | | | | | | | | | | | | | | | | | Distinguish IPv4 and IPv6 addresses and optional port numbers in user space to set the option for the correct protocol family. Add support in the kernel for carrying the new IPv6 destination address and port. Add support to TCP and UDP for IPv6 and fix UDP IPv4 to not change the address in the IP header. Add support for IPv6 forwarding to a non-local destination. Add a regession test uitilizing VIMAGE to check all 20 possible combinations I could think of. Obtained from: David Dolson at Sandvine Incorporated (original version for ipfw fwd IPv6 support) Sponsored by: Sandvine Incorporated PR: bin/117214 MFC after: 4 weeks Approved by: re (kib)
* Hide IPv6 next header parsing warnings under the verbose sysctlbz2011-08-201-7/+12
| | | | | | | | so people can possibly disable it when their consoles are flooded, or enabled it for debugging. MFC after: 2 weeks Approved by: re (kib)
* After r225032 fix logging in a similar way masking the the IPv6bz2011-08-201-2/+5
| | | | | | | | | | more fragments flag off so that offset == 0 checks work properly. PR: kern/145733 Submitted by: Matthew Luckie (mjl luckie.org.nz) MFC after: 2 weeks X-MFC with: r225032 Approved by: re (kib)
* If we detect an IPv6 fragment header and it is not the first fragment,bz2011-08-201-1/+1
| | | | | | | | | | | then terminate the loop as we will not find any further headers and for short fragments this could otherwise lead to a pullup error discarding the fragment. PR: kern/145733 Submitted by: Matthew Luckie (mjl luckie.org.nz) MFC after: 2 weeks Approved by: re (kib)
* ipfw internally checks for offset == 0 to determine whether thebz2011-08-201-13/+8
| | | | | | | | | | | | | | | packet is a/the first fragment or not. For IPv6 we have added the "more fragments" flag as well to be able to determine on whether there will be more as we do not have the fragment header avaialble for logging, while for IPv4 this information can be derived directly from the IPv4 header. This allowed fragmented packets to bypass normal rules as proper masking was not done when checking offset. Split variables to not need masking for IPv6 to avoid further errors. PR: kern/145733 Submitted by: Matthew Luckie (mjl luckie.org.nz) MFC after: 2 weeks Approved by: re (kib)
* While not explicitly allowed by RFC 2460, in case there is nobz2011-08-201-5/+16
| | | | | | | | | | | | | | | | translation technology involved (and that section is suggested to be removed by Errata 2843), single packet fragments do not harm. There is another errata under discussion to clarify and allow this. Meanwhile add a sysctl to allow disabling this behaviour again. We will treat single packet fragment (a fragment header added when not needed) as if there was no fragment header. PR: kern/145733 Submitted by: Matthew Luckie (mjl luckie.org.nz) (original version) Tested by: Matthew Luckie (mjl luckie.org.nz) MFC after: 2 weeks Approved by: re (kib)
* Fix the handling of [gs]etsockopt() unconnected 1-to-1 style sockets.tuexen2011-08-161-37/+114
| | | | | | | | | | While there: * Fix a locking issue in setsockopt() of SCTP_CMT_ON_OFF. * Fix a bug in setsockopt() of SCTP_DEFAULT_PRINFO, where the pr_value was ignored. Approved by: re@ MFC after: 2 months.
* Add support for the spp_dscp field in the SCTP_PEER_ADDR_PARAMStuexen2011-08-146-40/+28
| | | | | | | | socket option. Backwards compatibility is provided by still supporting the spp_ipv4_tos field. Approved by: re@ MFC after: 2 months.
* If RTF_HOST flag is specified, then we are interested in destinationkevlo2011-08-101-1/+1
| | | | | | | | address. PR: kern/159600 Submitted by: Svatopluk Kraus <onwahe at gmail dot com> Approved by: re (hrs)
* The result of a joint work between rrs@ and myself at the IETF:tuexen2011-08-0320-1404/+1079
| | | | | | | | | | | * Decouple the path supervision using a separate HB timer per path. * Add support for potentially failed state. * Bring back RTO.min to 1 second. * Accept packets on IP-addresses already announced via an ASCONF * While there: do some cleanups. Approved by: re@ MFC after: 2 months.
* Add missing break; in r223593.glebius2011-08-011-0/+1
| | | | | | Submitted by: sem Pointy hat to: glebius Approved by: re (kib)
* Add spares to the network stack for FreeBSD-9:bz2011-07-173-4/+8
| | | | | | | | | | | | | - TCP keep* timers - TCP UTO (adjust from what was there already) - netmap - route caching - user cookie (temporary to allow for the real fix) Slightly re-shuffle struct ifnet moving fields out of the middle of spares and to better align. Discussed with: rwatson (slightly earlier version)
* Unbreak no-INET kernels after r223839 adding the needed #ifdef INET.bz2011-07-141-0/+2
| | | | MFC after: 4 weeks
* Don't check for SOCK_DGRAM anymore. Also remove multicasttuexen2011-07-121-9/+1
| | | | related code which is not necessary anymore.
OpenPOWER on IntegriCloud