aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet
diff options
context:
space:
mode:
authorChangli Gao <xiaosuo@gmail.com>2010-11-12 13:43:55 -0500
committerDavid S. Miller <davem@davemloft.net>2010-11-17 15:27:45 -0500
commit5811662b15db018c740c57d037523683fd3e6123 (patch)
treef820610a6024799a26699f22dc9a4ef5dee07978 /net/decnet
parentdd68ad2235b4625e0dc928b2b4c614d265f976d3 (diff)
net: use the macros defined for the members of flowi
Use the macros defined for the members of flowi to clean the code up. Signed-off-by: Changli Gao <xiaosuo@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet')
-rw-r--r--net/decnet/dn_route.c22
-rw-r--r--net/decnet/dn_rules.c2
2 files changed, 10 insertions, 14 deletions
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 474d54dd08c2..8280e43c8861 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -271,10 +271,10 @@ static void dn_dst_link_failure(struct sk_buff *skb)
271 271
272static inline int compare_keys(struct flowi *fl1, struct flowi *fl2) 272static inline int compare_keys(struct flowi *fl1, struct flowi *fl2)
273{ 273{
274 return ((fl1->nl_u.dn_u.daddr ^ fl2->nl_u.dn_u.daddr) | 274 return ((fl1->fld_dst ^ fl2->fld_dst) |
275 (fl1->nl_u.dn_u.saddr ^ fl2->nl_u.dn_u.saddr) | 275 (fl1->fld_src ^ fl2->fld_src) |
276 (fl1->mark ^ fl2->mark) | 276 (fl1->mark ^ fl2->mark) |
277 (fl1->nl_u.dn_u.scope ^ fl2->nl_u.dn_u.scope) | 277 (fl1->fld_scope ^ fl2->fld_scope) |
278 (fl1->oif ^ fl2->oif) | 278 (fl1->oif ^ fl2->oif) |
279 (fl1->iif ^ fl2->iif)) == 0; 279 (fl1->iif ^ fl2->iif)) == 0;
280} 280}
@@ -882,11 +882,9 @@ static inline __le16 dn_fib_rules_map_destination(__le16 daddr, struct dn_fib_re
882 882
883static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *oldflp, int try_hard) 883static int dn_route_output_slow(struct dst_entry **pprt, const struct flowi *oldflp, int try_hard)
884{ 884{
885 struct flowi fl = { .nl_u = { .dn_u = 885 struct flowi fl = { .fld_dst = oldflp->fld_dst,
886 { .daddr = oldflp->fld_dst, 886 .fld_src = oldflp->fld_src,
887 .saddr = oldflp->fld_src, 887 .fld_scope = RT_SCOPE_UNIVERSE,
888 .scope = RT_SCOPE_UNIVERSE,
889 } },
890 .mark = oldflp->mark, 888 .mark = oldflp->mark,
891 .iif = init_net.loopback_dev->ifindex, 889 .iif = init_net.loopback_dev->ifindex,
892 .oif = oldflp->oif }; 890 .oif = oldflp->oif };
@@ -1230,11 +1228,9 @@ static int dn_route_input_slow(struct sk_buff *skb)
1230 int flags = 0; 1228 int flags = 0;
1231 __le16 gateway = 0; 1229 __le16 gateway = 0;
1232 __le16 local_src = 0; 1230 __le16 local_src = 0;
1233 struct flowi fl = { .nl_u = { .dn_u = 1231 struct flowi fl = { .fld_dst = cb->dst,
1234 { .daddr = cb->dst, 1232 .fld_src = cb->src,
1235 .saddr = cb->src, 1233 .fld_scope = RT_SCOPE_UNIVERSE,
1236 .scope = RT_SCOPE_UNIVERSE,
1237 } },
1238 .mark = skb->mark, 1234 .mark = skb->mark,
1239 .iif = skb->dev->ifindex }; 1235 .iif = skb->dev->ifindex };
1240 struct dn_fib_res res = { .fi = NULL, .type = RTN_UNREACHABLE }; 1236 struct dn_fib_res res = { .fi = NULL, .type = RTN_UNREACHABLE };
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c
index 48fdf10be7a1..6eb91df3c550 100644
--- a/net/decnet/dn_rules.c
+++ b/net/decnet/dn_rules.c
@@ -175,7 +175,7 @@ static int dn_fib_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh,
175 175
176unsigned dnet_addr_type(__le16 addr) 176unsigned dnet_addr_type(__le16 addr)
177{ 177{
178 struct flowi fl = { .nl_u = { .dn_u = { .daddr = addr } } }; 178 struct flowi fl = { .fld_dst = addr };
179 struct dn_fib_res res; 179 struct dn_fib_res res;
180 unsigned ret = RTN_UNICAST; 180 unsigned ret = RTN_UNICAST;
181 struct dn_fib_table *tb = dn_fib_get_table(RT_TABLE_LOCAL, 0); 181 struct dn_fib_table *tb = dn_fib_get_table(RT_TABLE_LOCAL, 0);