Lines Matching refs:skb
50 struct sk_buff *skb) in ip6_rcv_finish_core() argument
52 void (*edemux)(struct sk_buff *skb); in ip6_rcv_finish_core()
54 if (net->ipv4.sysctl_ip_early_demux && !skb_dst(skb) && skb->sk == NULL) { in ip6_rcv_finish_core()
57 ipprot = rcu_dereference(inet6_protos[ipv6_hdr(skb)->nexthdr]); in ip6_rcv_finish_core()
60 udp_v6_early_demux, skb); in ip6_rcv_finish_core()
62 if (!skb_valid_dst(skb)) in ip6_rcv_finish_core()
63 ip6_route_input(skb); in ip6_rcv_finish_core()
66 int ip6_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb) in ip6_rcv_finish() argument
71 skb = l3mdev_ip6_rcv(skb); in ip6_rcv_finish()
72 if (!skb) in ip6_rcv_finish()
74 ip6_rcv_finish_core(net, sk, skb); in ip6_rcv_finish()
76 return dst_input(skb); in ip6_rcv_finish()
81 struct sk_buff *skb, *next; in ip6_sublist_rcv_finish() local
83 list_for_each_entry_safe(skb, next, head, list) { in ip6_sublist_rcv_finish()
84 skb_list_del_init(skb); in ip6_sublist_rcv_finish()
85 dst_input(skb); in ip6_sublist_rcv_finish()
89 static bool ip6_can_use_hint(const struct sk_buff *skb, in ip6_can_use_hint() argument
92 return hint && !skb_dst(skb) && in ip6_can_use_hint()
93 ipv6_addr_equal(&ipv6_hdr(hint)->daddr, &ipv6_hdr(skb)->daddr); in ip6_can_use_hint()
97 struct sk_buff *skb) in ip6_extract_route_hint() argument
102 return skb; in ip6_extract_route_hint()
108 struct sk_buff *skb, *next, *hint = NULL; in ip6_list_rcv_finish() local
113 list_for_each_entry_safe(skb, next, head, list) { in ip6_list_rcv_finish()
116 skb_list_del_init(skb); in ip6_list_rcv_finish()
120 skb = l3mdev_ip6_rcv(skb); in ip6_list_rcv_finish()
121 if (!skb) in ip6_list_rcv_finish()
124 if (ip6_can_use_hint(skb, hint)) in ip6_list_rcv_finish()
125 skb_dst_copy(skb, hint); in ip6_list_rcv_finish()
127 ip6_rcv_finish_core(net, sk, skb); in ip6_list_rcv_finish()
128 dst = skb_dst(skb); in ip6_list_rcv_finish()
130 hint = ip6_extract_route_hint(net, skb); in ip6_list_rcv_finish()
139 list_add_tail(&skb->list, &sublist); in ip6_list_rcv_finish()
145 static struct sk_buff *ip6_rcv_core(struct sk_buff *skb, struct net_device *dev, in ip6_rcv_core() argument
152 if (skb->pkt_type == PACKET_OTHERHOST) { in ip6_rcv_core()
153 kfree_skb(skb); in ip6_rcv_core()
159 idev = __in6_dev_get(skb->dev); in ip6_rcv_core()
161 __IP6_UPD_PO_STATS(net, idev, IPSTATS_MIB_IN, skb->len); in ip6_rcv_core()
163 if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL || in ip6_rcv_core()
169 memset(IP6CB(skb), 0, sizeof(struct inet6_skb_parm)); in ip6_rcv_core()
182 IP6CB(skb)->iif = skb_valid_dst(skb) ? ip6_dst_idev(skb_dst(skb))->dev->ifindex : dev->ifindex; in ip6_rcv_core()
184 if (unlikely(!pskb_may_pull(skb, sizeof(*hdr)))) in ip6_rcv_core()
187 hdr = ipv6_hdr(skb); in ip6_rcv_core()
195 max_t(unsigned short, 1, skb_shinfo(skb)->gso_segs)); in ip6_rcv_core()
215 if (!(skb->pkt_type == PACKET_LOOPBACK || in ip6_rcv_core()
226 (skb->pkt_type == PACKET_BROADCAST || in ip6_rcv_core()
227 skb->pkt_type == PACKET_MULTICAST) && in ip6_rcv_core()
258 skb->transport_header = skb->network_header + sizeof(*hdr); in ip6_rcv_core()
259 IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr); in ip6_rcv_core()
265 if (pkt_len + sizeof(struct ipv6hdr) > skb->len) { in ip6_rcv_core()
270 if (pskb_trim_rcsum(skb, pkt_len + sizeof(struct ipv6hdr))) { in ip6_rcv_core()
274 hdr = ipv6_hdr(skb); in ip6_rcv_core()
278 if (ipv6_parse_hopopts(skb) < 0) { in ip6_rcv_core()
288 if (!skb_sk_is_prefetched(skb)) in ip6_rcv_core()
289 skb_orphan(skb); in ip6_rcv_core()
291 return skb; in ip6_rcv_core()
296 kfree_skb(skb); in ip6_rcv_core()
300 int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device… in ipv6_rcv() argument
302 struct net *net = dev_net(skb->dev); in ipv6_rcv()
304 skb = ip6_rcv_core(skb, dev, net); in ipv6_rcv()
305 if (skb == NULL) in ipv6_rcv()
308 net, NULL, skb, dev, NULL, in ipv6_rcv()
326 struct sk_buff *skb, *next; in ipv6_list_rcv() local
330 list_for_each_entry_safe(skb, next, head, list) { in ipv6_list_rcv()
331 struct net_device *dev = skb->dev; in ipv6_list_rcv()
334 skb_list_del_init(skb); in ipv6_list_rcv()
335 skb = ip6_rcv_core(skb, dev, net); in ipv6_list_rcv()
336 if (skb == NULL) in ipv6_list_rcv()
348 list_add_tail(&skb->list, &sublist); in ipv6_list_rcv()
361 void ip6_protocol_deliver_rcu(struct net *net, struct sk_buff *skb, int nexthdr, in ip6_protocol_deliver_rcu() argument
374 idev = ip6_dst_idev(skb_dst(skb)); in ip6_protocol_deliver_rcu()
375 nhoff = IP6CB(skb)->nhoff; in ip6_protocol_deliver_rcu()
377 if (!pskb_pull(skb, skb_transport_offset(skb))) in ip6_protocol_deliver_rcu()
379 nexthdr = skb_network_header(skb)[nhoff]; in ip6_protocol_deliver_rcu()
383 raw = raw6_local_deliver(skb, nexthdr); in ip6_protocol_deliver_rcu()
399 int sdif = inet6_sdif(skb); in ip6_protocol_deliver_rcu()
408 nf_reset_ct(skb); in ip6_protocol_deliver_rcu()
410 skb_postpull_rcsum(skb, skb_network_header(skb), in ip6_protocol_deliver_rcu()
411 skb_network_header_len(skb)); in ip6_protocol_deliver_rcu()
412 hdr = ipv6_hdr(skb); in ip6_protocol_deliver_rcu()
420 dev = skb->dev; in ip6_protocol_deliver_rcu()
426 !ipv6_is_mld(skb, nexthdr, skb_network_header_len(skb))) in ip6_protocol_deliver_rcu()
430 !xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) in ip6_protocol_deliver_rcu()
434 skb); in ip6_protocol_deliver_rcu()
452 if (xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) { in ip6_protocol_deliver_rcu()
455 icmpv6_send(skb, ICMPV6_PARAMPROB, in ip6_protocol_deliver_rcu()
458 kfree_skb(skb); in ip6_protocol_deliver_rcu()
461 consume_skb(skb); in ip6_protocol_deliver_rcu()
468 kfree_skb(skb); in ip6_protocol_deliver_rcu()
471 static int ip6_input_finish(struct net *net, struct sock *sk, struct sk_buff *skb) in ip6_input_finish() argument
474 ip6_protocol_deliver_rcu(net, skb, 0, false); in ip6_input_finish()
481 int ip6_input(struct sk_buff *skb) in ip6_input() argument
484 dev_net(skb->dev), NULL, skb, skb->dev, NULL, in ip6_input()
489 int ip6_mc_input(struct sk_buff *skb) in ip6_mc_input() argument
491 int sdif = inet6_sdif(skb); in ip6_mc_input()
496 __IP6_UPD_PO_STATS(dev_net(skb_dst(skb)->dev), in ip6_mc_input()
497 __in6_dev_get_safely(skb->dev), IPSTATS_MIB_INMCAST, in ip6_mc_input()
498 skb->len); in ip6_mc_input()
503 dev = dev_get_by_index_rcu(dev_net(skb->dev), sdif); in ip6_mc_input()
506 kfree_skb(skb); in ip6_mc_input()
510 dev = skb->dev; in ip6_mc_input()
513 hdr = ipv6_hdr(skb); in ip6_mc_input()
522 if (dev_net(skb->dev)->ipv6.devconf_all->mc_forwarding && in ip6_mc_input()
525 likely(!(IP6CB(skb)->flags & IP6SKB_FORWARDED))) { in ip6_mc_input()
531 struct inet6_skb_parm *opt = IP6CB(skb); in ip6_mc_input()
550 offset = ipv6_skip_exthdr(skb, sizeof(*hdr), in ip6_mc_input()
555 if (ipv6_is_mld(skb, nexthdr, offset)) in ip6_mc_input()
564 skb2 = skb_clone(skb, GFP_ATOMIC); in ip6_mc_input()
566 skb2 = skb; in ip6_mc_input()
567 skb = NULL; in ip6_mc_input()
577 ip6_input(skb); in ip6_mc_input()
580 kfree_skb(skb); in ip6_mc_input()