Subject: [PATCH iproute2-next v2 2/3] ip link: Drop cache entry on any changes

From: David Ahern <[email-masked]>
Date: Wed, 13 Feb 2019 16:22:48 -0800

From: David Ahern <[email-masked]>

Remove any entry from the link cache when the link is modified.

Signed-off-by: David Ahern <[email-masked]>
---
 ip/iplink.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ip/iplink.c b/ip/iplink.c
index b5519201fef7..393cefdc89df 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -1083,6 +1083,9 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
 	if (rtnl_talk(&rth, &req.n, NULL) < 0)
 		return -2;
 
+	/* remove device from cache; next use can refresh with new data */
+	ll_drop_by_index(req.i.ifi_index);
+
 	return 0;
 }
 
-- 
2.11.0