根据内核代码对于dev_kfree_skb(其实是consume_skb的包装)的注释: 1/**2* consume_skb - free an skbuff3* @skb: buffer to free4*5* Drop a ref to the buffer and free it if the usage count has hit zero6* Functions identically to kfree_skb, but kfree_skb assumes that the frame7* is...
· void skb_clone_fraglist(struct sk_buff *skb) · void skb_drop_fraglist(struct sk_buff *skb) · void copy_skb_header(struct sk_buff *new, const struct sk_buff *old) · pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, gfp_t gfp_mask) · int skb_copy_bits(const...
·void skb_clone_fraglist(struct sk_buff *skb) ·void skb_drop_fraglist(struct sk_buff *skb) ·void copy_skb_header(struct sk_buff *new, const struct sk_buff *old) ·pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, gfp_t gfp_mask) ·int skb_copy_bits(const struct...
使用相应的net_device数据结构的name这个成员,你就可以根据数据包的源接口和目的接口来选择是否丢弃它。如果想丢弃所有到达接口eth0的数据包,所有你需要做的仅仅是将in->name的值与"eth0"做比较,如果名字匹配,那么hook函数简单的返回NF_DROP即可,数据包会被自动销毁。就是这么简单!完成该功能的示例代码见如下的示例...
dstbuf = opt->dst1; #endif @@ -443,7 +443,7 @@ looped_back: break; } - opt->lastopt = opt->srcrt = skb->h.raw - skb->nh.raw; + opt->lastopt = opt->srcrt = skb_network_header_len(skb); skb->h.raw += (hdr->hdrlen + 1) << 3; ...
Search or jump to... Search code, repositories, users, issues, pull requests... Provide feedback We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your...
Ø 单播:调用br_fdb_find_rcu查找fdb表项, (1)若命中,调用br_forward()将数据包转发, (2)若表项为空,调用函数br_flood() br_flood(br, skb, pkt_type, local_rcv, false); 注意,如果发现目标地址是本地地址(判断方法目标表项dst->flags为BR_FDB_LOCAL),则直接调用br_pass_frame_up()发往本地,...
rt_dst_alloc+0x50/0xd0 ? ip_route_input_slow+0x19a/0x9a0 ? __udp_enqueue_schedule_skb+0x198/0x1b0 ? __udp4_lib_rcv+0x856/0xa30 ? __udp4_lib_rcv+0x856/0xa30 ? cpumask_next_and+0x19/0x20 ? find_busiest_group+0x12d/0xcd0 netdev_frame_hook+0xce/0x150 [openvswitch...
(%dx)):u8 ip_dst=+0x10(+0xe8(%dx)):u32 b16_dest=+0x16(+0xe8(%dx)):u16 comm=$comm body=+0x1c(+0xe8(%dx)):string' >> /sys/kernel/debug/tracing/kprobe_events echo 'proto==17&&ip_dst==0xdd01000a&&b16_dest==1063' > /sys/kernel/debug/tracing/instances/surftrace/events/...
static char *drop_if = "lo";/* 注册的hook函数的实现 */unsigned int hook_func(unsigned int hooknum,struct sk_buff **skb,const struct net_device *in,const struct net_device *out,int (*okfn)(struct sk_buff *)){if (strcmp(in->name, drop_if) == 0) {...