- 论坛徽章:
- 0
|
int init(void)
{
nfho_ip.hook = hook_fund_ip;
nfho_ip.hooknum = 1;
nfho_ip.pf = PF_INET;
nfho_ip.priority = NF_IP_PRI_FIRST;
nf_register_hook(&nfho_ip);
return 0;
}
void exit(void)
{
nf_unregister_hook(&nfho_port);
nf_unregister_hook(&nfho_ip);
}
module_init(init);
module_exit(exit);
MODULE_LICENSE("GPL");
在unsigned int hook_fund_ip(unsigned int hooknum,struct sk_buff *skb,const struct net_device *in,const struct net_device *out,int(*okfn)(struct sk_buff*))
{
struct iphdr *iph ;
if(!skb)
{
printk("skb is NULL\n");
return NF_ACCEPT;
}
}中,拿到的skb为空。。。
这个不知道为啥,系统仍然正常接收数据包。 |
|