blob: b41e367e9c3d671bc3594c7c354f54c57e90b1df [file] [log] [blame]
From 90d25f8057ef6b33bc114de64727d3871d06d943 Mon Sep 17 00:00:00 2001
From: Cong Wang <>
Date: Wed, 22 Jul 2020 18:56:25 -0700
Subject: [PATCH] geneve: fix an uninitialized value in geneve_changelink()
commit 32818c075c54bb0cae44dd6f7ab00b01c52b8372 upstream.
geneve_nl2info() sets 'df' conditionally, so we have to
initialize it by copying the value from existing geneve
device in geneve_changelink().
Fixes: 56c09de347e4 ("geneve: allow changing DF behavior after creation")
Cc: Sabrina Dubroca <>
Signed-off-by: Cong Wang <>
Reviewed-by: Sabrina Dubroca <>
Signed-off-by: David S. Miller <>
Signed-off-by: Paul Gortmaker <>
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index fcf53c95cafc..42bc72f7685a 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1615,11 +1615,11 @@ static int geneve_changelink(struct net_device *dev, struct nlattr *tb[],
struct netlink_ext_ack *extack)
struct geneve_dev *geneve = netdev_priv(dev);
+ enum ifla_geneve_df df = geneve->df;
struct geneve_sock *gs4, *gs6;
struct ip_tunnel_info info;
bool metadata;
bool use_udp6_rx_checksums;
- enum ifla_geneve_df df;
bool ttl_inherit;
int err;