diff options
author | Thomas Graf <tgraf@suug.ch> | 2013-02-05 12:52:22 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2013-02-05 12:52:22 (GMT) |
commit | 8026fe2e3a9089eff3f5a06ee6e3cc78d96334ed (patch) | |
tree | 13c15b887fa9bc0eeb22d071b7237c646511f797 /lib/route/link.c | |
parent | 4a793a4235585d88a9e5f6e413bf59cf1abdd3db (diff) | |
download | libnl-8026fe2e3a9089eff3f5a06ee6e3cc78d96334ed.zip libnl-8026fe2e3a9089eff3f5a06ee6e3cc78d96334ed.tar.gz libnl-8026fe2e3a9089eff3f5a06ee6e3cc78d96334ed.tar.bz2 |
link: Free and realloc af specific data upon rtnl_link_set_family()
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Diffstat (limited to 'lib/route/link.c')
-rw-r--r-- | lib/route/link.c | 6 |
1 files changed, 6 insertions, 0 deletions
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); } /** |