Commit Graph

4368 Commits

Author SHA1 Message Date
Maksim Yevmenkin
77d396fd18 Plug more refcount leaks and possible NULL deref for interface
address list.

Submitted by:	scottl@
MFC after:	3 days
2012-06-04 18:43:51 +00:00
Michael Tuexen
2faa5be555 Remove code which is not needed.
MFC after: 3 days
2012-06-03 18:14:57 +00:00
Michael Tuexen
b82bd838f6 Use an existing function to get the source address.
MFC after: 3 days
2012-06-03 14:54:50 +00:00
Michael Tuexen
2566e071ec Honor sysctl for TTL.
MFC after: 3 days
2012-06-02 21:22:26 +00:00
Michael Tuexen
962cef4089 Don't request data from the IPv6 layer, which is not used.
MFC after: 3 days
2012-06-02 20:53:23 +00:00
Michael Tuexen
021416fb85 Remove an unused parameter.
MFC after: 3 days
2012-06-02 13:13:38 +00:00
Bjoern A. Zeeb
5fa2656e55 Make TCP LRO work properly with VIMAGE kernels rather than just panicing.
There's no VIMAGE context set there yet as this is before if_ethersubr.c.

MFC after:	3 days
X-MFC with:	r235981
2012-06-01 11:42:50 +00:00
Michael Tuexen
11ef11db47 Small cleanups. No functional change.
MFC after: 3 days
2012-06-01 08:26:50 +00:00
Michael Tuexen
a6cff10f2a Seperate SCTP checksum offloading for IPv4 and IPv6.
While there: remove some trainling whitespaces.

MFC after: 3 days
X-MFC with: 236170
2012-05-30 20:56:07 +00:00
Gleb Smirnoff
eaf151c49d Improve style(9) of bcopy() to and from mbuf tag.
Submitted by:	bde
2012-05-30 13:51:00 +00:00
Gleb Smirnoff
a856ddc665 After r228571 carp_output() expects carp_softc * pointer in the mtag.
Noticed by:	thompsa
2012-05-30 07:11:27 +00:00
Bjoern A. Zeeb
356ab07e2d It turns out that too many drivers are not only parsing the L2/3/4
headers for TSO but also for generic checksum offloading.  Ideally we
would only have one common function shared amongst all drivers, and
perhaps when updating them for IPv6 we should introduce that.
Eventually we should provide the meta information along with mbufs to
avoid (re-)parsing entirely.

To not break IPv6 (checksums and offload) and to be able to MFC the
changes without risking to hurt 3rd party drivers, duplicate the v4
framework, as other OSes have done as well.

Introduce interface capability flags for TX/RX checksum offload with
IPv6, to allow independent toggling (where possible).  Add CSUM_*_IPV6
flags for UDP/TCP over IPv6, and reserve further for SCTP, and IPv6
fragmentation.  Define CSUM_DELAY_DATA_IPV6 as we do for legacy IP and
add an alias for CSUM_DATA_VALID_IPV6.

This pretty much brings IPv6 handling in line with IPv4.
TSO is still handled in a different way and not via if_hwassist.

Update ifconfig to allow (un)setting of the new capability flags.
Update loopback to announce the new capabilities and if_hwassist flags.

Individual driver updates will have to follow, as will SCTP.

Reported by:	gallatin, dim, ..
Reviewed by:	gallatin (glanced at?)
MFC after:	3 days
X-MFC with:	r235961,235959,235958
2012-05-28 09:30:13 +00:00
Ed Maste
0615959a81 Add IPPROTO_MPLS (rfc4023) IP protocol definition
There are currently no in-tree consumers; I'm adding it now for use by
vendor code.  This matches the change OpenBSD made while implementing
MPLS in gif(4).
2012-05-27 16:16:28 +00:00
Bjoern A. Zeeb
cace7064fc Trim the extra $FreeBSD$ from the comment below the license. We use
the __FBSDID() macro on the file now instead.

MFC after:	3 days
2012-05-26 10:28:11 +00:00
Michael Tuexen
8d9638ab33 Get rid of SCTP specific code to avoid CRC32C computations on loopback.
Just just offloading.
MFC after: 3 days
2012-05-26 09:16:33 +00:00
Michael Tuexen
430061cf18 Undefine SCTP_PACKED before including sctp_uio.h, which doesn't
use it. Spotted by Irene Ruengeler.

MFC after: 3 days
2012-05-25 11:14:08 +00:00
Bjoern A. Zeeb
0cfdff24d2 MFp4 bz_ipv6_fast:
Properly protect the inp read access when handling the control code.
  In the past this was expensive but given the rlock it's not so much
  anymore.

  Spotted while:	optimizing udp6
  Discussed with:	rwatson (a few months ago)

  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems

Reviewed by:	gnn (as part of the whole)
MFC After:	3 days
2012-05-25 09:24:45 +00:00
Bjoern A. Zeeb
31bfc56ecd In case forwarding is turned on for a given address family, refuse to
queue the packet for LRO and tell the driver to directly pass it on.
This avoids re-assembly and later re-fragmentation problems when
forwarding.

It's not the best solution but the simplest and most effective for
the moment.

Should have been done:	ages ago
Discussed with and by:	many
MFC after:		3 days
2012-05-25 08:17:59 +00:00
Bjoern A. Zeeb
45747ba53c MFp4 bz_ipv6_fast:
Add code to handle pre-checked TCP checksums as indicated by mbuf
  flags to save the entire computation for validation if not needed.

  In the IPv6 TCP output path only compute the pseudo-header checksum,
  set the checksum offset in the mbuf field along the appropriate flag
  as done in IPv4.

  In tcp_respond() just initialize the IPv6 payload length to 0 as
  ip6_output() will properly set it.

  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems

Reviewed by:	gnn (as part of the whole)
MFC After:	3 days
2012-05-25 02:23:26 +00:00
Bjoern A. Zeeb
3a9391defb MFp4 bz_ipv6_fast:
Factor out the tcp_hc_getmtu() call.  As the comments say it
  applies to both v4 and v6, so only write it once making it easier
  to read the protocol family specifc code.

  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems

Reviewed by:	gnn (as part of the whole)
MFC After:	3 days
2012-05-25 01:13:39 +00:00
Bjoern A. Zeeb
62b5b6ecd0 MFp4 bz_ipv6_fast:
Significantly update tcp_lro for mostly two things:
  1) introduce basic support for IPv6 without extension headers.
  2) try hard to also get the incremental checksum updates right,
     especially also in the IPv4 case for the IP and TCP header.

  Move variables around for better locality, factor things out into
  functions, allow checksum updates to be compiled out, ...

  Leave a few comments on further things to look at in the future,
  though that is not the full list.

  Update drivers with appropriate #includes as needed for IPv6 data
  type in LRO.

  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems

Reviewed by:	gnn (as part of the whole)
MFC After:	3 days
2012-05-24 23:03:23 +00:00
Michael Tuexen
14ce0c0c80 Add sn_send_failed_event to sctp_notification.
MFC after: 3 days
2012-05-24 11:52:57 +00:00
Michael Tuexen
807aad636f Use consistent text at the begining of the files.
MFC after: 3 days
2012-05-23 11:26:28 +00:00
Marcel Moolenaar
157bb65afd Remove unused inclusion of curses.h 2012-05-19 05:14:24 +00:00
Michael Tuexen
635b6ff793 Use a default for max_burst of 4 and l2var of 2.
This was discussed with rrs@.

MFC after: 3 days
2012-05-17 18:12:24 +00:00
Michael Tuexen
8b42cfa708 Support SCTP_EOF also for 1-to-1 style sockets.
MFC after: 3 days
2012-05-17 17:02:47 +00:00
Bjoern A. Zeeb
27f190a3ca Switch to a standard 2 clause BSD license (from bsd-style-copyright).
Approved by:	Myricom Inc. (gallatin)
Approved by:	Intel Corporation (jfv)
2012-05-15 13:23:44 +00:00
Michael Tuexen
389b1b118c Support SCTP_REMOTE_ERROR notification.
MFC after: 3 days
2012-05-13 22:27:54 +00:00
Michael Tuexen
1edc9dbae5 Provide in the SCTP_SEND_FAILED and SCTP_SEND_FAILED_EVENT notifications
the correct ssf_error or ssfe_error as required by RFC 6458.

MFC after: 3 days
2012-05-13 19:32:49 +00:00
Michael Tuexen
4b1f78e1af Provide the error code in SCTP_PEER_ADDR_CHANGE notifications as
specified in RFC 6458.

MFC after: 3 days
2012-05-13 17:36:04 +00:00
Michael Tuexen
b342faf4bf Remove unused constants.
MFC after: 3 days
2012-05-13 17:17:13 +00:00
Michael Tuexen
410a3b1ef0 Use ECONNABORTED in cases where the ABORT was sent to the peer.
MFC after: 3 days
2012-05-13 16:56:16 +00:00
Michael Tuexen
58411b0821 Ensure the user can read COMM_LOST notifications on 1-to-1 style sockets.
MFC after: 3 days
2012-05-13 16:07:53 +00:00
Michael Tuexen
a2b42326b5 Provide in the association change notification the received ABORT chunk
if case of SCTP_COMM_LOST or SCTP_CANT_STR_ASSOC as required by RFC 6458.

MFC after: 3 days
2012-05-12 20:11:35 +00:00
Glen Barber
a3fb6da9ba General mdoc(7) and typo fixes.
PR:		167734
Submitted by:	Nobuyuki Koganemaru (kogane!jp.freebsd.org)
MFC after:	3 days
2012-05-11 20:06:46 +00:00
Michael Tuexen
ce228dab70 Fix a bug in the handling of association reset request.
MFC after: 3 days
2012-05-11 19:15:33 +00:00
Michael Tuexen
c5b5675d10 Only provide the supported features in the SCTP_ASSOC_CHANGE notif
if the state is SCTP_COMM_UP or SCTP_RESTART.
While there, do some cleanups.

MFC after: 3 days
2012-05-11 18:07:36 +00:00
Michael Tuexen
07d249d661 Remove a constant which is only used on non-FreeBSD platform.
(The actual code for the socket option handling has been #ifdefed
out forever...)

MFC after: 3 days.
2012-05-11 17:50:51 +00:00
Michael Tuexen
8c501e516b Address clang warnings.
MFC after: 3 days
2012-05-06 14:50:54 +00:00
Michael Tuexen
e06b67c756 Add support for the sac_info field in struct sctp_assoc_change
as required by RFC 6458.

MFC after: 3 days
2012-05-06 13:09:13 +00:00
Michael Tuexen
3f826ed2f3 Remove debug code.
MFC after: 3 days
2012-05-06 11:37:41 +00:00
Michael Tuexen
9935403ae1 Add support for SCTP_SEND_FAILED_EVENT as required by RFC 6458.
MFC after: 3 days
2012-05-06 11:02:53 +00:00
Michael Tuexen
d426064666 Provide the flags in the SCTP stream reconfig related notification
as specified in RFC 6525.

MFC after: 3 days
2012-05-05 21:41:16 +00:00
Michael Tuexen
f3ebe64c9e Honor SCTP_ENABLE_STREAM_RESET socket option when processing incoming
requests. Fix also the provided result in the response and use names
as specified in RFC 6525.

MFC after: 3 days
2012-05-05 20:07:33 +00:00
Michael Tuexen
f6faece611 Do error checking for the SCTP_RESET_STREAMS, SCTP_RESET_ASSOC,
and SCTP_ADD_STREAMS socket options as specified by RFC 6525.

MFC after: 3 days
2012-05-05 14:06:15 +00:00
Xin LI
74882260fa Add ToS definitions for DiffServ Codepoints as per RFC2474.
Obtained from:	OpenBSD
MFC after:	2 weeks
2012-05-04 21:00:32 +00:00
Michael Tuexen
cdedb5425c Add support for the SCTP_ENABLE_STREAM_RESET socket option to
getsockopt(). This improves the support of RFC 6525.

MFC after: 3 days
2012-05-04 17:18:02 +00:00
Michael Tuexen
88d935dad7 Add support for SCTP_STREAM_CHANGE_EVENT, SCTP_ASSOC_RESET_EVENT as
required by RFC 6525. This also fixes SCTP_STREAM_RESET_EVENT.

MFC after: 3 days
2012-05-04 15:49:08 +00:00
Michael Tuexen
7d44bb8b14 Call panic() only under INVARIANTS.
MFC after: 3 days
2012-05-04 10:06:08 +00:00
Michael Tuexen
cd3fd53188 Use SCTP_PRINTF() instead of printf() in all SCTP sources.
MFC after: 3 days
2012-05-04 09:27:00 +00:00