diff options
Diffstat (limited to 'patches/collateral-evolutions/network')
3 files changed, 100 insertions, 0 deletions
diff --git a/patches/collateral-evolutions/network/0012-ieee802154-6lowpan-namespace.patch b/patches/collateral-evolutions/network/0012-ieee802154-6lowpan-namespace.patch new file mode 100644 index 00000000..218a7685 --- /dev/null +++ b/patches/collateral-evolutions/network/0012-ieee802154-6lowpan-namespace.patch @@ -0,0 +1,63 @@ +This is required unless we add some macro wrappers for this +type of static work upstream but not sure if that is a good +idea yet. + +--- a/net/ieee802154/reassembly.c ++++ b/net/ieee802154/reassembly.c +@@ -104,7 +104,11 @@ static void lowpan_frag_expire(unsigned + struct net *net; + + fq = container_of((struct inet_frag_queue *)data, struct frag_queue, q); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) + net = container_of(fq->q.net, struct net, ieee802154_lowpan.frags); ++#else ++ net = &init_net; ++#endif + + lowpan_expire_frag_queue(fq, &lowpan_frags); + } +@@ -386,28 +390,44 @@ EXPORT_SYMBOL(lowpan_frag_rcv); + static struct ctl_table lowpan_frags_ns_ctl_table[] = { + { + .procname = "6lowpanfrag_high_thresh", ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) + .data = &init_net.ieee802154_lowpan.frags.high_thresh, ++#else ++ .data = &ieee802154_lowpan.frags.high_thresh, ++#endif + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec + }, + { + .procname = "6lowpanfrag_low_thresh", ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) + .data = &init_net.ieee802154_lowpan.frags.low_thresh, ++#else ++ .data = &ieee802154_lowpan.frags.low_thresh, ++#endif + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec + }, + { + .procname = "6lowpanfrag_time", ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) + .data = &init_net.ieee802154_lowpan.frags.timeout, ++#else ++ .data = &ieee802154_lowpan.frags.timeout, ++#endif + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec_jiffies, + }, + { + .procname = "6lowpanfrag_max_datagram_size", ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) + .data = &init_net.ieee802154_lowpan.max_dsize, ++#else ++ .data = &ieee802154_lowpan.max_dsize, ++#endif + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec diff --git a/patches/collateral-evolutions/network/0013-net-user-ns.patch b/patches/collateral-evolutions/network/0013-net-user-ns.patch new file mode 100644 index 00000000..25752ca2 --- /dev/null +++ b/patches/collateral-evolutions/network/0013-net-user-ns.patch @@ -0,0 +1,17 @@ +network namespaces didn't get usernamespaces pegged until 3.8 +via commit 038e7332b8. + +--- a/net/ieee802154/reassembly.c ++++ b/net/ieee802154/reassembly.c +@@ -472,9 +472,11 @@ static int __net_init lowpan_frags_ns_sy + table[2].data = &ieee802154_lowpan->frags.timeout; + table[3].data = &ieee802154_lowpan->max_dsize; + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) + /* Don't export sysctls to unprivileged users */ + if (net->user_ns != &init_user_ns) + table[0].procname = NULL; ++#endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(3,8,0) */ + } + + hdr = register_net_sysctl(net, "net/ieee802154/6lowpan", table); diff --git a/patches/collateral-evolutions/network/0014-inet_frag_evictor.patch b/patches/collateral-evolutions/network/0014-inet_frag_evictor.patch new file mode 100644 index 00000000..cfcbb4df --- /dev/null +++ b/patches/collateral-evolutions/network/0014-inet_frag_evictor.patch @@ -0,0 +1,20 @@ +We can't backport this with a macro or inline helper, so just +carry the patch and if this grows consider Coccinelle SmPL version. + +--- a/net/ieee802154/reassembly.c ++++ b/net/ieee802154/reassembly.c +@@ -374,7 +374,14 @@ int lowpan_frag_rcv(struct sk_buff *skb, + if (frag_info->d_size > ieee802154_lowpan->max_dsize) + goto err; + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0) + inet_frag_evictor(&ieee802154_lowpan->frags, &lowpan_frags, false); ++#else ++ if (atomic_read(&ieee802154_lowpan->frags.mem) <= &ieee802154_lowpan->frags.high_thresh) ++ return 0; ++ else ++ inet_frag_evictor(&ieee802154_lowpan->frags, &lowpan_frags); ++#endif + + fq = fq_find(net, frag_info, &mac_cb(skb)->sa, &mac_cb(skb)->da); + if (fq != NULL) { |