Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

skb_dst() returns NULL

Tags:

linux

kernel

I'm trying to write a virtual netdevice driver on linux kernel 3.3.2. Some features of my driver need the route info when transmitting packets, so I use function skb_dst(struct sk_buff *) to get the dst_entry pointer. But whatever I do, wherever I ping, whenever I try, skb_dst() always returns NULL. I don't know why, and the bug confused me for more than a week. Can anyone help me?

like image 648
user1411817 Avatar asked Jan 29 '26 12:01

user1411817


1 Answers

I've found the reason! It's because of a flag added to kernel: IFF_XMIT_DST_RELEASE, if a virtual device is allocated with the flag set to 0, the kernel will drop the routing information when sending the sk_buff to the device. Thanks for Kristof Provost's reply all the same and sorry for ending the question so late.

like image 64
user1411817 Avatar answered Jan 31 '26 22:01

user1411817



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!