Skip to content

Commit

Permalink
sctp: fix transport encap_port update in sctp_vtag_verify
Browse files Browse the repository at this point in the history
transport encap_port update should be updated when sctp_vtag_verify()
succeeds, namely, returns 1, not returns 0. Correct it in this patch.

While at it, also fix the indentation.

Fixes: a1dd2cf ("sctp: allow changing transport encap_port by peer packets")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Xin Long authored and David S. Miller committed Oct 15, 2021
1 parent c2402d4 commit 075718f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/net/sctp/sm.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,11 @@ sctp_vtag_verify(const struct sctp_chunk *chunk,
* Verification Tag value does not match the receiver's own
* tag value, the receiver shall silently discard the packet...
*/
if (ntohl(chunk->sctp_hdr->vtag) == asoc->c.my_vtag)
return 1;
if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag)
return 0;

chunk->transport->encap_port = SCTP_INPUT_CB(chunk->skb)->encap_port;
return 0;
return 1;
}

/* Check VTAG of the packet matches the sender's own tag and the T bit is
Expand Down

0 comments on commit 075718f

Please sign in to comment.