Deleted Added
sdiff udiff text old ( 331722 ) new ( 368298 )
full compact
1/*
2 * Copyright (c) 1999 Bill Paul <wpaul@ctr.columbia.edu>
3 * Copyright (c) 2012 ADARA Networks, Inc.
4 * All rights reserved.
5 *
6 * Portions of this software were developed by Robert N. M. Watson under
7 * contract to ADARA Networks, Inc.
8 *

--- 45 unchanged lines hidden (view full) ---

54#include <unistd.h>
55#include <err.h>
56#include <errno.h>
57
58#include "ifconfig.h"
59
60#ifndef lint
61static const char rcsid[] =
62 "$FreeBSD: stable/11/sbin/ifconfig/ifvlan.c 331722 2018-03-29 02:50:57Z eadler $";
63#endif
64
65#define NOTAG ((u_short) -1)
66
67static struct vlanreq params = {
68 .vlr_tag = NOTAG,
69};
70

--- 29 unchanged lines hidden (view full) ---

100 * One or both parameters were specified, make sure both.
101 */
102 if (params.vlr_tag == NOTAG)
103 errx(1, "must specify a tag for vlan create");
104 if (params.vlr_parent[0] == '\0')
105 errx(1, "must specify a parent device for vlan create");
106 ifr->ifr_data = (caddr_t) &params;
107 }
108 if (ioctl(s, SIOCIFCREATE2, ifr) < 0)
109 err(1, "SIOCIFCREATE2");
110}
111
112static void
113vlan_cb(int s, void *arg)
114{
115 if ((params.vlr_tag != NOTAG) ^ (params.vlr_parent[0] != '\0'))
116 errx(1, "both vlan and vlandev must be specified");
117}

--- 112 unchanged lines hidden ---