Re: strcut casts unsigned long

ratheesh k <[email protected]>
Newsgroups org.kernel.vger.linux-c-programming
Message-ID <[email protected]>
On Fri, Aug 13, 2010 at 7:47 AM, hong zhang <[email protected]> wrote:
> List,
>
> I have C question on skbuff.h.
> skb->_skb_dst is defined as unsigned long and dst_entry is struct.
>
> Why strct dst_entry casts unsigned long skb->_skb_dst?
>
> See below
>
> static inline struct dst_entry *skb_dst(const struct sk_buff *skb)
> {
>        return (struct dst_entry *)skb->_skb_dst;
> }
>
> Appreciate any answer!
>
> --henry

skb->_skb_dst can be a pointer to both destination cache or  routing
table . We could type cast to any of those .

-Ratheesh











\\> --
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.