diff options
author | Luca Coelho <luciano.coelho@intel.com> | 2018-09-20 14:28:29 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2018-09-24 09:20:20 +0200 |
commit | ea80c5832dedd40acd24514159045c7b0b0d8759 (patch) | |
tree | 835a4d432a656c7d907daa5410ad8f9f9933663b /backport | |
parent | edd669e066483e89de8e4eba6bcc4583f4d01322 (diff) |
backport: fix compilation with IPV6 not set
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 <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'backport')
-rw-r--r-- | backport/compat/backport-4.4.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/backport/compat/backport-4.4.c b/backport/compat/backport-4.4.c index 1c11a206..7966e949 100644 --- a/backport/compat/backport-4.4.c +++ b/backport/compat/backport-4.4.c @@ -15,6 +15,7 @@ #include <linux/if_vlan.h> #include <linux/mm.h> #include <linux/skbuff.h> +#include <linux/tcp.h> #include <net/ip.h> #include <net/tso.h> #include <asm/unaligned.h> @@ -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); |