aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet/dn_rules.c
diff options
context:
space:
mode:
authorSteven Whitehouse <steve@chygwyn.com>2006-03-21 01:42:39 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-21 01:42:39 -0500
commitc4ea94ab3710eb2434abe2eab1a479c2dc01f8ac (patch)
tree72e07ca7d2d5fe2de31b3f5a4e64fa411efdf18d /net/decnet/dn_rules.c
parent2c7946a7bf45ae86736ab3b43d0085e43947945c (diff)
[DECnet]: Endian annotation and fixes for DECnet.
The typedef for dn_address has been removed in favour of using __le16 or __u16 directly as appropriate. All the DECnet header files are updated accordingly. The byte ordering of dn_eth2dn() and dn_dn2eth() are both changed since just about all their callers wanted network order rather than host order, so the conversion is now done in the functions themselves. Several missed endianess conversions have been picked up during the conversion process. The nh_gw field in struct dn_fib_info has been changed from a 32 bit field to 16 bits as it ought to be. One or two cases of using htons rather than dn_htons in the routing code have been found and fixed. There are still a few warnings to fix, but this patch deals with the important cases. Signed-off-by: Steven Whitehouse <steve@chygwyn.com> Signed-off-by: Patrick Caulfield <patrick@tykepenguin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet/dn_rules.c')
-rw-r--r--net/decnet/dn_rules.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c
index 1060de70bc0c..f2c299dfe030 100644
--- a/net/decnet/dn_rules.c
+++ b/net/decnet/dn_rules.c
@@ -46,11 +46,11 @@ struct dn_fib_rule
46 unsigned char r_action; 46 unsigned char r_action;
47 unsigned char r_dst_len; 47 unsigned char r_dst_len;
48 unsigned char r_src_len; 48 unsigned char r_src_len;
49 dn_address r_src; 49 __le16 r_src;
50 dn_address r_srcmask; 50 __le16 r_srcmask;
51 dn_address r_dst; 51 __le16 r_dst;
52 dn_address r_dstmask; 52 __le16 r_dstmask;
53 dn_address r_srcmap; 53 __le16 r_srcmap;
54 u8 r_flags; 54 u8 r_flags;
55#ifdef CONFIG_DECNET_ROUTE_FWMARK 55#ifdef CONFIG_DECNET_ROUTE_FWMARK
56 u32 r_fwmark; 56 u32 r_fwmark;
@@ -208,8 +208,8 @@ int dn_fib_lookup(const struct flowi *flp, struct dn_fib_res *res)
208{ 208{
209 struct dn_fib_rule *r, *policy; 209 struct dn_fib_rule *r, *policy;
210 struct dn_fib_table *tb; 210 struct dn_fib_table *tb;
211 dn_address saddr = flp->fld_src; 211 __le16 saddr = flp->fld_src;
212 dn_address daddr = flp->fld_dst; 212 __le16 daddr = flp->fld_dst;
213 int err; 213 int err;
214 214
215 read_lock(&dn_fib_rules_lock); 215 read_lock(&dn_fib_rules_lock);
@@ -259,7 +259,7 @@ int dn_fib_lookup(const struct flowi *flp, struct dn_fib_res *res)
259 return -ESRCH; 259 return -ESRCH;
260} 260}
261 261
262unsigned dnet_addr_type(__u16 addr) 262unsigned dnet_addr_type(__le16 addr)
263{ 263{
264 struct flowi fl = { .nl_u = { .dn_u = { .daddr = addr } } }; 264 struct flowi fl = { .nl_u = { .dn_u = { .daddr = addr } } };
265 struct dn_fib_res res; 265 struct dn_fib_res res;
@@ -277,7 +277,7 @@ unsigned dnet_addr_type(__u16 addr)
277 return ret; 277 return ret;
278} 278}
279 279
280__u16 dn_fib_rules_policy(__u16 saddr, struct dn_fib_res *res, unsigned *flags) 280__le16 dn_fib_rules_policy(__le16 saddr, struct dn_fib_res *res, unsigned *flags)
281{ 281{
282 struct dn_fib_rule *r = res->r; 282 struct dn_fib_rule *r = res->r;
283 283