]> granicus.if.org Git - libnl/commitdiff
link: Add missing IFLA_AF_SPEC container attribute
authorThomas Graf <tgraf@suug.ch>
Tue, 16 Nov 2010 12:54:15 +0000 (13:54 +0100)
committerThomas Graf <tgraf@suug.ch>
Tue, 16 Nov 2010 12:54:15 +0000 (13:54 +0100)
lib/route/link.c

index 55f6bbd705c76896573185cc01346e6fe6a34cc4..7cca8b40e497049e2213ce55621674fbc1d11587 100644 (file)
@@ -1054,6 +1054,7 @@ int rtnl_link_build_change_request(struct rtnl_link *old,
                                   struct nl_msg **result)
 {
        struct nl_msg *msg;
+       struct nlattr *af_spec;
        struct ifinfomsg ifi = {
                .ifi_family = old->l_family,
                .ifi_index = old->l_index,
@@ -1113,9 +1114,14 @@ int rtnl_link_build_change_request(struct rtnl_link *old,
                nla_nest_end(msg, info);
        }
 
+       if (!(af_spec = nla_nest_start(msg, IFLA_AF_SPEC)))
+               goto nla_put_failure;
+
        if (do_foreach_af(tmpl, af_fill, msg) < 0)
                goto nla_put_failure;
 
+       nla_nest_end(msg, af_spec);
+
        *result = msg;
        return 0;