diff options
author | Thomas Haller <thaller@redhat.com> | 2016-05-29 14:26:59 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-06-24 17:25:55 (GMT) |
commit | 8dce6de7011a2773f97e8eca109ea0201435210f (patch) | |
tree | 03b9b9961554795c2117eb97aca095451f7089b4 /lib/route/link.c | |
parent | 90c6ebec9bd7adbe6dc7aca114b4304c1ba02f6d (diff) | |
download | libnl-8dce6de7011a2773f97e8eca109ea0201435210f.zip libnl-8dce6de7011a2773f97e8eca109ea0201435210f.tar.gz libnl-8dce6de7011a2773f97e8eca109ea0201435210f.tar.bz2 |
link: allow overwriting IFLA_EXT_MASK flag in ao_get_af() function
Instead of setting it twice, once during link_request_update() and
later in bridge_get_af(), pass ext_filter_mask to ao_get_af().
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'lib/route/link.c')
-rw-r--r-- | lib/route/link.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/route/link.c b/lib/route/link.c index 48eb6d3..1b4f94c 100644 --- a/lib/route/link.c +++ b/lib/route/link.c @@ -677,7 +677,7 @@ static int link_request_update(struct nl_cache *cache, struct nl_sock *sk) struct rtnl_link_af_ops *ops; struct nl_msg *msg; int err; - __u32 vf_mask = RTEXT_FILTER_VF; + __u32 ext_filter_mask = RTEXT_FILTER_VF; msg = nlmsg_alloc_simple(RTM_GETLINK, NLM_F_DUMP); if (!msg) @@ -687,13 +687,15 @@ static int link_request_update(struct nl_cache *cache, struct nl_sock *sk) if (nlmsg_append(msg, &hdr, sizeof(hdr), NLMSG_ALIGNTO) < 0) goto nla_put_failure; - err = nla_put(msg, IFLA_EXT_MASK, sizeof(vf_mask), &vf_mask); - if (err) - goto nla_put_failure; - ops = rtnl_link_af_ops_lookup(family); if (ops && ops->ao_get_af) { - err = ops->ao_get_af(msg); + err = ops->ao_get_af(msg, &ext_filter_mask); + if (err) + goto nla_put_failure; + } + + if (ext_filter_mask) { + err = nla_put(msg, IFLA_EXT_MASK, sizeof(ext_filter_mask), &ext_filter_mask); if (err) goto nla_put_failure; } |