aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_output.c
diff options
context:
space:
mode:
authorJacek Kalwas <jacek.kalwas@intel.com>2018-04-12 12:03:13 -0700
committerSteffen Klassert <steffen.klassert@secunet.com>2018-04-18 06:57:17 +0200
commitcd027a5433d66734097adbd9d262c203471102a3 (patch)
tree276ffa2fe458ede28ec39ad7566896d72eb91dcc /net/ipv4/ip_output.c
parentselftests: add xfrm state-policy-monitor to rtnetlink.sh (diff)
downloadlinux-dev-cd027a5433d66734097adbd9d262c203471102a3.tar.xz
linux-dev-cd027a5433d66734097adbd9d262c203471102a3.zip
udp: enable UDP checksum offload for ESP
In case NIC has support for ESP TX CSUM offload skb->ip_summed is not set to CHECKSUM_PARTIAL which results in checksum calculated by SW. Fix enables ESP TX CSUM for UDP by extending condition with check for NETIF_F_HW_ESP_TX_CSUM. Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r--net/ipv4/ip_output.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 4c11b810a447..a2dfb5a9ba76 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -907,7 +907,7 @@ static int __ip_append_data(struct sock *sk,
length + fragheaderlen <= mtu &&
rt->dst.dev->features & (NETIF_F_HW_CSUM | NETIF_F_IP_CSUM) &&
!(flags & MSG_MORE) &&
- !exthdrlen)
+ (!exthdrlen || (rt->dst.dev->features & NETIF_F_HW_ESP_TX_CSUM)))
csummode = CHECKSUM_PARTIAL;
cork->length += length;