Chinaunix
标题:
neigh_proxy_process函数的疑问【已解决】
[打印本页]
作者:
jiufei19
时间:
2017-03-09 18:10
标题:
neigh_proxy_process函数的疑问【已解决】
本帖最后由 jiufei19 于 2017-03-09 22:35 编辑
内核版本v2.6.23~v4.x
1209 static void neigh_proxy_process(unsigned long arg)
1210 {
1211 struct neigh_table *tbl = (struct neigh_table *)arg;
1212 long sched_next = 0;
... ...
1220 while (skb != (struct sk_buff *)&tbl->proxy_queue) {
1221 struct sk_buff *back = skb;
1222 long tdif = NEIGH_CB(back)->sched_next - now;
1223
1224 skb = skb->next;
1225 if (tdif <= 0) {
... ...
1234 } else if (!sched_next || tdif < sched_next)
1235 sched_next = tdif;
1236 }
... ...
上面代码是ARP代理定时器的处理函数,我的疑问是上面两句红色语句,既然在第1212行已经将sched_next设为0了,那么第1234行的else if还有什么意义呢,!sched_next肯定为真呀?
作者:
jiufei19
时间:
2017-03-09 22:35
回复
1#
jiufei19
不好意思,看错代码了
,还有一重while循环在那里进行。
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2