全部博文(230)
标题 | 阅读 | 评论 | 转发 | 发布日期 | |
---|---|---|---|---|---|
gcc 4.3.2, 4.4.2 都有 BUG | 2266 | 1 | 0 | 2009-12-02 | |
bwtest | 2418 | 0 | 0 | 2009-11-01 | |
oprofile | 2311 | 0 | 0 | 2009-10-31 | |
packit | 1935 | 0 | 0 | 2009-10-31 | |
netconsole | 2194 | 0 | 0 | 2009-10-31 | |
替换内核 LOGO | 2120 | 0 | 1 | 2009-10-31 | |
计算机中的单位、进制关系 | 1947 | 0 | 0 | 2009-08-27 | |
High Memory In The Linux Kernel | 3069 | 0 | 1 | 2009-08-03 | |
64byte 的数据包(最小包)的个数计算方法 | 6445 | 0 | 2 | 2009-06-18 |
phoenixcsl2015-05-26 09:57
hi,platinum,请问netfilter能够过滤arp的东西吗?我写了一些代码,在NF_ARP_IN和OUT捕获一些信息,但是为什么什么都抓不到?
代码:
static unsigned int hook_func_in(unsigned int hooknum,
struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
int (*okfn)(struct sk_buff*))
{
sb = skb;
ethh = eth_hdr(skb);
printk(" in skb ethh dest %s\n",ethh->h_dest);
printk("in skb ethh source %s\n",ethh->h_source);
return NF_ACCEPT;
}
static struct nf_hook_ops nfho_ops[]=
{
.hook = hook_func_in,
.owner = THIS_MODULE,
.pf =NF_ARP,
.hooknum = NF_ARP_IN,
.priority = NF_IP_PRI_FIRST,
}
static struct nf_hook_ops nfho_ops[]=
{
.hook = hook_func_in,
.owner = THIS_MODULE,
.pf =NF_ARP,
.hooknum = NF_ARP_IN,
.priority = NF_IP_PRI_FIRST,
}