diff options
author | Hannes Frederic Sowa <hannes@stressinduktion.org> | 2013-12-19 06:54:58 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-21 22:00:59 -0500 |
commit | 790e38bc26c4db72a1905c51daaa502e48081616 (patch) | |
tree | 077ac4b5b2b76fd6b4f3c59a397ee4d73cd134d5 | |
parent | fc45b4554045b4bb9112a848696f60ed4d94b0f4 (diff) |
ipv6: move ip6_sk_accept_pmtu from generic pmtu update path to ipv6 one
In commit 93b36cf3425b9b ("ipv6: support IPV6_PMTU_INTERFACE on sockets")
I made a horrible mistake to add ip6_sk_accept_pmtu to the generic
sctp_icmp_frag_needed path. This results in build warnings if IPv6 is
disabled which were luckily caught by Fengguang's kbuild bot. But it
also leads to a kernel panic IPv4 frag-needed packet is received.
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/sctp/input.c | 3 | ||||
-rw-r--r-- | net/sctp/ipv6.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c index 042ec6c9ae24..2a192a7c5d81 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
@@ -389,9 +389,6 @@ void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc, | |||
389 | if (!t || (t->pathmtu <= pmtu)) | 389 | if (!t || (t->pathmtu <= pmtu)) |
390 | return; | 390 | return; |
391 | 391 | ||
392 | if (!ip6_sk_accept_pmtu(sk)) | ||
393 | return; | ||
394 | |||
395 | if (sock_owned_by_user(sk)) { | 392 | if (sock_owned_by_user(sk)) { |
396 | asoc->pmtu_pending = 1; | 393 | asoc->pmtu_pending = 1; |
397 | t->pmtu_pending = 1; | 394 | t->pmtu_pending = 1; |
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index 317e13eb2c56..14191ab4165f 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c | |||
@@ -172,7 +172,8 @@ static void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
172 | 172 | ||
173 | switch (type) { | 173 | switch (type) { |
174 | case ICMPV6_PKT_TOOBIG: | 174 | case ICMPV6_PKT_TOOBIG: |
175 | sctp_icmp_frag_needed(sk, asoc, transport, ntohl(info)); | 175 | if (ip6_sk_accept_pmtu(sk)) |
176 | sctp_icmp_frag_needed(sk, asoc, transport, ntohl(info)); | ||
176 | goto out_unlock; | 177 | goto out_unlock; |
177 | case ICMPV6_PARAMPROB: | 178 | case ICMPV6_PARAMPROB: |
178 | if (ICMPV6_UNK_NEXTHDR == code) { | 179 | if (ICMPV6_UNK_NEXTHDR == code) { |