diff options
Diffstat (limited to 'net/ipv6/af_inet6.c')
-rw-r--r-- | net/ipv6/af_inet6.c | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 61f55386a236..85b3d0036afd 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -72,9 +72,21 @@ MODULE_LICENSE("GPL"); | |||
72 | static struct list_head inetsw6[SOCK_MAX]; | 72 | static struct list_head inetsw6[SOCK_MAX]; |
73 | static DEFINE_SPINLOCK(inetsw6_lock); | 73 | static DEFINE_SPINLOCK(inetsw6_lock); |
74 | 74 | ||
75 | static int disable_ipv6 = 0; | 75 | struct ipv6_params ipv6_defaults = { |
76 | module_param_named(disable, disable_ipv6, int, 0); | 76 | .disable_ipv6 = 0, |
77 | MODULE_PARM_DESC(disable, "Disable IPv6 such that it is non-functional"); | 77 | .autoconf = 1, |
78 | }; | ||
79 | |||
80 | static int disable_ipv6_mod = 0; | ||
81 | |||
82 | module_param_named(disable, disable_ipv6_mod, int, 0444); | ||
83 | MODULE_PARM_DESC(disable, "Disable IPv6 module such that it is non-functional"); | ||
84 | |||
85 | module_param_named(disable_ipv6, ipv6_defaults.disable_ipv6, int, 0444); | ||
86 | MODULE_PARM_DESC(disable_ipv6, "Disable IPv6 on all interfaces"); | ||
87 | |||
88 | module_param_named(autoconf, ipv6_defaults.autoconf, int, 0444); | ||
89 | MODULE_PARM_DESC(autoconf, "Enable IPv6 address autoconfiguration on all interfaces"); | ||
78 | 90 | ||
79 | static __inline__ struct ipv6_pinfo *inet6_sk_generic(struct sock *sk) | 91 | static __inline__ struct ipv6_pinfo *inet6_sk_generic(struct sock *sk) |
80 | { | 92 | { |
@@ -817,13 +829,20 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head, | |||
817 | struct sk_buff *p; | 829 | struct sk_buff *p; |
818 | struct ipv6hdr *iph; | 830 | struct ipv6hdr *iph; |
819 | unsigned int nlen; | 831 | unsigned int nlen; |
832 | unsigned int hlen; | ||
833 | unsigned int off; | ||
820 | int flush = 1; | 834 | int flush = 1; |
821 | int proto; | 835 | int proto; |
822 | __wsum csum; | 836 | __wsum csum; |
823 | 837 | ||
824 | iph = skb_gro_header(skb, sizeof(*iph)); | 838 | off = skb_gro_offset(skb); |
825 | if (unlikely(!iph)) | 839 | hlen = off + sizeof(*iph); |
826 | goto out; | 840 | iph = skb_gro_header_fast(skb, off); |
841 | if (skb_gro_header_hard(skb, hlen)) { | ||
842 | iph = skb_gro_header_slow(skb, hlen, off); | ||
843 | if (unlikely(!iph)) | ||
844 | goto out; | ||
845 | } | ||
827 | 846 | ||
828 | skb_gro_pull(skb, sizeof(*iph)); | 847 | skb_gro_pull(skb, sizeof(*iph)); |
829 | skb_set_transport_header(skb, skb_gro_offset(skb)); | 848 | skb_set_transport_header(skb, skb_gro_offset(skb)); |
@@ -1031,7 +1050,7 @@ static int __init inet6_init(void) | |||
1031 | for(r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r) | 1050 | for(r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r) |
1032 | INIT_LIST_HEAD(r); | 1051 | INIT_LIST_HEAD(r); |
1033 | 1052 | ||
1034 | if (disable_ipv6) { | 1053 | if (disable_ipv6_mod) { |
1035 | printk(KERN_INFO | 1054 | printk(KERN_INFO |
1036 | "IPv6: Loaded, but administratively disabled, " | 1055 | "IPv6: Loaded, but administratively disabled, " |
1037 | "reboot required to enable\n"); | 1056 | "reboot required to enable\n"); |
@@ -1220,7 +1239,7 @@ module_init(inet6_init); | |||
1220 | 1239 | ||
1221 | static void __exit inet6_exit(void) | 1240 | static void __exit inet6_exit(void) |
1222 | { | 1241 | { |
1223 | if (disable_ipv6) | 1242 | if (disable_ipv6_mod) |
1224 | return; | 1243 | return; |
1225 | 1244 | ||
1226 | /* First of all disallow new sockets creation. */ | 1245 | /* First of all disallow new sockets creation. */ |