All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [IPV4]: Add an 'rtable' field in struct sk_buff to alias 'dst' field and avoid casts
Date: Tue, 04 Mar 2008 08:36:43 +0100	[thread overview]
Message-ID: <47CCFC0B.7060801@cosmosbay.com> (raw)
In-Reply-To: <20080303.232342.221759327.davem@davemloft.net>

David Miller a écrit :
> From: Eric Dumazet <dada1@cosmosbay.com>
> Date: Tue, 04 Mar 2008 08:15:41 +0100
> 
>> @@ -223,7 +223,7 @@ static int br_nf_pre_routing_finish_ipv6(struct sk_buff *skb)
>>  	}
>>  	nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING;
>>  
>> -	skb->dst = (struct dst_entry *)&__fake_rtable;
>> +	skb->dst = &__fake_rtable.u.dst;
>>  	dst_hold(skb->dst);
>>  
>>  	skb->dev = nf_bridge->physindev;
> 
> Any reason this case (and the next 3 hunks) can't simply
> use just plain "&__fake_rtable"?  That would probably
> look nicer and match the rest of this patch.
> 
> 
> 

Yes, I had this idea, but felt that it was better in this case to have a 
dst_hold() that refers to the above affectation.

skb->dst = &__fake_rtable.u.dst;
dst_hold(skb->dst);

instead of

skb->rtable = &__fake_rtable;
dst_hold(skb->dst);

Do you prefer the later ?


  reply	other threads:[~2008-03-04  7:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-04  7:15 [IPV4]: Add an 'rtable' field in struct sk_buff to alias 'dst' field and avoid casts Eric Dumazet
2008-03-04  7:23 ` David Miller
2008-03-04  7:36   ` Eric Dumazet [this message]
2008-03-04  7:46     ` David Miller
2008-03-05 23:30       ` Eric Dumazet
2008-03-06  2:35         ` David Miller
2008-03-06 23:01           ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47CCFC0B.7060801@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.