Commit Graph

4335 Commits

Author SHA1 Message Date
tuexen
e154175378 Fix a bug in the handling of association reset request.
MFC after: 3 days
2012-05-11 19:15:33 +00:00
tuexen
a09c787d96 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
tuexen
2342ad7e9e 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
tuexen
dfb886ebd0 Address clang warnings.
MFC after: 3 days
2012-05-06 14:50:54 +00:00
tuexen
b5cb1ff1a3 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
tuexen
189b3357e6 Remove debug code.
MFC after: 3 days
2012-05-06 11:37:41 +00:00
tuexen
fd59ebc4f0 Add support for SCTP_SEND_FAILED_EVENT as required by RFC 6458.
MFC after: 3 days
2012-05-06 11:02:53 +00:00
tuexen
3527361dea 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
tuexen
17adf2710f 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
tuexen
668aa900bc 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
delphij
a1a76868b8 Add ToS definitions for DiffServ Codepoints as per RFC2474.
Obtained from:	OpenBSD
MFC after:	2 weeks
2012-05-04 21:00:32 +00:00
tuexen
6dac068475 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
tuexen
4ee7205a6e 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
tuexen
2ff0fa9520 Call panic() only under INVARIANTS.
MFC after: 3 days
2012-05-04 10:06:08 +00:00
tuexen
a91acdb88b Use SCTP_PRINTF() instead of printf() in all SCTP sources.
MFC after: 3 days
2012-05-04 09:27:00 +00:00
tuexen
5220abc054 Fix another RFC 6458 issue. Spotted by Irene Ruengeler.
MFC after: 3 days
2012-05-03 10:26:33 +00:00
melifaro
46b1e41aff Revert r234834 per luigi@ request.
Cleaner solution (e.g. adding another header) should be done here.

Original log:
  Move several enums and structures required for L2 filtering from ip_fw_private.h to ip_fw.h.
  Remove ipfw/ip_fw_private.h header from non-ipfw code.

Requested by:      luigi
Approved by:       kib(mentor)
2012-05-03 08:56:43 +00:00
melifaro
b600972ec6 Move several enums and structures required for L2 filtering from ip_fw_private.h to ip_fw.h.
Remove ipfw/ip_fw_private.h header from non-ipfw code.

Approved by:        ae(mentor)
MFC after:          2 weeks
2012-04-30 10:22:23 +00:00
tuexen
e42771f14b Add support for missing gauth_number_of_chunks field. This Bug was
found by Irene Ruengeler.

MFC after: 1 week
2012-04-30 08:44:21 +00:00
tuexen
0f8fc5e936 Whitespace changes.
MFC after: 3 days
2012-04-28 16:32:49 +00:00
tuexen
3b680d94c7 Remove unused structure.
Reported by Irene Ruengeler.

MFC after: 3 days
2012-04-27 13:58:09 +00:00
tuexen
a88e020390 Fix a type in an SCTP AUTH related notification. Keep the old name
for backwards compatibility.
Spotted by Irene Ruengeler.

MFC after: 3 days
2012-04-26 11:07:15 +00:00
tuexen
0c449daeb1 Use the flags defined in RFC 6525 in the stream reset event. 2012-04-23 20:45:31 +00:00
tuexen
968f07e10a Fix check used by stream reset related events.
MFC after: 3 days
2012-04-21 11:53:24 +00:00
tuexen
62e631ede2 Whitespace changes.
MFC after: 3 days
2012-04-19 15:30:15 +00:00
tuexen
a2f2c50988 Use the same pattern for mbuf logging everywhere.
MFC after: 3 days
2012-04-19 13:11:17 +00:00
tuexen
591060458a Fix reported errno.
MFC after: 3 days
2012-04-19 12:47:18 +00:00
tuexen
9035fb1c4c Fix a bug where we copy out more data from a mbuf chain that are
actually in it. This happens when SCTP receives an unknown chunk, which
requires the sending of an ERROR chunk, and there is no final padding but
the chunk is not 4-byte aligned.
Reported by yueting via rwatson@

MFC after: 3 days
2012-04-19 12:43:19 +00:00
glebius
9297dd4c7e When we receive an ICMP unreach need fragmentation datagram, we take
proposed MTU value from it and update the TCP host cache. Then
tcp_mss_update() is called on the corresponding tcpcb. It finds the
just allocated entry in the TCP host cache and updates MSS on the
tcpcb. And then we do a fast retransmit of what we have in the tcp
send buffer.

This sequence gets broken if the TCP host cache is exausted. In this
case allocation fails, and later called tcp_mss_update() finds nothing
in cache. The fast retransmit is done with not reduced MSS and is
immidiately replied by remote host with new ICMP datagrams and the
cycle repeats. This ping-pong can go up to wirespeed.

To fix this:
- tcp_mss_update() gets new parameter - mtuoffer, that is like
  offer, but needs to have min_protoh subtracted.
- tcp_mtudisc() as notification method renamed to tcp_mtudisc_notify().
- tcp_mtudisc() now accepts not a useless error argument, but proposed
  MTU value, that is passed to tcp_mss_update() as mtuoffer.

Reported by:	az
Reported by:	Andrey Zonov <andrey zonov.org>
Reviewed by:	andre (previous version of patch)
2012-04-16 13:49:03 +00:00
tuexen
7ad5fb0897 Send always HBs when in PF state.
MFC after: 1 week
X-MFC with: r234296
2012-04-14 21:01:44 +00:00
tuexen
bc585f5103 Bugfix: Don't send HBs on path which are not idle.
MFC after: 1 week
2012-04-14 20:22:01 +00:00
glebius
1143c81c42 It is a logical error that in carp_multicast_cleanup()
we look at count of addresses on a particular vhid, we
should account number of addresses on cif.

To achieve this we need to run carp_attach() and
carp_detach() under appropriate cif lock.
2012-04-11 12:26:30 +00:00
glebius
9a09be5774 M_DONTWAIT is a flag from historical mbuf(9)
allocator, not malloc(9) or uma(9) flag.
2012-04-10 06:52:39 +00:00
glebius
dcb2500d91 CARP should be capable to run on if_bridge(4). Unfortunately,
this commit is not enough to enable CARP operation on
if_bridge(4), because the latter doesn't handle or even
initialize its ifp->if_link_state.

Reported by:	Alexander Lunev <sol289 gmail.com>
2012-04-10 05:42:48 +00:00
tuexen
19af6e5d9d Remove duplicate condition in if statement.
Obtained from: brucec@
MFC after: 3 days
2012-04-06 09:03:02 +00:00
glebius
03c053c63d Don't check malloc(M_WAITOK) results. 2012-03-31 11:20:48 +00:00
rrs
ddfb5c5980 Make stream our stream reset implementation
compliant to RFC6525.

MFC after:	1 month
2012-03-29 13:36:53 +00:00
zec
3ce0f78a89 Permit tcpdrop in VNET jails.
Submitted by:	Miljenko Mikuc
MFC after:	3 days
2012-03-28 12:30:16 +00:00
tuexen
21244ace96 Honor the net.inet.udp.checksum sysctl when using SCTP/UDP/IPv4
encapsulation.
MFCing requires MFCing http://svn.freebsd.org/changeset/base/233554
MFC after: 2 weeks
2012-03-28 08:11:46 +00:00
bz
f89de17b69 Export the udp_cksum sysctl for upcoming SCTP work. Rather than always,
SCTP will only do IPv4 UDP checksum calculation as defined by the host
policy.  When tunneling SCTP always calculates the inner checksum already
so not doing the outer UDP can save cycles.

While here virtualize the variable.

Requested by:	tuexen
MFC after:	2 weeks
2012-03-27 15:14:29 +00:00
melifaro
97c3a90503 - Permit number of ipfw tables to be changed in runtime.
net.inet.ip.fw.tables_max is now read-write.

- Bump IPFW_TABLES_MAX to 65535
Default number of tables is still 128

- Remove IPFW_TABLES_MAX from ipfw(8) code.

Sponsored by Yandex LLC

Approved by:    kib(mentor)

MFC after:      2 weeks
2012-03-25 20:37:59 +00:00
tuexen
4666dbd7e1 Small cleanup of the code. No functional change (in FreeBSD kernel).
MFC after: 1 week.
2012-03-22 16:22:16 +00:00
rmh
26b44e3c9d Hide a few declarations from userland (including `struct inpcbgroup'). This
removes the dependency on <machine/param.h> which was introduced with SVN
rev 222748 (due to CACHE_LINE_SIZE).

Reviewed by:	bde
MFC after:	10 days
2012-03-17 21:51:39 +00:00
tuexen
52199a8cf4 Clean up, no functional change.
MFC after: 3 days.
2012-03-15 14:22:05 +00:00
tuexen
b8b34b6ecf Fix bugs which can result in a panic when an non-SCTP socket it
used with an sctp_ system-call which expects an SCTP socket.

MFC after: 3 days.
2012-03-15 14:13:38 +00:00
melifaro
45df7d437f Fix VNET build broken by r232865.
Temporary remove the ability to assign different number of tables per VNET instance.
2012-03-12 15:41:36 +00:00
rrs
83f08b992d This fixes PR 165210. Basically we just
add in the netgraph interface to the list of
acceptable interfaces. A todo at the next
IETF code blitz, though is we need to review
why we screen interfaces, there was a reason ;-).

PR:		165210
MFC after:	1 week
2012-03-12 15:05:17 +00:00
melifaro
c614ff641f - Add ipfw eXtended tables permitting radix to be used for any kind of keys.
- Add support for IPv6 and interface extended tables
- Make number of tables to be loader tunable in range 0..65534.
- Use IP_FW3 opcode for all new extended table cmds

No ABI changes are introduced. Old userland will see valid tables for
IPv4 tables and no entries otherwise. Flush works for any table.

IP_FW3 socket option is used to encapsulate all new opcodes:
 /* IP_FW3 header/opcodes */
 typedef struct _ip_fw3_opheader {
        uint16_t opcode;        /* Operation opcode */
        uint16_t reserved[3];   /* Align to 64-bit boundary */
 } ip_fw3_opheader;

New opcodes added:
 IP_FW_TABLE_XADD, IP_FW_TABLE_XDEL, IP_FW_TABLE_XGETSIZE, IP_FW_TABLE_XLIST

ipfw(8) table argument parsing behavior is changed:
 'ipfw table 999 add host' now assumes 'host' to be interface name instead of
 hostname.

New tunable:
 net.inet.ip.fw.tables_max controls number of table supported by ipfw in given
 VNET instance. 128 is still the default value.

New syntax:
ipfw add skipto tablearg ip from any to any via table(42) in
ipfw add skipto tablearg ip from any to any via table(4242) out

This is a bit hackish, special interface name '\1' is used to signal interface
table number is passed in p.glob field.

Sponsored by Yandex LLC

Reviewed by:    ae
Approved by:    ae (mentor)

MFC after:      4 weeks
2012-03-12 14:07:57 +00:00
tuexen
01f14dbd3f Fix a warning reported by bz@
MFC after: 3 days.
2012-03-09 15:42:47 +00:00
tuexen
641a744be2 Add support for stf interfaces.
MFC after: 3days.
2012-03-09 13:15:40 +00:00