diff options
author | David S. Miller <davem@davemloft.net> | 2011-03-12 01:12:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-12 18:08:48 -0500 |
commit | 9d6ec938019c6b16cb9ec96598ebe8f20de435fe (patch) | |
tree | 9b850eb7fd48a6e5ffc15f47afd2e3edc93f5290 /net/ipv4/netfilter.c | |
parent | 68a5e3dd0a0056d8b349f9eea3756adda53ec17a (diff) |
ipv4: Use flowi4 in public route lookup interfaces.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/netfilter.c')
-rw-r--r-- | net/ipv4/netfilter.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c index 6f40ba511c6..f3c0b549b8e 100644 --- a/net/ipv4/netfilter.c +++ b/net/ipv4/netfilter.c | |||
@@ -16,7 +16,7 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type) | |||
16 | struct net *net = dev_net(skb_dst(skb)->dev); | 16 | struct net *net = dev_net(skb_dst(skb)->dev); |
17 | const struct iphdr *iph = ip_hdr(skb); | 17 | const struct iphdr *iph = ip_hdr(skb); |
18 | struct rtable *rt; | 18 | struct rtable *rt; |
19 | struct flowi fl = {}; | 19 | struct flowi4 fl4 = {}; |
20 | unsigned long orefdst; | 20 | unsigned long orefdst; |
21 | unsigned int hh_len; | 21 | unsigned int hh_len; |
22 | unsigned int type; | 22 | unsigned int type; |
@@ -31,14 +31,14 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type) | |||
31 | * packets with foreign saddr to appear on the NF_INET_LOCAL_OUT hook. | 31 | * packets with foreign saddr to appear on the NF_INET_LOCAL_OUT hook. |
32 | */ | 32 | */ |
33 | if (addr_type == RTN_LOCAL) { | 33 | if (addr_type == RTN_LOCAL) { |
34 | fl.fl4_dst = iph->daddr; | 34 | fl4.daddr = iph->daddr; |
35 | if (type == RTN_LOCAL) | 35 | if (type == RTN_LOCAL) |
36 | fl.fl4_src = iph->saddr; | 36 | fl4.saddr = iph->saddr; |
37 | fl.fl4_tos = RT_TOS(iph->tos); | 37 | fl4.flowi4_tos = RT_TOS(iph->tos); |
38 | fl.flowi_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0; | 38 | fl4.flowi4_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0; |
39 | fl.flowi_mark = skb->mark; | 39 | fl4.flowi4_mark = skb->mark; |
40 | fl.flowi_flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : 0; | 40 | fl4.flowi4_flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : 0; |
41 | rt = ip_route_output_key(net, &fl); | 41 | rt = ip_route_output_key(net, &fl4); |
42 | if (IS_ERR(rt)) | 42 | if (IS_ERR(rt)) |
43 | return -1; | 43 | return -1; |
44 | 44 | ||
@@ -48,8 +48,8 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type) | |||
48 | } else { | 48 | } else { |
49 | /* non-local src, find valid iif to satisfy | 49 | /* non-local src, find valid iif to satisfy |
50 | * rp-filter when calling ip_route_input. */ | 50 | * rp-filter when calling ip_route_input. */ |
51 | fl.fl4_dst = iph->saddr; | 51 | fl4.daddr = iph->saddr; |
52 | rt = ip_route_output_key(net, &fl); | 52 | rt = ip_route_output_key(net, &fl4); |
53 | if (IS_ERR(rt)) | 53 | if (IS_ERR(rt)) |
54 | return -1; | 54 | return -1; |
55 | 55 | ||
@@ -68,10 +68,10 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type) | |||
68 | 68 | ||
69 | #ifdef CONFIG_XFRM | 69 | #ifdef CONFIG_XFRM |
70 | if (!(IPCB(skb)->flags & IPSKB_XFRM_TRANSFORMED) && | 70 | if (!(IPCB(skb)->flags & IPSKB_XFRM_TRANSFORMED) && |
71 | xfrm_decode_session(skb, &fl, AF_INET) == 0) { | 71 | xfrm_decode_session(skb, flowi4_to_flowi(&fl4), AF_INET) == 0) { |
72 | struct dst_entry *dst = skb_dst(skb); | 72 | struct dst_entry *dst = skb_dst(skb); |
73 | skb_dst_set(skb, NULL); | 73 | skb_dst_set(skb, NULL); |
74 | dst = xfrm_lookup(net, dst, &fl, skb->sk, 0); | 74 | dst = xfrm_lookup(net, dst, flowi4_to_flowi(&fl4), skb->sk, 0); |
75 | if (IS_ERR(dst)) | 75 | if (IS_ERR(dst)) |
76 | return -1; | 76 | return -1; |
77 | skb_dst_set(skb, dst); | 77 | skb_dst_set(skb, dst); |
@@ -223,7 +223,7 @@ static __sum16 nf_ip_checksum_partial(struct sk_buff *skb, unsigned int hook, | |||
223 | 223 | ||
224 | static int nf_ip_route(struct dst_entry **dst, struct flowi *fl) | 224 | static int nf_ip_route(struct dst_entry **dst, struct flowi *fl) |
225 | { | 225 | { |
226 | struct rtable *rt = ip_route_output_key(&init_net, fl); | 226 | struct rtable *rt = ip_route_output_key(&init_net, &fl->u.ip4); |
227 | if (IS_ERR(rt)) | 227 | if (IS_ERR(rt)) |
228 | return PTR_ERR(rt); | 228 | return PTR_ERR(rt); |
229 | *dst = &rt->dst; | 229 | *dst = &rt->dst; |