netlink: drop libnl3 dependency

From libnl3, we only used the helper function to parse/generate netlink
messages and the socket functions to send/receive messages. We don't
need an external dependency to do that, it is simple enough.

Drop the libnl3 dependency, and replace all missing code by directly
copying it from libnl3 sources. At this point, I mostly tried to
import the required bits to make it working with few modifications.

Note that this increases the binary size of NetworkManager by 4736 bytes
for contrib/rpm build on x86_64. In the future, we can simplify the code
further.

A few modifications from libnl3 are:

- netlink errors NLE_* are now in the domain or regular errno.
  The distinction of having to bother with two kinds of error
  number domains was annoying.

- parts of the callback handling is copied partially and unused parts
  are dropped. Especially, the verbose/debug handlers are not used.
  In following commits, the callback handling will be significantly
  simplified.

- the complex handling of seleting ports was simplified. We now always
  let kernel choose the right port automatically.
This commit is contained in:
Thomas Haller 2018-02-15 16:54:30 +01:00
parent ffbad3d0e8
commit 3fab322a20
12 changed files with 1934 additions and 60 deletions

View File

@ -16,9 +16,6 @@ addons:
- libdbus-1-dev
- libiw-dev
- libglib2.0-dev
- libnl-3-dev
- libnl-route-3-dev
- libnl-genl-3-dev
- libmm-glib-dev
- ppp
- ppp-dev
@ -43,7 +40,6 @@ addons:
- dbus-x11
- libjansson4
- libjansson-dev
- libnl-3-dev
- libndp-dev
- automake
- dnsmasq

View File

@ -1185,7 +1185,6 @@ src_cppflags = \
-DDHCPCD_PATH=\"$(DHCPCD_PATH)\" \
\
$(LIBUDEV_CFLAGS) \
$(LIBNL_CFLAGS) \
$(LIBNDP_CFLAGS) \
$(LIBPSL_CFLAGS) \
$(LIBCURL_CFLAGS) \
@ -1643,7 +1642,6 @@ src_libNetworkManager_la_LIBADD = \
src/libsystemd-nm.la \
$(GLIB_LIBS) \
$(LIBUDEV_LIBS) \
$(LIBNL_LIBS) \
$(SYSTEMD_LOGIN_LIBS) \
$(LIBNDP_LIBS) \
$(DL_LIBS) \
@ -1684,8 +1682,7 @@ src_libNetworkManagerTest_la_LIBADD = \
src/libNetworkManager.la \
$(CODE_COVERAGE_LDFLAGS) \
$(GLIB_LIBS) \
$(LIBUDEV_LIBS) \
$(LIBNL_LIBS)
$(LIBUDEV_LIBS)
$(src_libNetworkManagerTest_la_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
@ -1726,7 +1723,6 @@ src_nm_iface_helper_LDADD = \
src/libsystemd-nm.la \
$(GLIB_LIBS) \
$(LIBUDEV_LIBS) \
$(LIBNL_LIBS) \
$(LIBNDP_LIBS) \
$(DL_LIBS)
@ -2898,8 +2894,7 @@ src_platform_tests_ldflags = \
src_platform_tests_libadd = \
src/libNetworkManagerTest.la \
$(GLIB_LIBS) \
$(LIBUDEV_LIBS) \
$(LIBNL_LIBS)
$(LIBUDEV_LIBS)
check_programs_norun += \
src/platform/tests/monitor

View File

@ -559,9 +559,6 @@ else
fi
AC_SUBST(NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT)
# libnl support for the linux platform
PKG_CHECK_MODULES(LIBNL, libnl-3.0 >= 3.2.8)
# uuid library
PKG_CHECK_MODULES(UUID, uuid)

View File

@ -30,7 +30,6 @@ yum install \
jansson-devel \
libcurl-devel \
libndp-devel \
libnl3-devel \
libpsl-devel \
libselinux-devel \
libtool \

View File

@ -32,7 +32,7 @@ BUILD_PACKAGES="qemu febootstrap mock rpmdevtools"
ARCH=i386
ROOT="${ROOT:-"fedora-20-$ARCH"}"
TREE="/var/lib/mock/$ROOT/root"
PACKAGES="kernel passwd git autoconf automake libtool intltool gtk-doc libnl3-devel
PACKAGES="kernel passwd git autoconf automake libtool intltool gtk-doc
dbus-glib-devel libuuid-devel nss-devel ppp-devel newt-devel libndp-devel
readline-devel
gobject-introspection-devel

View File

@ -10,7 +10,6 @@
%global dbus_glib_version 0.100
%global wireless_tools_version 1:28-0pre9
%global libnl3_version 3.2.7
%global ppp_version %(sed -n 's/^#define\\s*VERSION\\s*"\\([^\\s]*\\)"$/\\1/p' %{_includedir}/pppd/patchlevel.h 2>/dev/null | grep . || echo bad)
%global glib2_version %(pkg-config --modversion glib-2.0 2>/dev/null || echo bad)
@ -130,7 +129,6 @@ BuildRequires: glib2-devel >= 2.40.0
BuildRequires: gobject-introspection-devel >= 0.10.3
BuildRequires: gettext-devel
BuildRequires: pkgconfig
BuildRequires: libnl3-devel >= %{libnl3_version}
BuildRequires: automake autoconf intltool libtool
%if %{with ppp}
BuildRequires: ppp-devel >= 2.4.5

View File

@ -184,9 +184,6 @@ libudev_dep = dependency('libudev', version: '>= 175')
dbus_dep = dependency('dbus-1', version: '>= 1.1')
libndp_dep = dependency('libndp')
# libnl support for the linux platform
libnl_dep = dependency('libnl-3.0', version: '>= 3.2.8', required: false)
jansson_dep = dependency('jansson', version: '>= 2.5', required: false)
config_h.set10('WITH_JANSSON', jansson_dep.found())

View File

@ -72,7 +72,6 @@ sources = files(
)
deps = [
libnl_dep,
libnmdbus_dep,
libsystemd_dep,
libudev_dep,
@ -170,7 +169,6 @@ sources = files(
deps = [
dl_dep,
libndp_dep,
libnl_dep,
# FIXME: Some files use introspection/dbus* headers, so
# this dependency might be needed
#libnmdbus_dep,
@ -252,7 +250,6 @@ network_manager = executable(
deps = [
dl_dep,
libndp_dep,
libnl_dep,
libudev_dep,
nm_core_dep
]
@ -279,7 +276,6 @@ if enable_tests
)
deps = [
libnl_dep,
libudev_dep,
nm_core_dep
]

View File

@ -21,6 +21,7 @@
#include "nm-linux-platform.h"
#include <poll.h>
#include <endian.h>
#include <errno.h>
#include <unistd.h>
@ -3951,7 +3952,7 @@ _nlh_seq_next_get (NMLinuxPlatformPrivate *priv)
* @response_type:
* @response_out_data:
*
* Returns: 0 on success or a negative errno. Beware, it's an errno, not nlerror.
* Returns: 0 on success or a negative errno.
*/
static int
_nl_send_nlmsghdr (NMPlatform *platform,
@ -6514,6 +6515,9 @@ continue_reading:
n = -_NLE_MSG_TRUNC;
break;
}
case -ENOBUFS:
n = -_NLE_NM_NOBUFS;
break;
case -NLE_NOMEM:
if (errno == ENOBUFS) {
/* we are very much interested in a overrun of the receive buffer.

File diff suppressed because it is too large Load Diff

View File

@ -21,44 +21,370 @@
#ifndef __NM_NETLINK_H__
#define __NM_NETLINK_H__
#include <netlink/msg.h>
#include <netlink/attr.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <linux/genetlink.h>
/*****************************************************************************/
#define NLE_AGAIN EAGAIN
#define NLE_NOMEM ENOMEM
#define NLE_BAD_SOCK EBADF
#define NLE_INVAL EINVAL
#define NLE_RANGE ERANGE
#define NLE_OBJ_NOTFOUND ENOENT
#define NLE_NOADDR EADDRNOTAVAIL
#define NLE_MSG_OVERFLOW EOVERFLOW
#define NLE_AF_NOSUPPORT EAFNOSUPPORT
#define NLE_SEQ_MISMATCH 10016
#define NLE_MSG_TRUNC 10018
#define NLE_MSG_TOOSHORT 10021
#define NLE_DUMP_INTR 10033
#define NLE_ATTRSIZE 10034
#define NLE_BUG 19000
static inline int
nl_errno (int error)
{
/* the error codes from our netlink implementation are plain errno.
* However, often we encode them as negative values.
*
* A negative errno is the same as it's positive counterpart.
*
* This function normalizes the error code and always returns a
* non-negative value. */
return error >= 0
? error
: ((error == G_MININT) ? NLE_BUG : -errno);
}
static inline const char *
nl_geterror (int error)
{
return g_strerror (nl_errno (error));
}
/*****************************************************************************/
/* Basic attribute data types */
enum {
NLA_UNSPEC, /* Unspecified type, binary data chunk */
NLA_U8, /* 8 bit integer */
NLA_U16, /* 16 bit integer */
NLA_U32, /* 32 bit integer */
NLA_U64, /* 64 bit integer */
NLA_STRING, /* NUL terminated character string */
NLA_FLAG, /* Flag */
NLA_MSECS, /* Micro seconds (64bit) */
NLA_NESTED, /* Nested attributes */
NLA_NESTED_COMPAT,
NLA_NUL_STRING,
NLA_BINARY,
NLA_S8,
NLA_S16,
NLA_S32,
NLA_S64,
__NLA_TYPE_MAX,
};
#define NLA_TYPE_MAX (__NLA_TYPE_MAX - 1)
struct nl_msg;
/*****************************************************************************/
const char *nl_nlmsgtype2str (int type, char *buf, size_t size);
const char *nl_nlmsg_flags2str (int flags, char *buf, size_t len);
const char *nl_nlmsghdr_to_str (const struct nlmsghdr *hdr, char *buf, gsize len);
/*****************************************************************************
* libnl3 compat code
*****************************************************************************/
/*****************************************************************************/
struct nla_policy {
/* Type of attribute or NLA_UNSPEC */
uint16_t type;
/* Minimal length of payload required */
uint16_t minlen;
/* Maximal length of payload allowed */
uint16_t maxlen;
};
/*****************************************************************************/
static inline int
_nl_nla_parse (struct nlattr *tb[], int maxtype, struct nlattr *head, int len,
const struct nla_policy *policy)
nla_attr_size(int payload)
{
return nla_parse (tb, maxtype, head, len, (struct nla_policy *) policy);
nm_assert (payload >= 0);
return NLA_HDRLEN + payload;
}
#define nla_parse(...) _nl_nla_parse(__VA_ARGS__)
static inline int
_nl_nlmsg_parse (struct nlmsghdr *nlh, int hdrlen, struct nlattr *tb[],
int maxtype, const struct nla_policy *policy)
nla_total_size (int payload)
{
return nlmsg_parse (nlh, hdrlen, tb, maxtype, (struct nla_policy *) policy);
return NLA_ALIGN (nla_attr_size (payload));
}
#define nlmsg_parse(...) _nl_nlmsg_parse(__VA_ARGS__)
static inline int
_nl_nla_parse_nested (struct nlattr *tb[], int maxtype, struct nlattr *nla,
const struct nla_policy *policy)
nla_padlen (int payload)
{
return nla_parse_nested (tb, maxtype, nla, (struct nla_policy *) policy);
return nla_total_size(payload) - nla_attr_size(payload);
}
#define nla_parse_nested(...) _nl_nla_parse_nested(__VA_ARGS__)
/*****************************************************************************
* Reimplementations/copied from libnl3/genl
*****************************************************************************/
struct nlattr *nla_reserve (struct nl_msg *msg, int attrtype, int attrlen);
static inline int
nla_len (const struct nlattr *nla)
{
return nla->nla_len - NLA_HDRLEN;
}
static inline int
nla_type (const struct nlattr *nla)
{
return nla->nla_type & NLA_TYPE_MASK;
}
static inline void *
nla_data (const struct nlattr *nla)
{
nm_assert (nla);
return (char *) nla + NLA_HDRLEN;
}
static inline uint8_t
nla_get_u8 (const struct nlattr *nla)
{
return *(const uint8_t *) nla_data (nla);
}
static inline uint16_t
nla_get_u16 (const struct nlattr *nla)
{
return *(const uint16_t *) nla_data (nla);
}
static inline uint32_t
nla_get_u32(const struct nlattr *nla)
{
return *(const uint32_t *) nla_data (nla);
}
uint64_t nla_get_u64 (const struct nlattr *nla);
static inline char *
nla_get_string (const struct nlattr *nla)
{
return (char *) nla_data (nla);
}
size_t nla_strlcpy (char *dst, const struct nlattr *nla, size_t dstsize);
int nla_memcpy (void *dest, const struct nlattr *src, int count);
int nla_put (struct nl_msg *msg, int attrtype, int datalen, const void *data);
static inline int
nla_put_string (struct nl_msg *msg, int attrtype, const char *str)
{
return nla_put(msg, attrtype, strlen(str) + 1, str);
}
#define NLA_PUT(msg, attrtype, attrlen, data) \
do { \
if (nla_put(msg, attrtype, attrlen, data) < 0) \
goto nla_put_failure; \
} while(0)
#define NLA_PUT_TYPE(msg, type, attrtype, value) \
do { \
type __tmp = value; \
NLA_PUT(msg, attrtype, sizeof(type), &__tmp); \
} while(0)
#define NLA_PUT_U8(msg, attrtype, value) \
NLA_PUT_TYPE(msg, uint8_t, attrtype, value)
#define NLA_PUT_U16(msg, attrtype, value) \
NLA_PUT_TYPE(msg, uint16_t, attrtype, value)
#define NLA_PUT_U32(msg, attrtype, value) \
NLA_PUT_TYPE(msg, uint32_t, attrtype, value)
#define NLA_PUT_U64(msg, attrtype, value) \
NLA_PUT_TYPE(msg, uint64_t, attrtype, value)
#define NLA_PUT_STRING(msg, attrtype, value) \
NLA_PUT(msg, attrtype, (int) strlen(value) + 1, value)
struct nlattr *nla_find (const struct nlattr *head, int len, int attrtype);
static inline int
nla_ok (const struct nlattr *nla, int remaining)
{
return remaining >= sizeof(*nla) &&
nla->nla_len >= sizeof(*nla) &&
nla->nla_len <= remaining;
}
static inline struct nlattr *
nla_next(const struct nlattr *nla, int *remaining)
{
int totlen = NLA_ALIGN(nla->nla_len);
*remaining -= totlen;
return (struct nlattr *) ((char *) nla + totlen);
}
#define nla_for_each_attr(pos, head, len, rem) \
for (pos = head, rem = len; \
nla_ok(pos, rem); \
pos = nla_next(pos, &(rem)))
#define nla_for_each_nested(pos, nla, rem) \
for (pos = (struct nlattr *) nla_data(nla), rem = nla_len(nla); \
nla_ok(pos, rem); \
pos = nla_next(pos, &(rem)))
void nla_nest_cancel (struct nl_msg *msg, const struct nlattr *attr);
struct nlattr *nla_nest_start (struct nl_msg *msg, int attrtype);
int nla_nest_end (struct nl_msg *msg, struct nlattr *start);
int nla_parse (struct nlattr *tb[], int maxtype, struct nlattr *head, int len,
const struct nla_policy *policy);
static inline int
nla_parse_nested (struct nlattr *tb[], int maxtype, struct nlattr *nla,
const struct nla_policy *policy)
{
return nla_parse (tb, maxtype, nla_data(nla), nla_len(nla), policy);
}
/*****************************************************************************/
struct nl_msg *nlmsg_alloc (void);
struct nl_msg *nlmsg_alloc_size (size_t max);
struct nl_msg *nlmsg_inherit (struct nlmsghdr *hdr);
struct nl_msg *nlmsg_convert (struct nlmsghdr *hdr);
struct nl_msg *nlmsg_alloc_simple (int nlmsgtype, int flags);
void *nlmsg_reserve (struct nl_msg *n, size_t len, int pad);
int nlmsg_append (struct nl_msg *n, void *data, size_t len, int pad);
void nlmsg_free (struct nl_msg *msg);
static inline int
nlmsg_size (int payload)
{
nm_assert (payload >= 0 && payload < G_MAXINT - NLMSG_HDRLEN - 4);
return NLMSG_HDRLEN + payload;
}
static inline int
nlmsg_total_size (int payload)
{
return NLMSG_ALIGN (nlmsg_size (payload));
}
static inline int
nlmsg_ok (const struct nlmsghdr *nlh, int remaining)
{
return (remaining >= (int)sizeof(struct nlmsghdr) &&
nlh->nlmsg_len >= sizeof(struct nlmsghdr) &&
nlh->nlmsg_len <= remaining);
}
static inline struct nlmsghdr *
nlmsg_next (struct nlmsghdr *nlh, int *remaining)
{
int totlen = NLMSG_ALIGN(nlh->nlmsg_len);
*remaining -= totlen;
return (struct nlmsghdr *) ((unsigned char *) nlh + totlen);
}
int nlmsg_get_proto (struct nl_msg *msg);
void nlmsg_set_proto (struct nl_msg *msg, int protocol);
void nlmsg_set_src (struct nl_msg *msg, struct sockaddr_nl *addr);
struct ucred *nlmsg_get_creds (struct nl_msg *msg);
void nlmsg_set_creds (struct nl_msg *msg, struct ucred *creds);
static inline void
_nm_auto_nl_msg_cleanup (struct nl_msg **ptr)
{
nlmsg_free (*ptr);
}
#define nm_auto_nlmsg nm_auto(_nm_auto_nl_msg_cleanup)
static inline void *
nlmsg_data (const struct nlmsghdr *nlh)
{
return (unsigned char *) nlh + NLMSG_HDRLEN;
}
static inline void *
nlmsg_tail (const struct nlmsghdr *nlh)
{
return (unsigned char *) nlh + NLMSG_ALIGN(nlh->nlmsg_len);
}
struct nlmsghdr *nlmsg_hdr (struct nl_msg *n);
static inline int
nlmsg_valid_hdr(const struct nlmsghdr *nlh, int hdrlen)
{
if (nlh->nlmsg_len < nlmsg_size (hdrlen))
return 0;
return 1;
}
static inline int
nlmsg_datalen (const struct nlmsghdr *nlh)
{
return nlh->nlmsg_len - NLMSG_HDRLEN;
}
static inline int
nlmsg_attrlen (const struct nlmsghdr *nlh, int hdrlen)
{
return NM_MAX ((int) (nlmsg_datalen (nlh) - NLMSG_ALIGN (hdrlen)), 0);
}
static inline struct nlattr *
nlmsg_attrdata (const struct nlmsghdr *nlh, int hdrlen)
{
unsigned char *data = nlmsg_data(nlh);
return (struct nlattr *) (data + NLMSG_ALIGN(hdrlen));
}
static inline struct nlattr *
nlmsg_find_attr (struct nlmsghdr *nlh, int hdrlen, int attrtype)
{
return nla_find (nlmsg_attrdata (nlh, hdrlen),
nlmsg_attrlen (nlh, hdrlen),
attrtype);
}
int nlmsg_parse (struct nlmsghdr *nlh, int hdrlen, struct nlattr *tb[],
int maxtype, const struct nla_policy *policy);
struct nlmsghdr *nlmsg_put (struct nl_msg *n, uint32_t pid, uint32_t seq,
int type, int payload, int flags);
/*****************************************************************************/
void *genlmsg_put (struct nl_msg *msg, uint32_t port, uint32_t seq, int family,
int hdrlen, int flags, uint8_t cmd, uint8_t version);
@ -73,16 +399,132 @@ int genlmsg_valid_hdr (struct nlmsghdr *nlh, int hdrlen);
int genlmsg_parse (struct nlmsghdr *nlh, int hdrlen, struct nlattr *tb[],
int maxtype, const struct nla_policy *policy);
/*****************************************************************************
* helpers
*****************************************************************************/
/*****************************************************************************/
static inline void
_nm_auto_nl_msg_cleanup (struct nl_msg **ptr)
{
nlmsg_free (*ptr);
}
#define nm_auto_nlmsg nm_auto(_nm_auto_nl_msg_cleanup)
#define NL_AUTO_PORT 0
#define NL_AUTO_SEQ 0
struct nl_sock;
struct nl_sock *nl_socket_alloc (void);
void nl_socket_free (struct nl_sock *sk);
int nl_socket_get_fd (const struct nl_sock *sk);
struct sockaddr_nl *nlmsg_get_dst (struct nl_msg *msg);
size_t nl_socket_get_msg_buf_size (struct nl_sock *sk);
int nl_socket_set_msg_buf_size (struct nl_sock *sk, size_t bufsize);
int nl_socket_set_buffer_size (struct nl_sock *sk, int rxbuf, int txbuf);
int nl_socket_set_passcred (struct nl_sock *sk, int state);
int nl_socket_set_nonblocking (const struct nl_sock *sk);
void nl_socket_disable_msg_peek (struct nl_sock *sk);
uint32_t nl_socket_get_local_port (const struct nl_sock *sk);
int nl_socket_add_memberships (struct nl_sock *sk, int group, ...);
int nl_connect (struct nl_sock *sk, int protocol);
int nl_recv (struct nl_sock *sk, struct sockaddr_nl *nla,
unsigned char **buf, struct ucred **creds);
int nl_send (struct nl_sock *sk, struct nl_msg *msg);
int nl_send_auto (struct nl_sock *sk, struct nl_msg *msg);
/*****************************************************************************/
struct nl_cb;
enum nl_cb_action {
/* Proceed with wathever would come next */
NL_OK,
/* Skip this message */
NL_SKIP,
/* Stop parsing altogether and discard remaining messages */
NL_STOP,
};
enum nl_cb_kind {
/* Default handlers (quiet) */
NL_CB_DEFAULT,
/* Verbose default handlers (error messages printed) */
NL_CB_VERBOSE,
/* Debug handlers for debugging */
NL_CB_DEBUG,
/* Customized handler specified by the user */
NL_CB_CUSTOM,
__NL_CB_KIND_MAX,
};
#define NL_CB_KIND_MAX (__NL_CB_KIND_MAX - 1)
enum nl_cb_type {
/* Message is valid */
NL_CB_VALID,
/* Last message in a series of multi part messages received */
NL_CB_FINISH,
/* Report received that data was lost */
NL_CB_OVERRUN,
/* Message wants to be skipped */
NL_CB_SKIPPED,
/* Message is an acknowledge */
NL_CB_ACK,
/* Called for every message received */
NL_CB_MSG_IN,
/* Called for every message sent out except for nl_sendto() */
NL_CB_MSG_OUT,
/* Message is malformed and invalid */
NL_CB_INVALID,
/* Called instead of internal sequence number checking */
NL_CB_SEQ_CHECK,
/* Sending of an acknowledge message has been requested */
NL_CB_SEND_ACK,
/* Flag NLM_F_DUMP_INTR is set in message */
NL_CB_DUMP_INTR,
__NL_CB_TYPE_MAX,
};
#define NL_CB_TYPE_MAX (__NL_CB_TYPE_MAX - 1)
typedef int (*nl_recvmsg_msg_cb_t) (struct nl_msg *msg, void *arg);
typedef int (*nl_recvmsg_err_cb_t) (struct sockaddr_nl *nla,
struct nlmsgerr *nlerr, void *arg);
struct nl_cb *nl_cb_alloc (enum nl_cb_kind kind);
struct nl_cb *nl_cb_clone (struct nl_cb *orig);
struct nl_cb *nl_cb_get (struct nl_cb *cb);
void nl_cb_put (struct nl_cb *cb);
int nl_cb_set (struct nl_cb *cb, enum nl_cb_type type, enum nl_cb_kind kind,
nl_recvmsg_msg_cb_t func, void *arg);
int nl_cb_err (struct nl_cb *cb, enum nl_cb_kind kind,
nl_recvmsg_err_cb_t func, void *arg);
struct nl_cb *nl_socket_get_cb (const struct nl_sock *sk);
int nl_sendmsg (struct nl_sock *sk, struct nl_msg *msg, struct msghdr *hdr);
int nl_send_iovec (struct nl_sock *sk, struct nl_msg *msg, struct iovec *iov, unsigned iovlen);
void nl_complete_msg (struct nl_sock *sk, struct nl_msg *msg);
int nl_recvmsgs_report (struct nl_sock *sk, struct nl_cb *cb);
int nl_recvmsgs (struct nl_sock *sk, struct nl_cb *cb);
int nl_wait_for_ack (struct nl_sock *sk);
/*****************************************************************************/

View File

@ -108,7 +108,7 @@ genl_ctrl_resolve (struct nl_sock *sk, const char *name)
if (rc < 0)
goto out_msg_free;
rc = nl_send_auto_complete (sk, msg);
rc = nl_send_auto (sk, msg);
if (rc < 0)
goto out_msg_free;
@ -219,7 +219,7 @@ _nl80211_send_and_recv (struct nl_sock *nl_sock,
goto out;
}
err = nl_send_auto_complete (nl_sock, msg);
err = nl_send_auto (nl_sock, msg);
if (err < 0)
goto out;