summaryrefslogtreecommitdiffstats
path: root/net/ipv4
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 /net/ipv4
parent08704bcbf022786532b5f188935ab6619906049f (diff)
downloadlinux-stable-6281dcc94a96bd73017b2baa8fa83925405109ef.tar.gz
linux-stable-6281dcc94a96bd73017b2baa8fa83925405109ef.tar.bz2
linux-stable-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 'net/ipv4')
-rw-r--r--net/ipv4/icmp.c4
-rw-r--r--net/ipv4/inet_connection_sock.c4
-rw-r--r--net/ipv4/ip_output.c4
-rw-r--r--net/ipv4/netfilter/nf_nat_standalone.c4
-rw-r--r--net/ipv4/raw.c4
-rw-r--r--net/ipv4/syncookies.c4
-rw-r--r--net/ipv4/udp.c10
-rw-r--r--net/ipv4/xfrm4_policy.c18
-rw-r--r--net/ipv4/xfrm4_state.c4
9 files changed, 28 insertions, 28 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 3fde7f23c70b..8d091954625b 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -384,8 +384,8 @@ static struct rtable *icmp_route_lookup(struct net *net, struct sk_buff *skb_in,
.fl4_src = saddr,
.fl4_tos = RT_TOS(tos),
.flowi_proto = IPPROTO_ICMP,
- .fl_icmp_type = type,
- .fl_icmp_code = code,
+ .fl4_icmp_type = type,
+ .fl4_icmp_code = code,
};
struct rtable *rt, *rt2;
int err;
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 97081702dffd..10a8e9523578 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -365,8 +365,8 @@ struct dst_entry *inet_csk_route_req(struct sock *sk,
.fl4_tos = RT_CONN_FLAGS(sk),
.flowi_proto = sk->sk_protocol,
.flowi_flags = inet_sk_flowi_flags(sk),
- .fl_ip_sport = inet_sk(sk)->inet_sport,
- .fl_ip_dport = ireq->rmt_port,
+ .fl4_sport = inet_sk(sk)->inet_sport,
+ .fl4_dport = ireq->rmt_port,
};
struct net *net = sock_net(sk);
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index e35ca40df03b..67e5f7130322 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1479,8 +1479,8 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar
.fl4_dst = daddr,
.fl4_src = rt->rt_spec_dst,
.fl4_tos = RT_TOS(ip_hdr(skb)->tos),
- .fl_ip_sport = tcp_hdr(skb)->dest,
- .fl_ip_dport = tcp_hdr(skb)->source,
+ .fl4_sport = tcp_hdr(skb)->dest,
+ .fl4_dport = tcp_hdr(skb)->source,
.flowi_proto = sk->sk_protocol,
.flowi_flags = ip_reply_arg_flowi_flags(arg),
};
diff --git a/net/ipv4/netfilter/nf_nat_standalone.c b/net/ipv4/netfilter/nf_nat_standalone.c
index 95481fee8bdb..1f3c695a47c8 100644
--- a/net/ipv4/netfilter/nf_nat_standalone.c
+++ b/net/ipv4/netfilter/nf_nat_standalone.c
@@ -55,7 +55,7 @@ static void nat_decode_session(struct sk_buff *skb, struct flowi *fl)
t->dst.protonum == IPPROTO_UDPLITE ||
t->dst.protonum == IPPROTO_DCCP ||
t->dst.protonum == IPPROTO_SCTP)
- fl->fl_ip_dport = t->dst.u.tcp.port;
+ fl->fl4_dport = t->dst.u.tcp.port;
}
statusbit ^= IPS_NAT_MASK;
@@ -67,7 +67,7 @@ static void nat_decode_session(struct sk_buff *skb, struct flowi *fl)
t->dst.protonum == IPPROTO_UDPLITE ||
t->dst.protonum == IPPROTO_DCCP ||
t->dst.protonum == IPPROTO_SCTP)
- fl->fl_ip_sport = t->src.u.tcp.port;
+ fl->fl4_sport = t->src.u.tcp.port;
}
}
#endif
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index b42b7cd56c03..333b826c1871 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -433,8 +433,8 @@ static int raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg)
code = iov->iov_base;
if (type && code) {
- if (get_user(fl->fl_icmp_type, type) ||
- get_user(fl->fl_icmp_code, code))
+ if (get_user(fl->fl4_icmp_type, type) ||
+ get_user(fl->fl4_icmp_code, code))
return -EFAULT;
probed = 1;
}
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 98d47dc60c89..d90529d45ee6 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -353,8 +353,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
.fl4_tos = RT_CONN_FLAGS(sk),
.flowi_proto = IPPROTO_TCP,
.flowi_flags = inet_sk_flowi_flags(sk),
- .fl_ip_sport = th->dest,
- .fl_ip_dport = th->source,
+ .fl4_sport = th->dest,
+ .fl4_dport = th->source,
};
security_req_classify_flow(req, &fl);
rt = ip_route_output_key(sock_net(sk), &fl);
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index e10f62e6c07c..116e4a8bfb73 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -778,7 +778,7 @@ static int udp_push_pending_frames(struct sock *sk)
if (!skb)
goto out;
- err = udp_send_skb(skb, fl->fl4_dst, fl->fl_ip_dport);
+ err = udp_send_skb(skb, fl->fl4_dst, fl->fl4_dport);
out:
up->len = 0;
@@ -917,8 +917,8 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
.flowi_proto = sk->sk_protocol,
.flowi_flags = (inet_sk_flowi_flags(sk) |
FLOWI_FLAG_CAN_SLEEP),
- .fl_ip_sport = inet->inet_sport,
- .fl_ip_dport = dport,
+ .fl4_sport = inet->inet_sport,
+ .fl4_dport = dport,
};
struct net *net = sock_net(sk);
@@ -973,9 +973,9 @@ back_from_confirm:
* Now cork the socket to pend data.
*/
inet->cork.fl.fl4_dst = daddr;
- inet->cork.fl.fl_ip_dport = dport;
+ inet->cork.fl.fl4_dport = dport;
inet->cork.fl.fl4_src = saddr;
- inet->cork.fl.fl_ip_sport = inet->inet_sport;
+ inet->cork.fl.fl4_sport = inet->inet_sport;
up->pending = AF_INET;
do_append_data:
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index 4294f121a749..b7b0921b425d 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -117,8 +117,8 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
pskb_may_pull(skb, xprth + 4 - skb->data)) {
__be16 *ports = (__be16 *)xprth;
- fl->fl_ip_sport = ports[!!reverse];
- fl->fl_ip_dport = ports[!reverse];
+ fl->fl4_sport = ports[!!reverse];
+ fl->fl4_dport = ports[!reverse];
}
break;
@@ -126,8 +126,8 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
if (pskb_may_pull(skb, xprth + 2 - skb->data)) {
u8 *icmp = xprth;
- fl->fl_icmp_type = icmp[0];
- fl->fl_icmp_code = icmp[1];
+ fl->fl4_icmp_type = icmp[0];
+ fl->fl4_icmp_code = icmp[1];
}
break;
@@ -135,7 +135,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
if (pskb_may_pull(skb, xprth + 4 - skb->data)) {
__be32 *ehdr = (__be32 *)xprth;
- fl->fl_ipsec_spi = ehdr[0];
+ fl->fl4_ipsec_spi = ehdr[0];
}
break;
@@ -143,7 +143,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
if (pskb_may_pull(skb, xprth + 8 - skb->data)) {
__be32 *ah_hdr = (__be32*)xprth;
- fl->fl_ipsec_spi = ah_hdr[1];
+ fl->fl4_ipsec_spi = ah_hdr[1];
}
break;
@@ -151,7 +151,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
if (pskb_may_pull(skb, xprth + 4 - skb->data)) {
__be16 *ipcomp_hdr = (__be16 *)xprth;
- fl->fl_ipsec_spi = htonl(ntohs(ipcomp_hdr[1]));
+ fl->fl4_ipsec_spi = htonl(ntohs(ipcomp_hdr[1]));
}
break;
@@ -163,13 +163,13 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse)
if (greflags[0] & GRE_KEY) {
if (greflags[0] & GRE_CSUM)
gre_hdr++;
- fl->fl_gre_key = gre_hdr[1];
+ fl->fl4_gre_key = gre_hdr[1];
}
}
break;
default:
- fl->fl_ipsec_spi = 0;
+ fl->fl4_ipsec_spi = 0;
break;
}
}
diff --git a/net/ipv4/xfrm4_state.c b/net/ipv4/xfrm4_state.c
index d2314348dd2a..663b5501abcd 100644
--- a/net/ipv4/xfrm4_state.c
+++ b/net/ipv4/xfrm4_state.c
@@ -25,9 +25,9 @@ __xfrm4_init_tempsel(struct xfrm_selector *sel, const struct flowi *fl)
{
sel->daddr.a4 = fl->fl4_dst;
sel->saddr.a4 = fl->fl4_src;
- sel->dport = xfrm_flowi_dport(fl);
+ sel->dport = xfrm_flowi_dport(fl, &fl->uli_u);
sel->dport_mask = htons(0xffff);
- sel->sport = xfrm_flowi_sport(fl);
+ sel->sport = xfrm_flowi_sport(fl, &fl->uli_u);
sel->sport_mask = htons(0xffff);
sel->family = AF_INET;
sel->prefixlen_d = 32;