[patch 18/37] Fix decnet endianness

Greg KH
2007-03-30T21:11:12Z

[-- Attachment #1: fix-decnet-endianness.patch --]
[-- Type: text/plain, Size: 1529 bytes --]

-stable review patch. If anyone has any objections, please let us know.

------------------

From: Al Viro <viro@ftp.linux.org.uk>

[PATCH] FRA_{DST,SRC} are le16 for decnet

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
net/decnet/dn_rules.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

--- a/net/decnet/dn_rules.c
+++ b/net/decnet/dn_rules.c
@@ -151,10 +151,10 @@ static int dn_fib_rule_configure(struct
}

if (tb[FRA_SRC])
- r->src = nla_get_u16(tb[FRA_SRC]);
+ r->src = nla_get_le16(tb[FRA_SRC]);

if (tb[FRA_DST])
- r->dst = nla_get_u16(tb[FRA_DST]);
+ r->dst = nla_get_le16(tb[FRA_DST]);

r->src_len = frh->src_len;
r->srcmask = dnet_make_mask(r->src_len);
@@ -176,10 +176,10 @@ static int dn_fib_rule_compare(struct fi
if (frh->dst_len && (r->dst_len != frh->dst_len))
return 0;

- if (tb[FRA_SRC] && (r->src != nla_get_u16(tb[FRA_SRC])))
+ if (tb[FRA_SRC] && (r->src != nla_get_le16(tb[FRA_SRC])))
return 0;

- if (tb[FRA_DST] && (r->dst != nla_get_u16(tb[FRA_DST])))
+ if (tb[FRA_DST] && (r->dst != nla_get_le16(tb[FRA_DST])))
return 0;

return 1;
@@ -214,9 +214,9 @@ static int dn_fib_rule_fill(struct fib_r
frh->tos = 0;

if (r->dst_len)
- NLA_PUT_U16(skb, FRA_DST, r->dst);
+ NLA_PUT_LE16(skb, FRA_DST, r->dst);
if (r->src_len)
- NLA_PUT_U16(skb, FRA_SRC, r->src);
+ NLA_PUT_LE16(skb, FRA_SRC, r->src);

return 0;

--