Skip to content

Commit

Permalink
Revert "sctp: remove sctp_transport_pmtu_check"
Browse files Browse the repository at this point in the history
This reverts commit 22d7be2.

The dst's mtu in transport can be updated by a non sctp place like
in xfrm where the MTU information didn't get synced between asoc,
transport and dst, so it is still needed to do the pmtu check
in sctp_packet_config.

Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Xin Long authored and David S. Miller committed Nov 19, 2018
1 parent cc3ccf2 commit 69fec32
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/net/sctp/sctp.h
Original file line number Diff line number Diff line change
Expand Up @@ -608,4 +608,16 @@ static inline __u32 sctp_dst_mtu(const struct dst_entry *dst)
SCTP_DEFAULT_MINSEGMENT));
}

static inline bool sctp_transport_pmtu_check(struct sctp_transport *t)
{
__u32 pmtu = sctp_dst_mtu(t->dst);

if (t->pathmtu == pmtu)
return true;

t->pathmtu = pmtu;

return false;
}

#endif /* __net_sctp_h__ */
3 changes: 3 additions & 0 deletions net/sctp/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ void sctp_packet_config(struct sctp_packet *packet, __u32 vtag,
sctp_transport_route(tp, NULL, sp);
if (asoc->param_flags & SPP_PMTUD_ENABLE)
sctp_assoc_sync_pmtu(asoc);
} else if (!sctp_transport_pmtu_check(tp)) {
if (asoc->param_flags & SPP_PMTUD_ENABLE)
sctp_assoc_sync_pmtu(asoc);
}

if (asoc->pmtu_pending) {
Expand Down

0 comments on commit 69fec32

Please sign in to comment.