mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 15:42:32 +00:00
[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>
This commit is contained in:
parent
a05c44f6d5
commit
ee6b967301
23 changed files with 69 additions and 68 deletions
|
@ -528,7 +528,7 @@ static int ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
|
||||
if (!dst) {
|
||||
/* NBMA tunnel */
|
||||
if ((rt = (struct rtable*)skb->dst) == NULL) {
|
||||
if ((rt = skb->rtable) == NULL) {
|
||||
tunnel->stat.tx_fifo_errors++;
|
||||
goto tx_error;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue