aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2008-03-05 21:30:47 -0500
committerDavid S. Miller <davem@davemloft.net>2008-03-05 21:30:47 -0500
commitee6b967301b4aa5d4a4b61e2f682f086266db9fb (patch)
tree197c2430f87733dc80d00d1971f1be2a0e562358 /net/bridge
parenta05c44f6d5fb6cd29da04f96bf5ffaa05f545ac5 (diff)
[IPV4]: Add 'rtable' field in struct sk_buff to alias 'dst' and avoid casts
(Anonymous) unions can help us to avoid ugly casts. A common cast it the (struct rtable *)skb->dst one. Defining an union like : union { struct dst_entry *dst; struct rtable *rtable; }; permits to use skb->rtable in place. Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_netfilter.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 1c0efd8ad9f3..0278a069c6f1 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -223,8 +223,8 @@ static int br_nf_pre_routing_finish_ipv6(struct sk_buff *skb)
223 } 223 }
224 nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING; 224 nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING;
225 225
226 skb->dst = (struct dst_entry *)&__fake_rtable; 226 skb->rtable = &__fake_rtable;
227 dst_hold(skb->dst); 227 dst_hold(&__fake_rtable.u.dst);
228 228
229 skb->dev = nf_bridge->physindev; 229 skb->dev = nf_bridge->physindev;
230 nf_bridge_push_encap_header(skb); 230 nf_bridge_push_encap_header(skb);
@@ -388,8 +388,8 @@ bridged_dnat:
388 skb->pkt_type = PACKET_HOST; 388 skb->pkt_type = PACKET_HOST;
389 } 389 }
390 } else { 390 } else {
391 skb->dst = (struct dst_entry *)&__fake_rtable; 391 skb->rtable = &__fake_rtable;
392 dst_hold(skb->dst); 392 dst_hold(&__fake_rtable.u.dst);
393 } 393 }
394 394
395 skb->dev = nf_bridge->physindev; 395 skb->dev = nf_bridge->physindev;
@@ -608,9 +608,9 @@ static unsigned int br_nf_local_in(unsigned int hook, struct sk_buff *skb,
608 const struct net_device *out, 608 const struct net_device *out,
609 int (*okfn)(struct sk_buff *)) 609 int (*okfn)(struct sk_buff *))
610{ 610{
611 if (skb->dst == (struct dst_entry *)&__fake_rtable) { 611 if (skb->rtable == &__fake_rtable) {
612 dst_release(skb->dst); 612 dst_release(&__fake_rtable.u.dst);
613 skb->dst = NULL; 613 skb->rtable = NULL;
614 } 614 }
615 615
616 return NF_ACCEPT; 616 return NF_ACCEPT;