Re: [RFC PATCH 02/13] extended semantic of sk_buff::tstamp: lowest bit marks hardware time stamps

David Miller
2008-11-12T09:58:56Z

From: Patrick Ohly <patrick.ohly@intel.com>
Date: Wed, 22 Oct 2008 10:17:24 +0200

> +int skb_hwtstamp_raw(const struct sk_buff *skb, struct timespec *stamp)
> +{
> + struct rtable *rt;
> + struct in_device *idev;
> + struct net_device *netdev;
> +
> + if (skb_hwtstamp_available(skb) &&
> + (rt = skb->rtable) != NULL &&
> + (idev = rt->idev) != NULL &&
> + (netdev = idev->dev) != NULL &&
> + netdev->hwtstamp_raw) {
> + return netdev->hwtstamp_raw(skb, stamp);
> + } else {
> + return 0;
> + }
> +}
> +
> +EXPORT_SYMBOL_GPL(skb_hwtstamp_raw);

You can't be accessing the generic destination cache entry attached to
the SKB, here in generic SKB code, as a pointer to an ipv4 specific
route object. What if this is an IPV6 or DECNET packet?