IFLA_NUM_VF not set or improperly parsed
Jef Oliver
jef at eljef.me
Thu Mar 13 13:00:30 EDT 2014
On 03/13/2014 05:02 AM, Thomas Graf wrote:
> Extending rtnl_link_build_get_request() will fix
> rtnl_link_get_kernel() as you have confirmed. In order to also
> fix it for cache operations, the function link_request_update()
> needs to be extended to something like this:
>
> static int link_request_update(struct nl_cache *cache, struct nl_sock
> *sk)
> {
> struct ifinfomsg ifi;
> struct nl_msg *msg;
> int err = 0;
>
> memset(&ifi, 0, sizeof(ifi));
>
> if (!(msg = nlmsg_alloc_simple(RTM_GETLINK, NLM_F_DUMP)))
> return -NLE_NOMEM;
>
> ifi.ifi_family = cache->c_iarg1;
>
> if (nlmsg_append(msg, &ifi, sizeof(ifi), NLMSG_ALIGNTO) < 0) {
> err = -NLE_MSGSIZE;
> goto nla_put_failure;
> }
>
> NLA_PUT_U32(msg, IFLA_EXT_MASK, RTEXT_FILTER_VF);
>
> nl_send_auto(sk, msg);
>
> nla_put_failure:
> nlmsg_free(msg);
> return err;
> }
I am bringing together a patch that includes this and the previous
suggestion, as well as functionality to get information for a VF. I
appreciate the information and answers.
Jef Oliver
More information about the libnl
mailing list