Fix MTU computation.
@@ -4482,12 +4482,12 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
mtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, ro->ro_rt);
if (mtu > 0) {
- if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) {
- sctp_mtu_size_reset(inp, &stcb->asoc, mtu);
- }
if (net->port) {
mtu -= sizeof(struct udphdr);
}
+ if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) {
+ sctp_mtu_size_reset(inp, &stcb->asoc, mtu);
+ }
net->mtu = mtu;
}
} else if (ro->ro_rt == NULL) {
@@ -4952,12 +4952,12 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
mtu = SCTP_GATHER_MTU_FROM_ROUTE(net->ro._s_addr, &net->ro._l_addr.sa, ro->ro_rt);
if (mtu > 0) {
- if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) {
- sctp_mtu_size_reset(inp, &stcb->asoc, mtu);
- }
if (net->port) {
mtu -= sizeof(struct udphdr);
}
+ if ((stcb != NULL) && (stcb->asoc.smallest_mtu > mtu)) {
+ sctp_mtu_size_reset(inp, &stcb->asoc, mtu);
+ }
net->mtu = mtu;
}
}
