X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=lib%2Fnetlink-socket.c;h=4bd6d366cb1f89e71b00c470e44d68447435942b;hb=1ce3fa06fc82210e2ed70b36e2842fe39d91b995;hp=99bd4cc0525780d0d8c5784d38318ddf0cd4a16c;hpb=97be153858b4cd175cbe7862b8e1624bf22ab98a;p=cascardo%2Fovs.git diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c index 99bd4cc05..4bd6d366c 100644 --- a/lib/netlink-socket.c +++ b/lib/netlink-socket.c @@ -40,7 +40,6 @@ VLOG_DEFINE_THIS_MODULE(netlink_socket); COVERAGE_DEFINE(netlink_overflow); COVERAGE_DEFINE(netlink_received); COVERAGE_DEFINE(netlink_recv_jumbo); -COVERAGE_DEFINE(netlink_send); COVERAGE_DEFINE(netlink_sent); /* Linux header file confusion causes this to be undefined. */ @@ -338,7 +337,7 @@ nl_sock_recv__(struct nl_sock *sock, struct ofpbuf *buf, bool wait) } if (msg.msg_flags & MSG_TRUNC) { - VLOG_ERR_RL(&rl, "truncated message (longer than %zu bytes)", + VLOG_ERR_RL(&rl, "truncated message (longer than %"PRIuSIZE" bytes)", sizeof tail); return E2BIG; } @@ -347,7 +346,7 @@ nl_sock_recv__(struct nl_sock *sock, struct ofpbuf *buf, bool wait) if (retval < sizeof *nlmsghdr || nlmsghdr->nlmsg_len < sizeof *nlmsghdr || nlmsghdr->nlmsg_len > retval) { - VLOG_ERR_RL(&rl, "received invalid nlmsg (%zd bytes < %zu)", + VLOG_ERR_RL(&rl, "received invalid nlmsg (%"PRIuSIZE"d bytes < %"PRIuSIZE")", retval, sizeof *nlmsghdr); return EPROTO; } @@ -925,12 +924,10 @@ do_lookup_genl_family(const char *name, struct nlattr **attrs, /* Finds the multicast group called 'group_name' in genl family 'family_name'. * When successful, writes its result to 'multicast_group' and returns 0. * Otherwise, clears 'multicast_group' and returns a positive error code. - * - * Some kernels do not support looking up a multicast group with this function. - * In this case, 'multicast_group' will be populated with 'fallback'. */ + */ int nl_lookup_genl_mcgroup(const char *family_name, const char *group_name, - unsigned int *multicast_group, unsigned int fallback) + unsigned int *multicast_group) { struct nlattr *family_attrs[ARRAY_SIZE(family_policy)]; const struct nlattr *mc; @@ -945,10 +942,7 @@ nl_lookup_genl_mcgroup(const char *family_name, const char *group_name, } if (!family_attrs[CTRL_ATTR_MCAST_GROUPS]) { - *multicast_group = fallback; - VLOG_WARN("%s-%s: has no multicast group, using fallback %d", - family_name, group_name, *multicast_group); - error = 0; + error = EPROTO; goto exit; } @@ -1012,7 +1006,7 @@ struct nl_pool { int n; }; -static struct ovs_mutex pool_mutex = OVS_ADAPTIVE_MUTEX_INITIALIZER; +static struct ovs_mutex pool_mutex = OVS_MUTEX_INITIALIZER; static struct nl_pool pools[MAX_LINKS] OVS_GUARDED_BY(pool_mutex); static int