summaryrefslogtreecommitdiffstats
path: root/sys/netinet
Commit message (Collapse)AuthorAgeFilesLines
* MFC r273087 (with modifications):ae2014-12-232-294/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | Overhaul if_gif(4): o convert to if_transmit; o use rmlock to protect access to gif_softc; o use sx lock to protect from concurrent ioctls; o remove a lot of unneeded and duplicated code; o remove cached route support (it won't work with concurrent io); o style fixes. MFC r273090: Move memset under ifdef INET6. MFC r273091: Add more ifdefs. SIOC*_IN6 are defined only with INET6. MFC r273121: Add inet/inet6 to the dependency list. Without them if_gif is useless. MFC r273209 by bz: After r273087,r273090,r273091,r273121 changes to gif(4) try to fix NOIP builds for real. MFC r273587: Remove redundant check and m_pullup() call.
* MFC r264321, r264342, r264351, r264356, r273850, r274629:jch2014-12-025-29/+147
| | | | | | | | | | | | | | Currently, the TCP slow timer can starve TCP input processing while it walks the list of connections in TIME_WAIT closing expired connections due to contention on the global TCP pcbinfo lock. To remediate, introduce a new global lock to protect the list of connections in TIME_WAIT. Only acquire the TCP pcbinfo lock when closing an expired connection. This limits the window of time when TCP input processing is stopped to the amount of time needed to close a single connection. Approved by: jhb (mentor)
* MFC r274376:hselasky2014-11-191-8/+8
| | | | | | | | | Fix some minor TSO issues: - Improve description of TSO limits. - Remove a not needed KASSERT() - Remove some not needed variable casts. Sponsored by: Mellanox Technologies
* MFC r272844:bryanv2014-11-081-0/+3
| | | | Add missing UDP multicast receive dtrace probes
* MFC r272797:bryanv2014-11-081-5/+4
| | | | | | | | | | | | Check for mbuf copy failure when there are multiple multicast sockets This partitular case is the only path where the mbuf could be NULL. udp_append() checked for a NULL mbuf only after invoking the tunneling callback. Our only in tree tunneling callback - SCTP - assumed a non NULL mbuf, and it is a bit odd to make the callbacks responsible for checking this condition. This also reduces the differences between the IPv4 and IPv6 code.
* MFC r271946 and r272595:hselasky2014-11-034-13/+107
| | | | | | | | | Improve transmit sending offload, TSO, algorithm in general. This change allows all HCAs from Mellanox Technologies to function properly when TSO is enabled. See r271946 and r272595 for more details about this commit. Sponsored by: Mellanox Technologies
* MFC r272770:ae2014-10-301-1/+1
| | | | | | | | | | | When tunneling interface is going to insert mbuf into netisr queue after stripping outer header, consider it as new packet and clear the protocols flags. This fixes problems when IPSEC traffic goes through various tunnels and router doesn't send ICMP/ICMPv6 errors. PR: 174602 Sponsored by: Yandex LLC
* MFC r273733, r273740 and r273773:hselasky2014-10-303-57/+69
| | | | | | | | | | The SYSCTL data pointers can come from userspace and must not be directly accessed. Although this will work on some platforms, it can throw an exception if the pointer is invalid and then panic the kernel. Add a missing SYSCTL_IN() of "SCTP_BASE_STATS" structure. Sponsored by: Mellanox Technologies
* MFC r266842: netinet/in.h: Expose htonl(), htons(), ntohl() and ntohs() injilles2014-10-291-2/+2
| | | | | | | | | | | | | | | strict POSIX mode. Put the htonl(), htons(), ntohl() and ntohs() declarations under __POSIX_VISIBLE >= 200112. POSIX.1-2001 and newer require these to be exposed from <netinet/in.h> (as well as <arpa/inet.h>). Note that it may be unnecessary to check __POSIX_VISIBLE >= 200112 because older versions of POSIX and the C standard do not define this header. However, other places in the same file already perform the check. PR: 188316 Submitted by: Christian Neukirchen
* MFC r272720, 273061, 273062, 273063, 273064sbruno2014-10-293-2/+182
| | | | | | | | | Implement PLPMTUD blackhole detection (RFC 4821), inspired by code from xnu sources. If we encounter a network where ICMP is blocked the Needs Frag indicator may not propagate back to us. Attempt to downshift the mss once to a preconfigured value. Note, this is turned off by default.
* MFC r263710, r273377, r273378, r273423 and r273455:hselasky2014-10-272-3/+3
| | | | | | | - De-vnet hash sizes and hash masks. - Fix multiple issues related to arguments passed to SYSCTL macros. Sponsored by: Mellanox Technologies
* MFC 273168:tuexen2014-10-193-17/+24
| | | | | | | Fix the reported streams in a SCTP_STREAM_RESET_EVENT, if a sent incoming stream reset request was responded with failed or denied. Thanks to Peter Bostroem from Google for reporting the issue.
* MFC r272841:tuexen2014-10-122-24/+29
| | | | | Ensure that the flags field of sctp_tmit_chunks is initialized. Thanks to Peter Bostroem from Google for reporting the issue.
* MFC r272751:tuexen2014-10-122-3/+11
| | | | | | Ensure that the list of streams sent in a stream reset parameter fits in an mbuf-cluster. Thanks to Peter Bostroem for drawing my attention to this part of the code.
* MFC r272750:tuexen2014-10-121-0/+6
| | | | | | | | Ensure that the number of stream reported in srs_number_streams is consistent with the amount of data provided in the SCTP_RESET_STREAMS socket option. Thanks to Peter Bostroem from Google for drawing my attention to this part of the code.
* MFC r272571:tuexen2014-10-121-7/+0
| | | | Remove unused MC_ALIGN macro as suggested by Robert.
* MFC r271628:hrs2014-10-091-5/+5
| | | | Use generic SYSCTL_* macro instead of deprecated SYSCTL_VNET_*.
* MFC r271545, 271610:hrs2014-10-093-18/+22
| | | | | Make net.inet.ip.sourceroute, net.inet.ip.accept_sourceroute, and net.inet.ip.process_options vnet-aware.
* MFC r269054:hrs2014-10-091-0/+2
| | | | | | | | Fix EtherIP. TOS field must be initialized when the inner protocol is PF_LINK, and multicast/broadcast flag should always be dropped because the outer protocol uses unicast even when the inner address is not for unicast. It had been broken since r236951 when gif_output() started to use IFQ_HANDOFF().
* MFC r272347:tuexen2014-10-061-1/+1
| | | | | | | | The default for UDPLITE_RECV_CSCOV is zero. RFC 3828 recommend that this means full checksum coverage for received packets. If an application is willing to accept packets with partial coverage, it is expected to use the socket option and provide the minimum coverage it accepts.
* MFC r272326:tuexen2014-10-061-2/+10
| | | | | UDPLite requires a checksum. Therefore, discard a received packet if the checksum is 0.
* MFC r272323:tuexen2014-10-061-2/+3
| | | | | | If the checksum coverage field in the UDPLITE header is the length of the complete UDPLITE packet, the packet has full checksum coverage. So fix the condition.
* MFC r272263:tuexen2014-10-061-1/+1
| | | | | Checksum coverage values larger than 65535 for UDPLite are invalid. Check for this when the user calls setsockopt using UDPLITE_{SEND,RECV}CSCOV.
* MFC r271643:tuexen2014-09-189-21/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chunk IDs are 8 bit entities, not 16 bit. Thanks to Peter Kasting from Google for drawing my attention to it. MFC r271665: The MTU is handled as a 32-bit entity within the SCTP stack. This was reported by Peter Kasting from Google. MFC r271670: Make a type conversion explicit. When compiling this code on Windows as part of the SCTP userland stack, this fixes a warning reported by Peter Kasting from Google. MFC r271672: Small cleanup which addresses a warning regaring the truncation of a 64-bit entity to a 32-bit entity. This issue was reported by Peter Kasting from Google. MFC r271673: Use a consistent type for the number of HMAC algorithms. This fixes a bug which resulted in a warning on the userland stack, when compiled on Windows. Thanks to Peter Kasting from Google for reporting the issue and provinding a potential fix. MFC r271674: Add a explict cast to silence a warning when building the userland stack on Windows. This issue was reported by Peter Kasting from Google. Approved by: re (kib)
* MFC r270673:tuexen2014-09-1810-644/+289
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Announce SCTP support in the kern.features sysctl variables. MFC r270859: Enable SCTP support. It runs perfectly fine on a Wandboard quad. MFC r271204 with manual intervention: Fix the handling of sysctl variables when used with VIMAGE. While there do some cleanup of the code. MFC r271209: Fix a leak of an address, if the address is scheduled for removal and the stack is torn down. Thanks to Peter Bostroem and Jiayang Liu from Google for reporting the issue. MFC r271219: Use SYSCTL_PROC instead of SYSCTL_VNET_PROC. Suggested by: glebius@ MFC r271221: Use union sctp_sockstore instead of struct sockaddr_storage. This eliminates some warnings when building in userland. Thanks to Patrick Laimbock for reporting this issue. Remove also some unnecessary casts. There should be no functional change. MFC r271228: Address another warnings reported by Patrick Laimbock when compiling in userspace. While there, improve consistency. MFC r271230: Address warnings generated by the clang analyzer. Approved by: re (kib)
* MFC r270160:lstewart2014-09-161-1/+11
| | | | | | | | Destroy the "qdiffsample_zone" UMA zone on unload to avoid a use-after-unload panic easily triggered by running "sysctl -a" after unload. Reported and tested by: Grenville Armitage <garmitage@swin.edu.au> Approved by: re(gjb)
* Fix Denial of Service in TCP packet processing.delphij2014-09-161-5/+1
| | | | | Security: FreeBSD-SA-14:19.tcp Approved by: re (implicit, security advisory)
* MFC r269777:hselasky2014-08-271-2/+2
| | | | | | | | Fix string length argument passed to "sysctl_handle_string()" so that the complete string is returned by the function and not just only one byte. PR: 192544
* Remove debug output which was comitted by accident.tuexen2014-08-221-1/+0
| | | | This is a direct commit to stable/10.
* MFC r269945:tuexen2014-08-227-3/+169
| | | | | | | | Add support for the SCTP_PR_STREAM_STATUS and SCTP_PR_ASSOC_STATUS socket options. This includes managing the correspoing stat counters. Add the SCTP_DETAILED_STR_STATS kernel option to control per policy counters on every stream. The default is off and only an aggregated counter is available. This is sufficient for the RTCWeb usecase.
* MFC r269858:tuexen2014-08-2214-164/+388
| | | | | Add support for the SCTP_AUTH_SUPPORTED and SCTP_ASCONF_SUPPORTED socket options. Add also a sysctl to control the support of ASCONF.
* MFC r269527:tuexen2014-08-2211-14/+94
| | | | | Add support for the SCTP_RECONFIG_SUPPORTED and the corresponding sysctl controlling the negotiation of the RE-CONFIG extension.
* MFC r269481:tuexen2014-08-2211-11/+87
| | | | | | Add support for the SCTP_PKTDROP_SUPPORTED socket option and the corresponding sysctl variable. The default is off, since the specification is not an RFC yet.
* MFC r269475:tuexen2014-08-2211-29/+86
| | | | | | | Add SCTP socket option SCTP_NRSACK_SUPPORTED to control the NRSACK extension. The default will still be off, since it it not an RFC (yet). Changing the sysctl name will be in a separate commit.
* MFC r269448:tuexen2014-08-2213-38/+122
| | | | | | Add support for the SCTP_PR_SUPPORTED socket option as specified in http://tools.ietf.org/html/draft-ietf-tsvwg-sctp-prpolicies Add also a sysctl controlling the default of the end-points.
* MFC r269436, r269445:tuexen2014-08-229-17/+72
| | | | | | | | Cleanup the ECN configuration handling and provide an SCTP socket option for controlling ECN on future associations and get the status on current associations. A simialar pattern will be used for controlling SCTP extensions in upcoming commits.
* MFC r269396:tuexen2014-08-224-17/+2
| | | | | Remove the asconf_auth_nochk sysctl. This was off by default and only existed to be able to test with non-compliant peers a long time ago.
* MFC r269376:tuexen2014-08-226-270/+220
| | | | | Cleanup sctp_send_initiate() and sctp_send_initiate_ack() to be in sync as much as possible. This simplifies upcoming changes.
* MFC r269075:tuexen2014-08-221-0/+2
| | | | | Initialize notification structures. This was missed in an earlier commit
* MFC r268537:tuexen2014-08-223-58/+58
| | | | Whitespace changes.
* MFC r268534:tuexen2014-08-221-4/+10
| | | | | | | | | Bugfix: When a remote address was added to an endpoint, a source address was selected and cached, but it was not stored that is was cached. This resulted in selecting different source addresses for the INIT-ACK and COOKIE-ACK when possible. Thanks to Niu Zhixiong for reporting the issue.
* MFC r268526:tuexen2014-08-226-4/+29
| | | | Integrate upstream changes.
* MFC r266907:bz2014-08-161-1/+1
| | | | | While PAWS is disabled, there are no consumers for the tcp options argument to tcp_twcheck(); thus mark it __unused.
* MFC r266620:bz2014-08-161-4/+0
| | | | | | Remove the prototpye for the static inline function tcp_signature_verify_input(). The function is defined before first use already.
* MFC r266619:bz2014-08-161-2/+1
| | | | | syncache_lookup() is a file local function. Make it static and take it out of the public KPI; seems it was never used elsewhere.
* MFC r266618:bz2014-08-162-2/+2
| | | | | Make tcp_twrespond() file local private; this removes it from the public KPI; it is not used anywhere else and seems it never was.
* MFC r266597:bz2014-08-161-2/+0
| | | | | | | | Remove the prototypes for things that are no longer file local but were moved to the header file. Was suppoed to be MFCed with: r266596 Pointy hat to: bz
* MFC r266596:bz2014-08-162-20/+21
| | | | | | | | Move the tcp_fields_to_host() and tcp_fields_to_net() (inline) functions to the tcp_var.h header file in order to avoid further duplication with upcoming commits. Reviewed by: np
* MFC r268450 (by glebius). The leak affects stable/10 too.np2014-07-211-1/+14
| | | | | In several cases in ip_output() we obtain reference on ifa. Do not leak it.
* Fix kernel memory disclosure in control message and SCTP notifications.delphij2014-07-083-27/+34
| | | | | Security: FreeBSD-SA-14:17.kmem Security: CVE-2014-3952, CVE-2014-3953
OpenPOWER on IntegriCloud