diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2008-03-05 21:30:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-05 21:30:47 -0500 |
commit | ee6b967301b4aa5d4a4b61e2f682f086266db9fb (patch) | |
tree | 197c2430f87733dc80d00d1971f1be2a0e562358 /net/ipv4/arp.c | |
parent | a05c44f6d5fb6cd29da04f96bf5ffaa05f545ac5 (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/arp.c')
-rw-r--r-- | net/ipv4/arp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 69e80bd9774a..efe01df8fc0e 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -475,7 +475,7 @@ int arp_find(unsigned char *haddr, struct sk_buff *skb) | |||
475 | return 1; | 475 | return 1; |
476 | } | 476 | } |
477 | 477 | ||
478 | paddr = ((struct rtable*)skb->dst)->rt_gateway; | 478 | paddr = skb->rtable->rt_gateway; |
479 | 479 | ||
480 | if (arp_set_predefined(inet_addr_type(&init_net, paddr), haddr, paddr, dev)) | 480 | if (arp_set_predefined(inet_addr_type(&init_net, paddr), haddr, paddr, dev)) |
481 | return 0; | 481 | return 0; |
@@ -814,7 +814,7 @@ static int arp_process(struct sk_buff *skb) | |||
814 | if (arp->ar_op == htons(ARPOP_REQUEST) && | 814 | if (arp->ar_op == htons(ARPOP_REQUEST) && |
815 | ip_route_input(skb, tip, sip, 0, dev) == 0) { | 815 | ip_route_input(skb, tip, sip, 0, dev) == 0) { |
816 | 816 | ||
817 | rt = (struct rtable*)skb->dst; | 817 | rt = skb->rtable; |
818 | addr_type = rt->rt_type; | 818 | addr_type = rt->rt_type; |
819 | 819 | ||
820 | if (addr_type == RTN_LOCAL) { | 820 | if (addr_type == RTN_LOCAL) { |