Lines Matching refs:skb

50 				struct sk_buff *skb)
53 !skb_dst(skb) && !skb->sk) {
54 switch (ipv6_hdr(skb)->nexthdr) {
57 tcp_v6_early_demux(skb);
61 udp_v6_early_demux(skb);
66 if (!skb_valid_dst(skb))
67 ip6_route_input(skb);
70 int ip6_rcv_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
73 * skb to its handler for processing
75 skb = l3mdev_ip6_rcv(skb);
76 if (!skb)
78 ip6_rcv_finish_core(net, sk, skb);
80 return dst_input(skb);
85 struct sk_buff *skb, *next;
87 list_for_each_entry_safe(skb, next, head, list) {
88 skb_list_del_init(skb);
89 dst_input(skb);
93 static bool ip6_can_use_hint(const struct sk_buff *skb,
96 return hint && !skb_dst(skb) &&
97 ipv6_addr_equal(&ipv6_hdr(hint)->daddr, &ipv6_hdr(skb)->daddr);
101 struct sk_buff *skb)
106 return skb;
112 struct sk_buff *skb, *next, *hint = NULL;
117 list_for_each_entry_safe(skb, next, head, list) {
120 skb_list_del_init(skb);
122 * skb to its handler for processing
124 skb = l3mdev_ip6_rcv(skb);
125 if (!skb)
128 if (ip6_can_use_hint(skb, hint))
129 skb_dst_copy(skb, hint);
131 ip6_rcv_finish_core(net, sk, skb);
132 dst = skb_dst(skb);
134 hint = ip6_extract_route_hint(net, skb);
143 list_add_tail(&skb->list, &sublist);
149 static struct sk_buff *ip6_rcv_core(struct sk_buff *skb, struct net_device *dev,
156 if (skb->pkt_type == PACKET_OTHERHOST) {
157 kfree_skb(skb);
163 idev = __in6_dev_get(skb->dev);
165 __IP6_UPD_PO_STATS(net, idev, IPSTATS_MIB_IN, skb->len);
167 if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL ||
173 memset(IP6CB(skb), 0, sizeof(struct inet6_skb_parm));
177 * be queued, we cannot refer to skb->dev anymore.
181 * via the loopback interface (lo) here; skb->dev = loopback_dev.
186 IP6CB(skb)->iif = skb_valid_dst(skb) ? ip6_dst_idev(skb_dst(skb))->dev->ifindex : dev->ifindex;
188 if (unlikely(!pskb_may_pull(skb, sizeof(*hdr))))
191 hdr = ipv6_hdr(skb);
199 max_t(unsigned short, 1, skb_shinfo(skb)->gso_segs));
219 if (!(skb->pkt_type == PACKET_LOOPBACK ||
230 (skb->pkt_type == PACKET_BROADCAST ||
231 skb->pkt_type == PACKET_MULTICAST) &&
252 skb->transport_header = skb->network_header + sizeof(*hdr);
253 IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr);
259 if (pkt_len + sizeof(struct ipv6hdr) > skb->len) {
264 if (pskb_trim_rcsum(skb, pkt_len + sizeof(struct ipv6hdr))) {
268 hdr = ipv6_hdr(skb);
272 if (ipv6_parse_hopopts(skb) < 0) {
282 if (!skb_sk_is_prefetched(skb))
283 skb_orphan(skb);
285 return skb;
290 kfree_skb(skb);
294 int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
296 struct net *net = dev_net(skb->dev);
298 skb = ip6_rcv_core(skb, dev, net);
299 if (skb == NULL)
302 net, NULL, skb, dev, NULL,
320 struct sk_buff *skb, *next;
324 list_for_each_entry_safe(skb, next, head, list) {
325 struct net_device *dev = skb->dev;
328 skb_list_del_init(skb);
329 skb = ip6_rcv_core(skb, dev, net);
330 if (skb == NULL)
342 list_add_tail(&skb->list, &sublist);
355 void ip6_protocol_deliver_rcu(struct net *net, struct sk_buff *skb, int nexthdr,
368 idev = ip6_dst_idev(skb_dst(skb));
369 nhoff = IP6CB(skb)->nhoff;
371 if (!pskb_pull(skb, skb_transport_offset(skb)))
373 nexthdr = skb_network_header(skb)[nhoff];
377 raw = raw6_local_deliver(skb, nexthdr);
393 int sdif = inet6_sdif(skb);
402 nf_reset_ct(skb);
404 skb_postpull_rcsum(skb, skb_network_header(skb),
405 skb_network_header_len(skb));
406 hdr = ipv6_hdr(skb);
408 /* skb->dev passed may be master dev for vrfs. */
414 dev = skb->dev;
420 !ipv6_is_mld(skb, nexthdr, skb_network_header_len(skb)))
424 !xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))
428 skb);
446 if (xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
449 icmpv6_send(skb, ICMPV6_PARAMPROB,
452 kfree_skb(skb);
455 consume_skb(skb);
462 kfree_skb(skb);
465 static int ip6_input_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
468 ip6_protocol_deliver_rcu(net, skb, 0, false);
475 int ip6_input(struct sk_buff *skb)
478 dev_net(skb->dev), NULL, skb, skb->dev, NULL,
483 int ip6_mc_input(struct sk_buff *skb)
485 int sdif = inet6_sdif(skb);
490 __IP6_UPD_PO_STATS(dev_net(skb_dst(skb)->dev),
491 __in6_dev_get_safely(skb->dev), IPSTATS_MIB_INMCAST,
492 skb->len);
494 /* skb->dev passed may be master dev for vrfs. */
497 dev = dev_get_by_index_rcu(dev_net(skb->dev), sdif);
500 kfree_skb(skb);
504 dev = skb->dev;
507 hdr = ipv6_hdr(skb);
516 if (atomic_read(&dev_net(skb->dev)->ipv6.devconf_all->mc_forwarding) &&
519 likely(!(IP6CB(skb)->flags & IP6SKB_FORWARDED))) {
525 struct inet6_skb_parm *opt = IP6CB(skb);
544 offset = ipv6_skip_exthdr(skb, sizeof(*hdr),
549 if (ipv6_is_mld(skb, nexthdr, offset))
558 skb2 = skb_clone(skb, GFP_ATOMIC);
560 skb2 = skb;
561 skb = NULL;
571 ip6_input(skb);
574 kfree_skb(skb);