From: Marcelo Ricardo Leitner Date: Thu, 15 Sep 2016 18:02:38 +0000 (-0300) Subject: sctp: fix SSN comparision X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4496195ddd75c4ad57b783739414e69b7d79843e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git sctp: fix SSN comparision This function actually operates on u32 yet its paramteres were declared as u16, causing integer truncation upon calling. Note in patch context that ADDIP_SERIAL_SIGN_BIT is already 32 bits. Signed-off-by: Marcelo Ricardo Leitner Acked-by: Neil Horman Signed-off-by: David S. Miller --- diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index efc01743b9d6..bafe2a0ab908 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h @@ -382,7 +382,7 @@ enum { ADDIP_SERIAL_SIGN_BIT = (1<<31) }; -static inline int ADDIP_SERIAL_gte(__u16 s, __u16 t) +static inline int ADDIP_SERIAL_gte(__u32 s, __u32 t) { return ((s) == (t)) || (((t) - (s)) & ADDIP_SERIAL_SIGN_BIT); }