aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2006-11-09 18:20:38 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:21:39 -0500
commit47dcf0cb1005e86d0eea780f2984b2e7490f63cd (patch)
tree1a56767a77e219fab54ab1daf34342745f6d62a8 /include
parent82e91ffef60e6eba9848fe149ce1eecd2b5aef12 (diff)
[NET]: Rethink mark field in struct flowi
Now that all protocols have been made aware of the mark field it can be moved out of the union thus simplyfing its usage. The config options in the IPv4/IPv6/DECnet subsystems to enable respectively disable mark based routing only obfuscate the code with ifdefs, the cost for the additional comparison in the flow key is insignificant, and most distributions have all these options enabled by default anyway. Therefore it makes sense to remove the config options and enable mark based routing by default. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/flow.h7
-rw-r--r--include/net/ip_mp_alg.h4
2 files changed, 2 insertions, 9 deletions
diff --git a/include/net/flow.h b/include/net/flow.h
index 270d4c1761af..ce4b10d8b412 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -13,12 +13,12 @@
13struct flowi { 13struct flowi {
14 int oif; 14 int oif;
15 int iif; 15 int iif;
16 __u32 mark;
16 17
17 union { 18 union {
18 struct { 19 struct {
19 __be32 daddr; 20 __be32 daddr;
20 __be32 saddr; 21 __be32 saddr;
21 __u32 fwmark;
22 __u8 tos; 22 __u8 tos;
23 __u8 scope; 23 __u8 scope;
24 } ip4_u; 24 } ip4_u;
@@ -26,28 +26,23 @@ struct flowi {
26 struct { 26 struct {
27 struct in6_addr daddr; 27 struct in6_addr daddr;
28 struct in6_addr saddr; 28 struct in6_addr saddr;
29 __u32 fwmark;
30 __be32 flowlabel; 29 __be32 flowlabel;
31 } ip6_u; 30 } ip6_u;
32 31
33 struct { 32 struct {
34 __le16 daddr; 33 __le16 daddr;
35 __le16 saddr; 34 __le16 saddr;
36 __u32 fwmark;
37 __u8 scope; 35 __u8 scope;
38 } dn_u; 36 } dn_u;
39 } nl_u; 37 } nl_u;
40#define fld_dst nl_u.dn_u.daddr 38#define fld_dst nl_u.dn_u.daddr
41#define fld_src nl_u.dn_u.saddr 39#define fld_src nl_u.dn_u.saddr
42#define fld_fwmark nl_u.dn_u.fwmark
43#define fld_scope nl_u.dn_u.scope 40#define fld_scope nl_u.dn_u.scope
44#define fl6_dst nl_u.ip6_u.daddr 41#define fl6_dst nl_u.ip6_u.daddr
45#define fl6_src nl_u.ip6_u.saddr 42#define fl6_src nl_u.ip6_u.saddr
46#define fl6_fwmark nl_u.ip6_u.fwmark
47#define fl6_flowlabel nl_u.ip6_u.flowlabel 43#define fl6_flowlabel nl_u.ip6_u.flowlabel
48#define fl4_dst nl_u.ip4_u.daddr 44#define fl4_dst nl_u.ip4_u.daddr
49#define fl4_src nl_u.ip4_u.saddr 45#define fl4_src nl_u.ip4_u.saddr
50#define fl4_fwmark nl_u.ip4_u.fwmark
51#define fl4_tos nl_u.ip4_u.tos 46#define fl4_tos nl_u.ip4_u.tos
52#define fl4_scope nl_u.ip4_u.scope 47#define fl4_scope nl_u.ip4_u.scope
53 48
diff --git a/include/net/ip_mp_alg.h b/include/net/ip_mp_alg.h
index beffdd66ad74..25b56571e54b 100644
--- a/include/net/ip_mp_alg.h
+++ b/include/net/ip_mp_alg.h
@@ -88,9 +88,7 @@ static inline int multipath_comparekeys(const struct flowi *flp1,
88 return flp1->fl4_dst == flp2->fl4_dst && 88 return flp1->fl4_dst == flp2->fl4_dst &&
89 flp1->fl4_src == flp2->fl4_src && 89 flp1->fl4_src == flp2->fl4_src &&
90 flp1->oif == flp2->oif && 90 flp1->oif == flp2->oif &&
91#ifdef CONFIG_IP_ROUTE_FWMARK 91 flp1->mark == flp2->mark &&
92 flp1->fl4_fwmark == flp2->fl4_fwmark &&
93#endif
94 !((flp1->fl4_tos ^ flp2->fl4_tos) & 92 !((flp1->fl4_tos ^ flp2->fl4_tos) &
95 (IPTOS_RT_MASK | RTO_ONLINK)); 93 (IPTOS_RT_MASK | RTO_ONLINK));
96} 94}