aboutsummaryrefslogtreecommitdiff
path: root/net/ipv4/netfilter/nf_nat_helper.c
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2008-03-05 18:30:47 -0800
committerDavid S. Miller <davem@davemloft.net>2008-03-05 18:30:47 -0800
commitee6b967301b4aa5d4a4b61e2f682f086266db9fb (patch)
tree197c2430f87733dc80d00d1971f1be2a0e562358 /net/ipv4/netfilter/nf_nat_helper.c
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/ipv4/netfilter/nf_nat_helper.c')
-rw-r--r--net/ipv4/netfilter/nf_nat_helper.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/netfilter/nf_nat_helper.c b/net/ipv4/netfilter/nf_nat_helper.c
index ca57f47bbd2..2fca727aa8b 100644
--- a/net/ipv4/netfilter/nf_nat_helper.c
+++ b/net/ipv4/netfilter/nf_nat_helper.c
@@ -139,7 +139,7 @@ nf_nat_mangle_tcp_packet(struct sk_buff *skb,
const char *rep_buffer,
unsigned int rep_len)
{
- struct rtable *rt = (struct rtable *)skb->dst;
+ struct rtable *rt = skb->rtable;
struct iphdr *iph;
struct tcphdr *tcph;
int oldlen, datalen;
@@ -217,7 +217,7 @@ nf_nat_mangle_udp_packet(struct sk_buff *skb,
const char *rep_buffer,
unsigned int rep_len)
{
- struct rtable *rt = (struct rtable *)skb->dst;
+ struct rtable *rt = skb->rtable;
struct iphdr *iph;
struct udphdr *udph;
int datalen, oldlen;