diff options
author | David S. Miller <davem@davemloft.net> | 2011-03-12 00:00:52 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-12 18:08:42 -0500 |
commit | 78fbfd8a653ca972afe479517a40661bfff6d8c3 (patch) | |
tree | 9dccc5c16bf269d53d8499064ec95a998e84c646 /net/bridge | |
parent | 1561747ddf9d28185548687b11aae7074d6129c4 (diff) |
ipv4: Create and use route lookup helpers.
The idea here is this minimizes the number of places one has to edit
in order to make changes to how flows are defined and used.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_netfilter.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index 45b57b173f70..f97af5590ba1 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -412,10 +412,6 @@ static int br_nf_pre_routing_finish(struct sk_buff *skb) | |||
412 | nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING; | 412 | nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING; |
413 | if (dnat_took_place(skb)) { | 413 | if (dnat_took_place(skb)) { |
414 | if ((err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev))) { | 414 | if ((err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev))) { |
415 | struct flowi fl = { | ||
416 | .fl4_dst = iph->daddr, | ||
417 | .fl4_tos = RT_TOS(iph->tos), | ||
418 | }; | ||
419 | struct in_device *in_dev = __in_dev_get_rcu(dev); | 415 | struct in_device *in_dev = __in_dev_get_rcu(dev); |
420 | 416 | ||
421 | /* If err equals -EHOSTUNREACH the error is due to a | 417 | /* If err equals -EHOSTUNREACH the error is due to a |
@@ -428,7 +424,8 @@ static int br_nf_pre_routing_finish(struct sk_buff *skb) | |||
428 | if (err != -EHOSTUNREACH || !in_dev || IN_DEV_FORWARD(in_dev)) | 424 | if (err != -EHOSTUNREACH || !in_dev || IN_DEV_FORWARD(in_dev)) |
429 | goto free_skb; | 425 | goto free_skb; |
430 | 426 | ||
431 | rt = ip_route_output_key(dev_net(dev), &fl); | 427 | rt = ip_route_output(dev_net(dev), iph->daddr, 0, |
428 | RT_TOS(iph->tos), 0); | ||
432 | if (!IS_ERR(rt)) { | 429 | if (!IS_ERR(rt)) { |
433 | /* - Bridged-and-DNAT'ed traffic doesn't | 430 | /* - Bridged-and-DNAT'ed traffic doesn't |
434 | * require ip_forwarding. */ | 431 | * require ip_forwarding. */ |