diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-09-27 21:49:07 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-28 21:02:43 -0400 |
commit | 4324a174304d1d826582be5422a976e09d2b1e63 (patch) | |
tree | b1d0b1e47e09901ca94419ec94cb31acc542baf1 | |
parent | 9916ecb0a6f52f1475fa2f71845227d3c75fb40c (diff) |
[XFRM]: fl_ipsec_spi is net-endian
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/flow.h | 2 | ||||
-rw-r--r-- | net/ipv4/xfrm4_policy.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/include/net/flow.h b/include/net/flow.h index 5700b0ad63c0..ddf5f3ca1720 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
@@ -73,7 +73,7 @@ struct flowi { | |||
73 | __u8 objname[16]; /* Not zero terminated */ | 73 | __u8 objname[16]; /* Not zero terminated */ |
74 | } dnports; | 74 | } dnports; |
75 | 75 | ||
76 | __u32 spi; | 76 | __be32 spi; |
77 | 77 | ||
78 | #ifdef CONFIG_IPV6_MIP6 | 78 | #ifdef CONFIG_IPV6_MIP6 |
79 | struct { | 79 | struct { |
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index eabcd27b1767..7a7a00147e55 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/net/ipv4/xfrm4_policy.c | |||
@@ -221,7 +221,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl) | |||
221 | 221 | ||
222 | case IPPROTO_ESP: | 222 | case IPPROTO_ESP: |
223 | if (pskb_may_pull(skb, xprth + 4 - skb->data)) { | 223 | if (pskb_may_pull(skb, xprth + 4 - skb->data)) { |
224 | u32 *ehdr = (u32 *)xprth; | 224 | __be32 *ehdr = (__be32 *)xprth; |
225 | 225 | ||
226 | fl->fl_ipsec_spi = ehdr[0]; | 226 | fl->fl_ipsec_spi = ehdr[0]; |
227 | } | 227 | } |
@@ -229,7 +229,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl) | |||
229 | 229 | ||
230 | case IPPROTO_AH: | 230 | case IPPROTO_AH: |
231 | if (pskb_may_pull(skb, xprth + 8 - skb->data)) { | 231 | if (pskb_may_pull(skb, xprth + 8 - skb->data)) { |
232 | u32 *ah_hdr = (u32*)xprth; | 232 | __be32 *ah_hdr = (__be32*)xprth; |
233 | 233 | ||
234 | fl->fl_ipsec_spi = ah_hdr[1]; | 234 | fl->fl_ipsec_spi = ah_hdr[1]; |
235 | } | 235 | } |
@@ -237,7 +237,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl) | |||
237 | 237 | ||
238 | case IPPROTO_COMP: | 238 | case IPPROTO_COMP: |
239 | if (pskb_may_pull(skb, xprth + 4 - skb->data)) { | 239 | if (pskb_may_pull(skb, xprth + 4 - skb->data)) { |
240 | u16 *ipcomp_hdr = (u16 *)xprth; | 240 | __be16 *ipcomp_hdr = (__be16 *)xprth; |
241 | 241 | ||
242 | fl->fl_ipsec_spi = htonl(ntohs(ipcomp_hdr[1])); | 242 | fl->fl_ipsec_spi = htonl(ntohs(ipcomp_hdr[1])); |
243 | } | 243 | } |