X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fvlandev.c;h=6531bf0cfafea6aabb288df5cd3c93dcbf30ade6;hb=0e19706066f34523854cbce50c05c367e700c451;hp=5f58f1055c5d5eb9bd1d6f518d64b5e0ae2b75eb;hpb=10a89ef04df5669c5cdd02f786150a7ab8454e01;p=sliver-openvswitch.git diff --git a/lib/vlandev.c b/lib/vlandev.c index 5f58f1055..6531bf0cf 100644 --- a/lib/vlandev.c +++ b/lib/vlandev.c @@ -26,6 +26,7 @@ #include "dummy.h" #include "hash.h" #include "shash.h" +#include "socket-util.h" #include "vlog.h" VLOG_DEFINE_THIS_MODULE(vlandev); @@ -237,17 +238,11 @@ do_vlan_ioctl(const char *netdev_name, struct vlan_ioctl_args *via, { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); int error; - int sock; via->cmd = cmd; ovs_strlcpy(via->device1, netdev_name, sizeof via->device1); - sock = netdev_linux_get_af_inet_sock(); - if (sock < 0) { - return -sock; - } - - error = ioctl(sock, SIOCSIFVLAN, via) < 0 ? errno : 0; + error = af_inet_ioctl(SIOCSIFVLAN, via); if (error) { VLOG_WARN_RL(&rl, "%s: VLAN ioctl %s failed (%s)", netdev_name, cmd_name, ovs_strerror(error)); @@ -308,7 +303,7 @@ vlandev_stub_del(const char *vlan_dev OVS_UNUSED) return EOPNOTSUPP; } -static const struct vlandev_class vlandev_stub_class = { +static const struct vlandev_class OVS_UNUSED vlandev_stub_class = { NULL, /* vd_refresh */ vlandev_stub_add, vlandev_stub_del