summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>2016-07-13 15:09:00 -0300
committerDavid S. Miller <davem@davemloft.net>2016-07-13 18:10:14 -0700
commit2d47fd120d23390fea38c3c7cc5ee05a5b95c49f (patch)
tree9ebae306004e92e2a188d933dedf889c8e66a681
parentd9cef42529402f9fce10376b6e427a5137d90c3d (diff)
downloadlwn-2d47fd120d23390fea38c3c7cc5ee05a5b95c49f.tar.gz
lwn-2d47fd120d23390fea38c3c7cc5ee05a5b95c49f.zip
sctp: only check for ECN if peer is using it
Currently only read-only checks are performed up to the point on where we check if peer is ECN capable, checks which we can avoid otherwise. The flag ecn_ce_done is only used to perform this check once per incoming packet, and nothing more. Thus this patch moves the peer check up. Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/sctp/sm_statefuns.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index b7c1f7f3c838..d88bb2b0b699 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -6118,12 +6118,11 @@ static int sctp_eat_data(const struct sctp_association *asoc,
* chunk later.
*/
- if (!chunk->ecn_ce_done) {
+ if (asoc->peer.ecn_capable && !chunk->ecn_ce_done) {
struct sctp_af *af = SCTP_INPUT_CB(chunk->skb)->af;
chunk->ecn_ce_done = 1;
- if (af->is_ce(sctp_gso_headskb(chunk->skb)) &&
- asoc->peer.ecn_capable) {
+ if (af->is_ce(sctp_gso_headskb(chunk->skb))) {
/* Do real work as sideffect. */
sctp_add_cmd_sf(commands, SCTP_CMD_ECN_CE,
SCTP_U32(tsn));