Lines Matching refs:skb
27 br_netif_receive_skb(struct net *net, struct sock *sk, struct sk_buff *skb) in br_netif_receive_skb() argument
29 br_drop_fake_rtable(skb); in br_netif_receive_skb()
30 return netif_receive_skb(skb); in br_netif_receive_skb()
33 static int br_pass_frame_up(struct sk_buff *skb) in br_pass_frame_up() argument
35 struct net_device *indev, *brdev = BR_INPUT_SKB_CB(skb)->brdev; in br_pass_frame_up()
39 dev_sw_netstats_rx_add(brdev, skb->len); in br_pass_frame_up()
47 !br_allowed_egress(vg, skb)) { in br_pass_frame_up()
48 kfree_skb(skb); in br_pass_frame_up()
52 indev = skb->dev; in br_pass_frame_up()
53 skb->dev = brdev; in br_pass_frame_up()
54 skb = br_handle_vlan(br, NULL, vg, skb); in br_pass_frame_up()
55 if (!skb) in br_pass_frame_up()
58 br_multicast_count(br, NULL, skb, br_multicast_igmp_type(skb), in br_pass_frame_up()
62 dev_net(indev), NULL, skb, indev, NULL, in br_pass_frame_up()
67 int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb) in br_handle_frame_finish() argument
69 struct net_bridge_port *p = br_port_get_rcu(skb->dev); in br_handle_frame_finish()
87 if (!br_allowed_ingress(p->br, nbp_vlan_group_rcu(p), skb, &vid, in br_handle_frame_finish()
91 nbp_switchdev_frame_mark(p, skb); in br_handle_frame_finish()
96 br_fdb_update(br, p, eth_hdr(skb)->h_source, vid, 0); in br_handle_frame_finish()
99 if (is_multicast_ether_addr(eth_hdr(skb)->h_dest)) { in br_handle_frame_finish()
101 if (is_broadcast_ether_addr(eth_hdr(skb)->h_dest)) { in br_handle_frame_finish()
106 if (br_multicast_rcv(&brmctx, &pmctx, vlan, skb, vid)) in br_handle_frame_finish()
114 BR_INPUT_SKB_CB(skb)->brdev = br->dev; in br_handle_frame_finish()
115 BR_INPUT_SKB_CB(skb)->src_port_isolated = !!(p->flags & BR_ISOLATED); in br_handle_frame_finish()
118 (skb->protocol == htons(ETH_P_ARP) || in br_handle_frame_finish()
119 skb->protocol == htons(ETH_P_RARP))) { in br_handle_frame_finish()
120 br_do_proxy_suppress_arp(skb, br, vid, p); in br_handle_frame_finish()
122 skb->protocol == htons(ETH_P_IPV6) && in br_handle_frame_finish()
124 pskb_may_pull(skb, sizeof(struct ipv6hdr) + in br_handle_frame_finish()
126 ipv6_hdr(skb)->nexthdr == IPPROTO_ICMPV6) { in br_handle_frame_finish()
129 msg = br_is_nd_neigh_msg(skb, &_msg); in br_handle_frame_finish()
131 br_do_suppress_nd(skb, br, vid, p, msg); in br_handle_frame_finish()
136 mdst = br_mdb_get(brmctx, skb, vid); in br_handle_frame_finish()
137 if ((mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb)) && in br_handle_frame_finish()
138 br_multicast_querier_exists(brmctx, eth_hdr(skb), mdst)) { in br_handle_frame_finish()
140 br_multicast_is_router(brmctx, skb)) { in br_handle_frame_finish()
151 dst = br_fdb_find_rcu(br, eth_hdr(skb)->h_dest, vid); in br_handle_frame_finish()
161 return br_pass_frame_up(skb); in br_handle_frame_finish()
165 br_forward(dst->dst, skb, local_rcv, false); in br_handle_frame_finish()
168 br_flood(br, skb, pkt_type, local_rcv, false); in br_handle_frame_finish()
170 br_multicast_flood(mdst, skb, brmctx, local_rcv, false); in br_handle_frame_finish()
174 return br_pass_frame_up(skb); in br_handle_frame_finish()
179 kfree_skb(skb); in br_handle_frame_finish()
184 static void __br_handle_local_finish(struct sk_buff *skb) in __br_handle_local_finish() argument
186 struct net_bridge_port *p = br_port_get_rcu(skb->dev); in __br_handle_local_finish()
193 br_should_learn(p, skb, &vid)) in __br_handle_local_finish()
194 br_fdb_update(p->br, p, eth_hdr(skb)->h_source, vid, 0); in __br_handle_local_finish()
198 static int br_handle_local_finish(struct net *net, struct sock *sk, struct sk_buff *skb) in br_handle_local_finish() argument
200 __br_handle_local_finish(skb); in br_handle_local_finish()
206 static int nf_hook_bridge_pre(struct sk_buff *skb, struct sk_buff **pskb) in nf_hook_bridge_pre() argument
215 net = dev_net(skb->dev); in nf_hook_bridge_pre()
226 NFPROTO_BRIDGE, skb->dev, NULL, NULL, in nf_hook_bridge_pre()
230 verdict = nf_hook_entry_hookfn(&e->hooks[i], skb, &state); in nf_hook_bridge_pre()
233 if (BR_INPUT_SKB_CB(skb)->br_netfilter_broute) { in nf_hook_bridge_pre()
234 *pskb = skb; in nf_hook_bridge_pre()
239 kfree_skb(skb); in nf_hook_bridge_pre()
242 ret = nf_queue(skb, &state, i, verdict); in nf_hook_bridge_pre()
251 net = dev_net(skb->dev); in nf_hook_bridge_pre()
252 br_handle_frame_finish(net, NULL, skb); in nf_hook_bridge_pre()
254 br_handle_frame_finish(dev_net(skb->dev), NULL, skb); in nf_hook_bridge_pre()
263 struct sk_buff *skb) in br_process_frame_type() argument
268 if (unlikely(tmp->type == skb->protocol)) in br_process_frame_type()
269 return tmp->frame_handler(p, skb); in br_process_frame_type()
281 struct sk_buff *skb = *pskb; in br_handle_frame() local
282 const unsigned char *dest = eth_hdr(skb)->h_dest; in br_handle_frame()
284 if (unlikely(skb->pkt_type == PACKET_LOOPBACK)) in br_handle_frame()
287 if (!is_valid_ether_addr(eth_hdr(skb)->h_source)) in br_handle_frame()
290 skb = skb_share_check(skb, GFP_ATOMIC); in br_handle_frame()
291 if (!skb) in br_handle_frame()
294 memset(skb->cb, 0, sizeof(struct br_input_skb_cb)); in br_handle_frame()
296 p = br_port_get_rcu(skb->dev); in br_handle_frame()
298 br_handle_ingress_vlan_tunnel(skb, p, nbp_vlan_group_rcu(p)); in br_handle_frame()
324 *pskb = skb; in br_handle_frame()
325 __br_handle_local_finish(skb); in br_handle_frame()
335 *pskb = skb; in br_handle_frame()
336 __br_handle_local_finish(skb); in br_handle_frame()
352 dev_net(skb->dev), NULL, skb, skb->dev, NULL, in br_handle_frame()
360 if (unlikely(br_process_frame_type(p, skb))) in br_handle_frame()
368 skb->pkt_type = PACKET_HOST; in br_handle_frame()
370 return nf_hook_bridge_pre(skb, pskb); in br_handle_frame()
373 kfree_skb(skb); in br_handle_frame()