全部博文(230)
发布时间:2013-01-02 19:30:34
好久没写博文了,今天心血来潮,与大家分享一下,欢迎大家随时和我联系! cu.platinum & gmail.com http://weibo.com/bjpt 现象 一次偶然的机会,发现一台服务器出现了极不正常的情况:CPU 消耗巨大 通过用 top 观察,发现 snmpd 进程持续走高 top - 16:51:31 up 546 days, 7:33, 1 user, load average: 2.28, 1.72, 1.39 Tasks: 108 total, 4 running, 104......【阅读全文】
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,
}