Commit 96d2ca4e authored by Al Viro's avatar Al Viro Committed by David S. Miller

[IPVS] bug: endianness breakage in ip_vs_ftp

(p[3]<<24) | (p[2]<<16) | (p[1]<<8) | p[0] is not a valid
way to spell get_unaligned((__be32 *)p
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 014d730d
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/ip.h> #include <linux/ip.h>
#include <net/protocol.h> #include <net/protocol.h>
#include <net/tcp.h> #include <net/tcp.h>
#include <asm/unaligned.h>
#include <net/ip_vs.h> #include <net/ip_vs.h>
...@@ -114,8 +115,8 @@ static int ip_vs_ftp_get_addrport(char *data, char *data_limit, ...@@ -114,8 +115,8 @@ static int ip_vs_ftp_get_addrport(char *data, char *data_limit,
if (i != 5) if (i != 5)
return -1; return -1;
*addr = (p[3]<<24) | (p[2]<<16) | (p[1]<<8) | p[0]; *addr = get_unaligned((__be32 *)p);
*port = (p[5]<<8) | p[4]; *port = get_unaligned((__be16 *)(p + 4));
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment