102292 Commits

Author SHA1 Message Date
tuexen
bbe91198b3 MFC r283665:
Take source and destination address into account when determining
the scope.
This fixes a problem when a client with a global address
connects to a server with a private address.
Thanks to Irene Ruengeler in helping me to find the issue.
2015-05-31 13:01:58 +00:00
tuexen
3a8e5cd397 MFC r283664:
Retire SCTP_DONT_DO_PRIVADDR_SCOPE which was never defined.
2015-05-31 12:59:22 +00:00
tuexen
f2a969c70c MFC r283662:
Fix a bug where messages would not be sent in SHUTDOWN_RECEIVED state.
This problem was reported by Mark Bonnekessel and Markus Boese.
Thanks to Irene Ruengeler for helping me to fix the cause of
the problem. It can be tested with the following packetdrill script:

+0.0 socket(..., SOCK_STREAM, IPPROTO_SCTP) = 3
+0.0 fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
+0.0 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
// Check the handshake with an empty(!) cookie
+0.1 connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)
+0.0 > sctp: INIT[flgs=0, tag=1, a_rwnd=..., os=..., is=..., tsn=0, ...]
+0.1 < sctp: INIT_ACK[flgs=0, tag=2, a_rwnd=10000, os=1, is=1, tsn=0, STATE_COOKIE[len=4, val=...]]
+0.0 > sctp: COOKIE_ECHO[flgs=0, len=4, val=...]
+0.1 < sctp: COOKIE_ACK[flgs=0]
+0.0 getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
+0.0 write(3, ..., 1024) = 1024
+0.0 > sctp: DATA[flgs=BE, len=1040, tsn=0, sid=0, ssn=0, ppid=0]
+0.0 write(3, ..., 1024) = 1024 // Pending due to Nagle
+0.0 < sctp: SHUTDOWN[flgs=0, cum_tsn=0]
+0.0 > sctp: DATA[flgs=BE, len=1040, tsn=1, sid=0, ssn=1, ppid=0]
+0.0 < sctp: SACK[flgs=0, cum_tsn=1, a_rwnd=10000, gaps=[], dups=[]] // Do we need another SHUTDOWN here?
+0.0 > sctp: SHUTDOWN_ACK[flgs=0]
+0.0 < sctp: SHUTDOWN_COMPLETE[flgs=0]
+0.0 close(3) = 0
2015-05-31 12:56:22 +00:00
tuexen
c07a13950d MFC r283658:
Use macros for overhead in a consistent way. No functional change.
Thanks to Irene Ruengeler for suggesting the change.
2015-05-31 12:53:16 +00:00
tuexen
4cc7a6bb7a MFC r283654:
Some more debug info cleanup.
2015-05-31 12:50:10 +00:00
tuexen
beb47cc587 MFC r283650:
Fix and cleanup the debug information. This has no user-visible changes.
Thanks to Irene Ruengeler for proving a patch.
2015-05-31 12:46:40 +00:00
tuexen
b583c15e81 MFC r283648:
Address some compiler warnings. No functional change.
2015-05-31 12:42:34 +00:00
kib
80880ee480 MFC r283320:
Always obey thread request to not stop on non-boundary.
2015-05-30 08:54:42 +00:00
erj
d390788aa7 MFC r281236 -- extended media types in if_media.h.
Approved by:	jfv (mentor)
2015-05-29 23:02:12 +00:00
davidcs
94b7042c30 MFC r283274
Submitted by:	gary.zambrano@qlogic.com
Approved by:davidcs@freebsd.org
2015-05-29 21:30:11 +00:00
davidcs
39353769d3 MFC r283269
Submitted by:gary.zambrano@qlogic.com
Approved by:davidcs@freebsd.org
2015-05-29 20:00:02 +00:00
tuexen
09fd91eb46 MFC r282810:
Ensure that the COOKIE-ACK can be sent over UDP if the COOKIE-ECHO was
received over UDP.
Thanks to Felix Weinrank for makeing me aware of the problem and to
Irene Ruengeler for providing the fix.
2015-05-29 13:37:04 +00:00
tuexen
a2dbf980ab MFC r282042:
Don't panic under INVARIANTS when receiving a SACK which cumacks
a TSN never sent.
While there, fix two typos.
2015-05-29 13:34:31 +00:00
tuexen
65d8b9f172 MFC r280714:
Improve the selection of the destination address of SACK chunks.
This fixes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196755
and is joint work with rrs@.
2015-05-29 13:26:05 +00:00
tuexen
443fcce7c9 MFC r280642:
Make sure that we don't free an SCTP shared key too early.
Thanks to Pouyan Sepehrdad from Qualcomm Product Security Initiative
for reporting the issue.
2015-05-29 13:23:16 +00:00
tuexen
6fa1d035cb MFC r280634:
Use the reference count of the right SCTP inp.
Joint work with rrs@
2015-05-29 13:20:39 +00:00
tuexen
6e64233ed9 MFC r280459:
Fix two bugs which resulted in a screwed up end point list:
* Use a save way to walk throught a list while manipulting it.
* Have to appropiate locks in place.
Joint work with rrs@
2015-05-29 13:18:10 +00:00
tuexen
d8c5ad4ada MFC r280440:
Fix the bug in the handling of fragmented abandoned SCTP user messages reported in
https://code.google.com/p/sctp-refimpl/issues/detail?id=11
Thanks to Lally Singh for reporting it.
2015-05-29 13:13:12 +00:00
tuexen
ae995cba15 MFC r280439:
Fix an accounting bug related to the per stream chunk counter.
While there, don't refer to a net articifically.
2015-05-29 13:11:13 +00:00
tuexen
b42d72caa3 MFC r280404:
When an ICMP message is received and the MTU shrinks, only
mark outstanding chunks for retransmissions.
2015-05-29 13:08:43 +00:00
tuexen
d21c3896b9 MFC r280371:
Remove a useless assignment.
2015-05-29 13:06:15 +00:00
tuexen
a29e8c28ca MFC r279886:
Fix the adaptation of the path state when thresholds are changed
using the SCTP_PEER_ADDR_THLDS socket option.
2015-05-29 13:02:00 +00:00
tuexen
16fb87c63d MFC r279867:
Keep track on the socket lock state. This fixes a bug showing up on
Mac OS X.
2015-05-29 12:59:18 +00:00
tuexen
b21153d463 MFC r279863:
Unlock the stcb when using setsockopt() for the SCTP_PEER_ADDR_THLDS option.
2015-05-29 12:57:04 +00:00
tuexen
10635a0e4c MFC r279859:
Add a SCTP socket option to limit the cwnd for each path.
2015-05-29 12:54:30 +00:00
tuexen
44f9f670c9 MFC r279841:
Fix a typo.
2015-05-29 12:50:53 +00:00
tuexen
c929c897c8 MFC r277815:
Whitespace change.
2015-05-29 12:48:14 +00:00
tuexen
03ab9820fc MFC r277424:
Remove comparisons which are not necessary.
With manual intervention.

Reported by:	Coverity
CID:		1237826, 1237844, 1237847
2015-05-29 12:45:55 +00:00
tuexen
4ed8a22fc6 MFC r277380:
Code cleanup.

Reported by:	Coverity
CID:		749578
2015-05-29 12:35:21 +00:00
tuexen
186be7c17d MFC r277350:
Fix a bug which only shows up when an mbuf allocation failed.
Therefore chances are low that we hit this.

Reported by:	Coverity
CID:		1018886
2015-05-29 12:33:02 +00:00
tuexen
7fa1168111 MFC r277348:
Remove an unnecessary check.

Reported by:	Coverity
CID:		749576
2015-05-29 12:30:19 +00:00
tuexen
e920cd42ce MFC r277347:
Add protection code to free memory in case of processing an address which
is neither IPv4 or IPv6.

Reported by:	Coverity
CID:		749311
2015-05-29 12:27:45 +00:00
tuexen
e522160ca4 MFC r277337:
Remove an unused variable.

Reported by:	Coverity
CID:		750999
2015-05-29 12:25:11 +00:00
tuexen
d303d373d1 MFC r277053:
Remove dead code.

Reported by:	Coverity
CID:		748664
2015-05-29 12:22:35 +00:00
tuexen
059450c5d6 MFC r277049:
Remove dead code.

Reported by:	Coverity
CID:		1018052
2015-05-29 12:19:41 +00:00
tuexen
f1c488bb6d MFC r277046:
Remove dead code.

Reported by:	Coverity
CID:		1018053
2015-05-29 12:17:21 +00:00
tuexen
a3f1c54c9d MFC r277034:
Remove dead code.

Reported by:	Coverity
CID:		748663
2015-05-29 12:13:52 +00:00
tuexen
b7947552da MFC r277033:
Remove dead code.

Reported by:	Coverity
CID:		748660, 748661
2015-05-29 12:11:14 +00:00
tuexen
6e1abed81c MFC r277031
Remove dead code.

Reported by:	Coverity
CID:		748665
2015-05-29 12:08:49 +00:00
tuexen
da3006cf8b MFC r277030:
Remove dead code.

Reported by:	Coverity
CID:		748666
2015-05-29 12:06:00 +00:00
tuexen
369d8e1e68 MFC r276914:
Minimize the usage of SCTP_BUF_IS_EXTENDED.
This should help Robert...
2015-05-29 12:03:02 +00:00
tuexen
9b5b9e6473 MFC r276009:
Don't check twice that inp is not NULL.

Reported by:	Coverity
CID:		748671
2015-05-29 11:52:32 +00:00
tuexen
be4dc0520d MFC r275967:
Fix and harmonize the validation of PR-SCTP policies.

Reported by:	Coverity
CID:		1232044
2015-05-29 11:47:54 +00:00
tuexen
25101e7981 MFC r275954:
Cleanup the code.

Reported by:	Coverity
CID:		1232003
2015-05-29 11:43:51 +00:00
tuexen
0a467bef43 MFC r275869:
Add a missing break.

Reported by:	Coverity
CID:		1232014
2015-05-29 11:40:50 +00:00
tuexen
551a3dd3e4 MFC r275868:
Plug a memory leak in an error code path.

Reported by:	Coverity
CID:		1018936
2015-05-29 11:25:38 +00:00
tuexen
76a9701748 MFC r275574:
Include the received chunk padding when reporting an unknown chunk.
2015-05-29 11:18:06 +00:00
tuexen
4e7201cd30 MFC r275567:
Fix the support of mapped IPv4 addresses.
Thanks to Mark Bonnekessel and Markus Boese for making me aware of the
problems.
2015-05-29 11:15:00 +00:00
tuexen
3c88229c08 MFC r273925:
Don't zero the stats before they are read out.
2015-05-29 11:04:55 +00:00
tuexen
1076c79452 MFC r273634:
Fix a use of an uninitialized variable by makeing sure
that sctp_med_chunk_output() always initialized the reason_code
instead of relying on the caller.
The variable is only used for debugging purpose.
This issue was reported by Peter Bostroem from Google.
2015-05-29 11:01:46 +00:00