ipv6: move ip6_sk_accept_pmtu from generic pmtu update path to ipv6 one
Subsystems (3)
PATCH 1/1 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.
--- net/sctp/input.c | 3 --- net/sctp/ipv6.c | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-)
net/sctp/input.c +0 -3
@@ -389,9 +389,6 @@ void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc,if (!t || (t->pathmtu <= pmtu))return ; -if (!ip6_sk_accept_pmtu (sk)) -return ; -if (sock_owned_by_user (sk)) { asoc->pmtu_pending =1 ; t->pmtu_pending =1 ;
net/sctp/ipv6.c +2 -1
@@ -172,7 +172,8 @@ static void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,switch (type) {case ICMPV6_PKT_TOOBIG : -sctp_icmp_frag_needed (sk, asoc, transport,ntohl (info)); +if (ip6_sk_accept_pmtu (sk)) +sctp_icmp_frag_needed (sk, asoc, transport,ntohl (info)); goto out_unlock;case ICMPV6_PARAMPROB :if (ICMPV6_UNK_NEXTHDR == code) {
Signature · 1 line
1.8.3.1
Quoted 8 lines · Hannes Frederic Sowa
In commit
93b36cf3425b9b("ipv6: supportIPV6_PMTU_INTERFACEon sockets") I made a horrible mistake to addip6_sk_accept_pmtuto the genericsctp_icmp_frag_neededpath. 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 <[email protected]>Signed-off-by Hannes Frederic Sowa <[email protected]>
Thanks, also cc'ing linux-sctp.
Quoted 34 lines
--- net/sctp/input.c | 3 --- net/sctp/ipv6.c | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-)net/sctp/input.c +0
-3@@ -389,9 +389,6 @@ void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc,if (!t || (t->pathmtu <= pmtu))return ; -if (!ip6_sk_accept_pmtu (sk)) -return ; -if (sock_owned_by_user (sk)) { asoc->pmtu_pending =1 ; t->pmtu_pending =1 ;net/sctp/ipv6.c +2
-1@@ -172,7 +172,8 @@ static void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,switch (type) {case ICMPV6_PKT_TOOBIG : -sctp_icmp_frag_needed (sk, asoc, transport,ntohl (info)); +if (ip6_sk_accept_pmtu (sk)) +sctp_icmp_frag_needed (sk, asoc, transport,ntohl (info)); goto out_unlock;case ICMPV6_PARAMPROB :if (ICMPV6_UNK_NEXTHDR = code) {