ifvlan.c (331722) | ifvlan.c (368298) |
---|---|
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[] = | 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 $"; | 62 "$FreeBSD: stable/11/sbin/ifconfig/ifvlan.c 368298 2020-12-03 10:41:06Z hselasky $"; |
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) ¶ms; 107 } | 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) ¶ms; 107 } |
108 if (ioctl(s, SIOCIFCREATE2, ifr) < 0) 109 err(1, "SIOCIFCREATE2"); | 108 ioctl_ifcreate(s, ifr); |
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 --- | 109} 110 111static void 112vlan_cb(int s, void *arg) 113{ 114 if ((params.vlr_tag != NOTAG) ^ (params.vlr_parent[0] != '\0')) 115 errx(1, "both vlan and vlandev must be specified"); 116} --- 112 unchanged lines hidden --- |