English 中文(简体)
skb_dst () 返回 NULLL
原标题:skb_dst() returns NULL
  • 时间:2012-05-23 06:15:54
  •  标签:
  • linux
  • kernel

我试图在 Linux 内核 3.3.2 上写一个虚拟网络驱动程序 。 我的驱动程序的某些特性在传输包时需要路径信息, 所以我使用函数 skb_ dst( struct sk_ buff *) 来获取 dst_ enter 。 但是无论我做什么, 无论我在哪里, 无论我在哪里, 无论我什么时候尝试, < enger> sskb_ dst () 总是返回 NULL 。 我不知道为什么, 错误让我迷惑了一个多星期。 有人能帮我吗?

最佳回答

我找到原因了! 它是因为在内核上添加了国旗 : IFF_XMIT_DST_RELEASE , 如果以 0 设定的旗帜分配一个虚拟设备, 当向设备发送 sk_buff 时, 内核会丢弃路由信息。 感谢 Kristof Provost 的回复都一样, 很抱歉这么晚才结束这个问题 。

问题回答

Ping使用RAW插座,它们可能绕过路由基础设施的一部分。

尝试在 net/ipv4/raw.c 中查看 >_raw_send_hdrinc raw_sendmsg in net/ipv4/raw.c

要清除, 添加 dev- dev- gt; priv_ flags& = ~ IFF_ XMIT_ DST_ RELEASE; 来设置函数





相关问题
Signed executables under Linux

For security reasons, it is desirable to check the integrity of code before execution, avoiding tampered software by an attacker. So, my question is How to sign executable code and run only trusted ...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How can I use exit codes to run shell scripts sequentially?

Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...