diff options
author | Xin Long <lucien.xin@gmail.com> | 2021-10-14 07:50:55 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-15 13:21:10 +0300 |
commit | 075718fdaf0efe20223571236c1bf14ca35a7aa1 (patch) | |
tree | 9d2dc6eade2421073f138c5b3be74febe9291f91 /include/net/sctp/sm.h | |
parent | c2402d43d183b11445aed921e7bebcd47ef222f1 (diff) | |
download | linux-075718fdaf0efe20223571236c1bf14ca35a7aa1.tar.xz |
sctp: fix transport encap_port update in sctp_vtag_verify
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: a1dd2cf2f1ae ("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>
Diffstat (limited to 'include/net/sctp/sm.h')
-rw-r--r-- | include/net/sctp/sm.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 2eb6d7c2c931..f37c7a558d6d 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h @@ -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 |