diff options
author | tuexen <tuexen@FreeBSD.org> | 2012-01-08 09:56:24 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2012-01-08 09:56:24 +0000 |
commit | ebc0602463d35d7c9e3a52f25d6f9e806d5120dc (patch) | |
tree | 1e92913ac4b44826cabc601aa1a6d11dadb1d279 /sys/netinet6 | |
parent | 1c75fb6a4d6b5570918d1d2bf6b8b7c8eed7a2d8 (diff) | |
download | FreeBSD-src-ebc0602463d35d7c9e3a52f25d6f9e806d5120dc.zip FreeBSD-src-ebc0602463d35d7c9e3a52f25d6f9e806d5120dc.tar.gz |
Add an SCTP sysctl "blackhole", similar to the one for TCP.
If set to 1, no ABORT is sent back in response to an incoming
INIT. If set to 2, no ABORT is sent back in response to
an out of the blue packet. If set to 0 (the default), ABORTs
are sent.
Discussed with rrs@.
MFC after: 1 month.
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/sctp6_usrreq.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c index 23d3dea..c100713 100644 --- a/sys/netinet6/sctp6_usrreq.c +++ b/sys/netinet6/sctp6_usrreq.c @@ -236,8 +236,13 @@ sctp_skip_csum: if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { goto bad; } - if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) - sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { + if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || + ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && + (ch->chunk_type != SCTP_INIT))) { + sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + } + } goto bad; } else if (stcb == NULL) { refcount_up = 1; |