- 论坛徽章:
- 0
|
找到原因了,在/net/ipv4/ip_output.c中调用到了nf_hook函数,所以在netfilter.h中有函数:
static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
struct net_device *indev, struct net_device *outdev,
int (*okfn)(struct sk_buff *))
{
return nf_hook_thresh(pf, hook, skb, indev, outdev, okfn, INT_MIN, 1);
/*修改为下面的就OK了
return (hook==NF_INET_LOCAL_IN || hook==NF_INET_LOCAL_OUT || hook==1 ||hook==3)?(okfn)(skb):nf_hook_thresh(pf, hook, skb, indev, outdev, okfn, INT_MIN, 1);
*/
}
减少用不到链表可以减少枷锁处理的次数,较快点效率
Thanks! |
|