From 8026fe2e3a9089eff3f5a06ee6e3cc78d96334ed Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Tue, 5 Feb 2013 13:52:22 +0100 Subject: [PATCH] link: Free and realloc af specific data upon rtnl_link_set_family() Signed-off-by: Thomas Graf --- lib/route/link.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/route/link.c b/lib/route/link.c index 99c5013..7450545 100644 --- a/lib/route/link.c +++ b/lib/route/link.c @@ -1742,6 +1742,12 @@ void rtnl_link_set_family(struct rtnl_link *link, int family) { link->l_family = family; link->ce_mask |= LINK_ATTR_FAMILY; + + if (link->l_af_ops) + af_free(link, link->l_af_ops, + link->l_af_data[link->l_af_ops->ao_family], NULL); + + link->l_af_ops = af_lookup_and_alloc(link, family); } /** -- 2.40.0