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>
Este cometimento está contido em:
@@ -412,10 +412,6 @@ static int br_nf_pre_routing_finish(struct sk_buff *skb)
|
||||
nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING;
|
||||
if (dnat_took_place(skb)) {
|
||||
if ((err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev))) {
|
||||
struct flowi fl = {
|
||||
.fl4_dst = iph->daddr,
|
||||
.fl4_tos = RT_TOS(iph->tos),
|
||||
};
|
||||
struct in_device *in_dev = __in_dev_get_rcu(dev);
|
||||
|
||||
/* 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)
|
||||
if (err != -EHOSTUNREACH || !in_dev || IN_DEV_FORWARD(in_dev))
|
||||
goto free_skb;
|
||||
|
||||
rt = ip_route_output_key(dev_net(dev), &fl);
|
||||
rt = ip_route_output(dev_net(dev), iph->daddr, 0,
|
||||
RT_TOS(iph->tos), 0);
|
||||
if (!IS_ERR(rt)) {
|
||||
/* - Bridged-and-DNAT'ed traffic doesn't
|
||||
* require ip_forwarding. */
|
||||
|
Criar uma nova questão referindo esta
Bloquear um utilizador