Deleted Added
full compact
ifgroup.c (166804) ifgroup.c (189864)
1/*-
2 * Copyright (c) 2006 Max Laier. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
24 */
25
26#ifndef lint
27static const char rcsid[] =
1/*-
2 * Copyright (c) 2006 Max Laier. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
24 */
25
26#ifndef lint
27static const char rcsid[] =
28 "$FreeBSD: head/sbin/ifconfig/ifgroup.c 166804 2007-02-17 18:22:20Z sam $";
28 "$FreeBSD: head/sbin/ifconfig/ifgroup.c 189864 2009-03-15 22:33:18Z jamie $";
29#endif /* not lint */
30
31#include <sys/types.h>
32#include <sys/ioctl.h>
33#include <sys/socket.h>
34#include <net/if.h>
35
36#include <ctype.h>

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

126static void
127printgroup(const char *groupname)
128{
129 struct ifgroupreq ifgr;
130 struct ifg_req *ifg;
131 int len, cnt = 0;
132 int s;
133
29#endif /* not lint */
30
31#include <sys/types.h>
32#include <sys/ioctl.h>
33#include <sys/socket.h>
34#include <net/if.h>
35
36#include <ctype.h>

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

126static void
127printgroup(const char *groupname)
128{
129 struct ifgroupreq ifgr;
130 struct ifg_req *ifg;
131 int len, cnt = 0;
132 int s;
133
134 s = socket(AF_INET, SOCK_DGRAM, 0);
134 s = socket(AF_LOCAL, SOCK_DGRAM, 0);
135 if (s == -1)
135 if (s == -1)
136 err(1, "socket(AF_INET,SOCK_DGRAM)");
136 err(1, "socket(AF_LOCAL,SOCK_DGRAM)");
137 bzero(&ifgr, sizeof(ifgr));
138 strlcpy(ifgr.ifgr_name, groupname, sizeof(ifgr.ifgr_name));
139 if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1) {
140 if (errno == EINVAL || errno == ENOTTY ||
141 errno == ENOENT)
142 exit(0);
143 else
144 err(1, "SIOCGIFGMEMB");

--- 42 unchanged lines hidden ---
137 bzero(&ifgr, sizeof(ifgr));
138 strlcpy(ifgr.ifgr_name, groupname, sizeof(ifgr.ifgr_name));
139 if (ioctl(s, SIOCGIFGMEMB, (caddr_t)&ifgr) == -1) {
140 if (errno == EINVAL || errno == ENOTTY ||
141 errno == ENOENT)
142 exit(0);
143 else
144 err(1, "SIOCGIFGMEMB");

--- 42 unchanged lines hidden ---