aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/route.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-12 00:43:55 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-12 15:08:46 -0800
commit6281dcc94a96bd73017b2baa8fa83925405109ef (patch)
tree8deee4d66d256d10ea25f66520eb96b1fade1545 /include/net/route.h
parentnet: Create union flowi_uli (diff)
downloadlinux-dev-6281dcc94a96bd73017b2baa8fa83925405109ef.tar.xz
linux-dev-6281dcc94a96bd73017b2baa8fa83925405109ef.zip
net: Make flowi ports AF dependent.
Create two sets of port member accessors, one set prefixed by fl4_* and the other prefixed by fl6_* This will let us to create AF optimal flow instances. It will work because every context in which we access the ports, we have to be fully aware of which AF the flowi is anyways. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/route.h')
-rw-r--r--include/net/route.h43
1 files changed, 23 insertions, 20 deletions
diff --git a/include/net/route.h b/include/net/route.h
index 3d814f84abd0..4c207f9fe0cb 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -157,8 +157,8 @@ static inline struct rtable *ip_route_output_ports(struct net *net, struct sock
.fl4_src = saddr,
.fl4_tos = tos,
.flowi_proto = proto,
- .fl_ip_dport = dport,
- .fl_ip_sport = sport,
+ .fl4_dport = dport,
+ .fl4_sport = sport,
};
if (sk)
security_sk_classify_flow(sk, &fl);
@@ -175,7 +175,7 @@ static inline struct rtable *ip_route_output_gre(struct net *net,
.fl4_src = saddr,
.fl4_tos = tos,
.flowi_proto = IPPROTO_GRE,
- .fl_gre_key = gre_key,
+ .fl4_gre_key = gre_key,
};
return ip_route_output_key(net, &fl);
}
@@ -228,14 +228,16 @@ static inline struct rtable *ip_route_connect(__be32 dst, __be32 src, u32 tos,
__be16 sport, __be16 dport,
struct sock *sk, bool can_sleep)
{
- struct flowi fl = { .flowi_oif = oif,
- .flowi_mark = sk->sk_mark,
- .fl4_dst = dst,
- .fl4_src = src,
- .fl4_tos = tos,
- .flowi_proto = protocol,
- .fl_ip_sport = sport,
- .fl_ip_dport = dport };
+ struct flowi fl = {
+ .flowi_oif = oif,
+ .flowi_mark = sk->sk_mark,
+ .fl4_dst = dst,
+ .fl4_src = src,
+ .fl4_tos = tos,
+ .flowi_proto = protocol,
+ .fl4_sport = sport,
+ .fl4_dport = dport,
+ };
struct net *net = sock_net(sk);
struct rtable *rt;
@@ -264,15 +266,16 @@ static inline struct rtable *ip_route_newports(struct rtable *rt,
__be16 dport, struct sock *sk)
{
if (sport != orig_sport || dport != orig_dport) {
- struct flowi fl = { .flowi_oif = rt->rt_oif,
- .flowi_mark = rt->rt_mark,
- .fl4_dst = rt->rt_key_dst,
- .fl4_src = rt->rt_key_src,
- .fl4_tos = rt->rt_tos,
- .flowi_proto = protocol,
- .fl_ip_sport = sport,
- .fl_ip_dport = dport };
-
+ struct flowi fl = {
+ .flowi_oif = rt->rt_oif,
+ .flowi_mark = rt->rt_mark,
+ .fl4_dst = rt->rt_key_dst,
+ .fl4_src = rt->rt_key_src,
+ .fl4_tos = rt->rt_tos,
+ .flowi_proto = protocol,
+ .fl4_sport = sport,
+ .fl4_dport = dport
+ };
if (inet_sk(sk)->transparent)
fl.flowi_flags |= FLOWI_FLAG_ANYSRC;
if (protocol == IPPROTO_TCP)