David S. Miller <[EMAIL PROTECTED]> wrote:
> 
> But how can this possibly work for skb->dst'less packets (such as IPV4
> ARP generated frames)?

I think the answer is that it works by accident.

Without preemption or weird netfilter targets that queue packets,
the packet will drop right through to dev_queue_xmit.  At which
point it'll either be given to the driver or its qdisc.  Both of
which hold implicit references to the device.

Of course this is no longer safe if preemption is enabled or if
netfilter is going to hold onto the packet.  Fortunately the former
is very unlikely to cause a problem and the latter would only occur
in a highly unusual setup.

But yes we do need to hold a reference count to be 100% correct.
Actually, IPv6 gets around this by constructing a fake dst entry...

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to