aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-09-28 17:31:49 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-28 21:03:05 -0400
commit96d2ca4ec0bb8d0f344e5960224700be3dec3515 (patch)
treef1e8dce6214ee5e35dc290da7ed39e7168afaf8a /net
parent014d730d56b559eacb11e91969a1f41c3feb36f9 (diff)
[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: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/ipvs/ip_vs_ftp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv4/ipvs/ip_vs_ftp.c b/net/ipv4/ipvs/ip_vs_ftp.c
index b3bbb4a07ae0..e433cb0ff894 100644
--- a/net/ipv4/ipvs/ip_vs_ftp.c
+++ b/net/ipv4/ipvs/ip_vs_ftp.c
@@ -32,6 +32,7 @@
32#include <linux/ip.h> 32#include <linux/ip.h>
33#include <net/protocol.h> 33#include <net/protocol.h>
34#include <net/tcp.h> 34#include <net/tcp.h>
35#include <asm/unaligned.h>
35 36
36#include <net/ip_vs.h> 37#include <net/ip_vs.h>
37 38
@@ -114,8 +115,8 @@ static int ip_vs_ftp_get_addrport(char *data, char *data_limit,
114 if (i != 5) 115 if (i != 5)
115 return -1; 116 return -1;
116 117
117 *addr = (p[3]<<24) | (p[2]<<16) | (p[1]<<8) | p[0]; 118 *addr = get_unaligned((__be32 *)p);
118 *port = (p[5]<<8) | p[4]; 119 *port = get_unaligned((__be16 *)(p + 4));
119 return 1; 120 return 1;
120} 121}
121 122