Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Xin Long and committed by
David S. Miller
075718fd c2402d43

+3 -3
+3 -3
include/net/sctp/sm.h
··· 384 384 * Verification Tag value does not match the receiver's own 385 385 * tag value, the receiver shall silently discard the packet... 386 386 */ 387 - if (ntohl(chunk->sctp_hdr->vtag) == asoc->c.my_vtag) 388 - return 1; 387 + if (ntohl(chunk->sctp_hdr->vtag) != asoc->c.my_vtag) 388 + return 0; 389 389 390 390 chunk->transport->encap_port = SCTP_INPUT_CB(chunk->skb)->encap_port; 391 - return 0; 391 + return 1; 392 392 } 393 393 394 394 /* Check VTAG of the packet matches the sender's own tag and the T bit is