aboutsummaryrefslogtreecommitdiff
path: root/sbin/ifconfig/ifvxlan.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/ifconfig/ifvxlan.c')
-rw-r--r--sbin/ifconfig/ifvxlan.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sbin/ifconfig/ifvxlan.c b/sbin/ifconfig/ifvxlan.c
index 55e2b79d3285..4f54bee88b41 100644
--- a/sbin/ifconfig/ifvxlan.c
+++ b/sbin/ifconfig/ifvxlan.c
@@ -75,16 +75,14 @@ get_val(const char *cp, u_long *valp)
static int
do_cmd(if_ctx *ctx, u_long op, void *arg, size_t argsize, int set)
{
- struct ifdrv ifd;
+ struct ifdrv ifd = {};
- bzero(&ifd, sizeof(ifd));
-
- strlcpy(ifd.ifd_name, ifr.ifr_name, sizeof(ifd.ifd_name));
+ strlcpy(ifd.ifd_name, ctx->ifname, sizeof(ifd.ifd_name));
ifd.ifd_cmd = op;
ifd.ifd_len = argsize;
ifd.ifd_data = arg;
- return (ioctl(ctx->io_s, set ? SIOCSDRVSPEC : SIOCGDRVSPEC, &ifd));
+ return (ioctl_ctx(ctx, set ? SIOCSDRVSPEC : SIOCGDRVSPEC, &ifd));
}
static int