#include "dummy.h"
#include "hash.h"
#include "shash.h"
+#include "socket-util.h"
#include "vlog.h"
VLOG_DEFINE_THIS_MODULE(vlandev);
char vlan_dev[16], real_dev[16];
int vid;
- if (sscanf(line, "%15[^ |] | %d | %15s",
- vlan_dev, &vid, real_dev) == 3) {
+ if (ovs_scan(line, "%15[^ |] | %d | %15s", vlan_dev, &vid, real_dev)) {
vlandev_add__(vlan_dev, real_dev, vid);
}
}
{
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));
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