]> git.baikalelectronics.ru Git - kernel.git/commit
sctp: Fix COMM_LOST/CANT_STR_ASSOC err reporting on big-endian platforms
authorPetr Malat <oss@malat.biz>
Fri, 30 Oct 2020 13:26:33 +0000 (14:26 +0100)
committerJakub Kicinski <kuba@kernel.org>
Mon, 2 Nov 2020 23:03:25 +0000 (15:03 -0800)
commitb84159fa50dce32cf14e4621f4d94f148b6861b2
tree85def7a9a56e8cdbdf943ecd85553998509f970d
parent162c0a876be987f144eef241564281d958fe11d2
sctp: Fix COMM_LOST/CANT_STR_ASSOC err reporting on big-endian platforms

Commit d56e41d3f3e2 ("sctp: fix some type cast warnings introduced since
very beginning")' broke err reading from sctp_arg, because it reads the
value as 32-bit integer, although the value is stored as 16-bit integer.
Later this value is passed to the userspace in 16-bit variable, thus the
user always gets 0 on big-endian platforms. Fix it by reading the __u16
field of sctp_arg union, as reading err field would produce a sparse
warning.

Fixes: d56e41d3f3e2 ("sctp: fix some type cast warnings introduced since very beginning")
Signed-off-by: Petr Malat <oss@malat.biz>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Link: https://lore.kernel.org/r/20201030132633.7045-1-oss@malat.biz
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sctp/sm_sideeffect.c