reassembly.c (4ba24fef3eb3b142197135223b90ced2f319cd53) reassembly.c (63159f29be1df7f93563a8a0f78c5e65fc844ed6)
1/*
2 * IPv6 fragment reassembly
3 * Linux INET6 implementation
4 *
5 * Authors:
6 * Pedro Roque <roque@di.fc.ul.pt>
7 *
8 * Based on: net/ipv4/ip_fragment.c

--- 416 unchanged lines hidden (view full) ---

425 /* If the first fragment is fragmented itself, we split
426 * it to two chunks: the first with data and paged part
427 * and the second, holding only fragments. */
428 if (skb_has_frag_list(head)) {
429 struct sk_buff *clone;
430 int i, plen = 0;
431
432 clone = alloc_skb(0, GFP_ATOMIC);
1/*
2 * IPv6 fragment reassembly
3 * Linux INET6 implementation
4 *
5 * Authors:
6 * Pedro Roque <roque@di.fc.ul.pt>
7 *
8 * Based on: net/ipv4/ip_fragment.c

--- 416 unchanged lines hidden (view full) ---

425 /* If the first fragment is fragmented itself, we split
426 * it to two chunks: the first with data and paged part
427 * and the second, holding only fragments. */
428 if (skb_has_frag_list(head)) {
429 struct sk_buff *clone;
430 int i, plen = 0;
431
432 clone = alloc_skb(0, GFP_ATOMIC);
433 if (clone == NULL)
433 if (!clone)
434 goto out_oom;
435 clone->next = head->next;
436 head->next = clone;
437 skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list;
438 skb_frag_list_init(head);
439 for (i = 0; i < skb_shinfo(head)->nr_frags; i++)
440 plen += skb_frag_size(&skb_shinfo(head)->frags[i]);
441 clone->len = clone->data_len = head->data_len - plen;

--- 185 unchanged lines hidden (view full) ---

627static int __net_init ip6_frags_ns_sysctl_register(struct net *net)
628{
629 struct ctl_table *table;
630 struct ctl_table_header *hdr;
631
632 table = ip6_frags_ns_ctl_table;
633 if (!net_eq(net, &init_net)) {
634 table = kmemdup(table, sizeof(ip6_frags_ns_ctl_table), GFP_KERNEL);
434 goto out_oom;
435 clone->next = head->next;
436 head->next = clone;
437 skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list;
438 skb_frag_list_init(head);
439 for (i = 0; i < skb_shinfo(head)->nr_frags; i++)
440 plen += skb_frag_size(&skb_shinfo(head)->frags[i]);
441 clone->len = clone->data_len = head->data_len - plen;

--- 185 unchanged lines hidden (view full) ---

627static int __net_init ip6_frags_ns_sysctl_register(struct net *net)
628{
629 struct ctl_table *table;
630 struct ctl_table_header *hdr;
631
632 table = ip6_frags_ns_ctl_table;
633 if (!net_eq(net, &init_net)) {
634 table = kmemdup(table, sizeof(ip6_frags_ns_ctl_table), GFP_KERNEL);
635 if (table == NULL)
635 if (!table)
636 goto err_alloc;
637
638 table[0].data = &net->ipv6.frags.high_thresh;
639 table[0].extra1 = &net->ipv6.frags.low_thresh;
640 table[0].extra2 = &init_net.ipv6.frags.high_thresh;
641 table[1].data = &net->ipv6.frags.low_thresh;
642 table[1].extra2 = &net->ipv6.frags.high_thresh;
643 table[2].data = &net->ipv6.frags.timeout;
644
645 /* Don't export sysctls to unprivileged users */
646 if (net->user_ns != &init_user_ns)
647 table[0].procname = NULL;
648 }
649
650 hdr = register_net_sysctl(net, "net/ipv6", table);
636 goto err_alloc;
637
638 table[0].data = &net->ipv6.frags.high_thresh;
639 table[0].extra1 = &net->ipv6.frags.low_thresh;
640 table[0].extra2 = &init_net.ipv6.frags.high_thresh;
641 table[1].data = &net->ipv6.frags.low_thresh;
642 table[1].extra2 = &net->ipv6.frags.high_thresh;
643 table[2].data = &net->ipv6.frags.timeout;
644
645 /* Don't export sysctls to unprivileged users */
646 if (net->user_ns != &init_user_ns)
647 table[0].procname = NULL;
648 }
649
650 hdr = register_net_sysctl(net, "net/ipv6", table);
651 if (hdr == NULL)
651 if (!hdr)
652 goto err_reg;
653
654 net->ipv6.sysctl.frags_hdr = hdr;
655 return 0;
656
657err_reg:
658 if (!net_eq(net, &init_net))
659 kfree(table);

--- 113 unchanged lines hidden ---
652 goto err_reg;
653
654 net->ipv6.sysctl.frags_hdr = hdr;
655 return 0;
656
657err_reg:
658 if (!net_eq(net, &init_net))
659 kfree(table);

--- 113 unchanged lines hidden ---