diff options
author | tuexen <tuexen@FreeBSD.org> | 2015-12-02 16:29:36 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2015-12-02 16:29:36 +0000 |
commit | 9b472b7eb57ce751661cf3206c82b995e0ddff9a (patch) | |
tree | a95072f894c24e0f8369b98880742faddb83a4d9 | |
parent | d923c4f2ed5a7a6bcd81e6f89cbc8c9f80798402 (diff) | |
download | FreeBSD-src-9b472b7eb57ce751661cf3206c82b995e0ddff9a.zip FreeBSD-src-9b472b7eb57ce751661cf3206c82b995e0ddff9a.tar.gz |
Adjust the MTU when accepting an SCTP association using
UDP encapsulation.
MFC after: 1 week
-rw-r--r-- | sys/netinet/sctp_input.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 441f219..84fc3b9 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -521,7 +521,6 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, /* calculate the RTO */ net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy, SCTP_RTT_FROM_NON_DATA); - retval = sctp_send_cookie_echo(m, offset, stcb, net); if (retval < 0) { /* @@ -2347,12 +2346,17 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE, inp, stcb, NULL); } (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); - if ((netp) && (*netp)) { + if ((netp != NULL) && (*netp != NULL)) { /* calculate the RTT and set the encaps port */ (*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp, &cookie->time_entered, sctp_align_unsafe_makecopy, SCTP_RTT_FROM_NON_DATA); +#if defined(INET) || defined(INET6) + if (((*netp)->port == 0) && (port != 0)) { + sctp_pathmtu_adjustment(stcb, (*netp)->mtu - sizeof(struct udphdr)); + } (*netp)->port = port; +#endif } /* respond with a COOKIE-ACK */ sctp_send_cookie_ack(stcb); @@ -5845,7 +5849,7 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt */ inp = stcb->sctp_ep; #if defined(INET) || defined(INET6) - if ((net) && (port)) { + if ((net != NULL) && (port != 0)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } |