Code is looking up the nlsock to generate the batch messages
and then looking it up again to get the response. Let's
just look it up one time.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
return 0;
}
-static int nl_batch_read_resp(struct nl_batch *bth)
+static int nl_batch_read_resp(struct nl_batch *bth, struct nlsock *nl)
{
struct nlmsghdr *h;
struct sockaddr_nl snl;
struct msghdr msg = {};
int status, seq;
- struct nlsock *nl;
struct zebra_dplane_ctx *ctx;
bool ignore_msg;
- nl = kernel_netlink_nlsock_lookup(bth->zns->sock);
-
msg.msg_name = (void *)&snl;
msg.msg_namelen = sizeof(snl);
err = true;
if (!err) {
- if (nl_batch_read_resp(bth) == -1)
+ if (nl_batch_read_resp(bth, nl) == -1)
err = true;
}
}