aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/sctp_usrreq.c
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2009-09-16 14:23:31 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2009-09-16 14:23:31 +0000
commitd830c305ea38d44ac4fc84a5a53d26dc046dd1eb (patch)
tree2cf157bf2370fe31358177f8893bbca4da379548 /sys/netinet/sctp_usrreq.c
parent22c125a1b6860f6626039f3180d39b03c53ccd92 (diff)
downloadsrc-d830c305ea38d44ac4fc84a5a53d26dc046dd1eb.tar.gz
src-d830c305ea38d44ac4fc84a5a53d26dc046dd1eb.zip
Fix a bug reported by Daniel Mentz:
When authenticating DATA chunks some DATA chunks might get stuck when the MTU gets decreased via an ICMP message. Approved by: rrs (mentor) MFC after: immediately
Notes
Notes: svn path=/head/; revision=197257
Diffstat (limited to 'sys/netinet/sctp_usrreq.c')
-rw-r--r--sys/netinet/sctp_usrreq.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c
index c80cca0cc8f3..4442f11befba 100644
--- a/sys/netinet/sctp_usrreq.c
+++ b/sys/netinet/sctp_usrreq.c
@@ -106,6 +106,7 @@ sctp_pathmtu_adjustment(struct sctp_inpcb *inp,
uint16_t nxtsz)
{
struct sctp_tmit_chunk *chk;
+ uint16_t overhead;
/* Adjust that too */
stcb->asoc.smallest_mtu = nxtsz;
@@ -114,13 +115,17 @@ sctp_pathmtu_adjustment(struct sctp_inpcb *inp,
SCTP_PRINTF("sctp_pathmtu_adjust called inp:%p stcb:%p net:%p nxtsz:%d\n",
inp, stcb, net, nxtsz);
#endif
+ overhead = IP_HDR_SIZE;
+ if (sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.peer_auth_chunks)) {
+ overhead += sctp_get_auth_chunk_len(stcb->asoc.peer_hmac_id);
+ }
TAILQ_FOREACH(chk, &stcb->asoc.send_queue, sctp_next) {
- if ((chk->send_size + IP_HDR_SIZE) > nxtsz) {
+ if ((chk->send_size + overhead) > nxtsz) {
chk->flags |= CHUNK_FLAGS_FRAGMENT_OK;
}
}
TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) {
- if ((chk->send_size + IP_HDR_SIZE) > nxtsz) {
+ if ((chk->send_size + overhead) > nxtsz) {
/*
* For this guy we also mark for immediate resend
* since we sent to big of chunk