From patchwork Thu Sep 20 11:28:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10607513 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 771E0174F for ; Thu, 20 Sep 2018 11:28:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 636752D0A8 for ; Thu, 20 Sep 2018 11:28:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 54EDB2D0A2; Thu, 20 Sep 2018 11:28:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC65A2D0A2 for ; Thu, 20 Sep 2018 11:28:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726954AbeITRLw (ORCPT ); Thu, 20 Sep 2018 13:11:52 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:50948 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727029AbeITRLw (ORCPT ); Thu, 20 Sep 2018 13:11:52 -0400 Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1g2x8a-0004SQ-MZ; Thu, 20 Sep 2018 14:28:49 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Luca Coelho Date: Thu, 20 Sep 2018 14:28:29 +0300 Message-Id: <20180920112842.27198-2-luca@coelho.fi> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920112842.27198-1-luca@coelho.fi> References: <20180920112842.27198-1-luca@coelho.fi> Subject: [PATCH 01/14] backport: fix compilation with IPV6 not set Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luca Coelho At least in some older kernel versions (e.g. 3.10), the tcp.h header file is not implicitly included from other headers if CONFIG_IPV6 is not set, so we need to include it in backport-4.4.c. Also, there is an IPv6 structure that is used, so we should ifdef it away when IPv6 is not enabled. Signed-off-by: Luca Coelho --- backport/compat/backport-4.4.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backport/compat/backport-4.4.c b/backport/compat/backport-4.4.c index 1c11a2064e53..7966e94928e7 100644 --- a/backport/compat/backport-4.4.c +++ b/backport/compat/backport-4.4.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -95,9 +96,14 @@ void tso_build_hdr(struct sk_buff *skb, char *hdr, struct tso_t *tso, iph->tot_len = htons(size + hdr_len - mac_hdr_len); tso->ip_id++; } else { +#ifdef CONFIG_IPV6 struct ipv6hdr *iph = (void *)(hdr + mac_hdr_len); iph->payload_len = htons(size + tcp_hdrlen(skb)); +#else /* CONFIG_IPV6 */ + /* tso->ipv6 should never be set if IPV6 is not enabeld */ + WARN_ON(1); +#endif /* CONFIG_IPV6 */ } tcph = (struct tcphdr *)(hdr + skb_transport_offset(skb)); put_unaligned_be32(tso->tcp_seq, &tcph->seq);