ifclone.c (189096) | ifclone.c (189864) |
---|---|
1/* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#ifndef lint 31static const char rcsid[] = | 1/* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#ifndef lint 31static const char rcsid[] = |
32 "$FreeBSD: head/sbin/ifconfig/ifclone.c 189096 2009-02-27 00:31:34Z rpaulo $"; | 32 "$FreeBSD: head/sbin/ifconfig/ifclone.c 189864 2009-03-15 22:33:18Z jamie $"; |
33#endif /* not lint */ 34 35#include <sys/queue.h> 36#include <sys/types.h> 37#include <sys/ioctl.h> 38#include <sys/socket.h> 39#include <net/if.h> 40 --- 8 unchanged lines hidden (view full) --- 49static void 50list_cloners(void) 51{ 52 struct if_clonereq ifcr; 53 char *cp, *buf; 54 int idx; 55 int s; 56 | 33#endif /* not lint */ 34 35#include <sys/queue.h> 36#include <sys/types.h> 37#include <sys/ioctl.h> 38#include <sys/socket.h> 39#include <net/if.h> 40 --- 8 unchanged lines hidden (view full) --- 49static void 50list_cloners(void) 51{ 52 struct if_clonereq ifcr; 53 char *cp, *buf; 54 int idx; 55 int s; 56 |
57 s = socket(AF_INET, SOCK_DGRAM, 0); | 57 s = socket(AF_LOCAL, SOCK_DGRAM, 0); |
58 if (s == -1) | 58 if (s == -1) |
59 err(1, "socket(AF_INET,SOCK_DGRAM)"); | 59 err(1, "socket(AF_LOCAL,SOCK_DGRAM)"); |
60 61 memset(&ifcr, 0, sizeof(ifcr)); 62 63 if (ioctl(s, SIOCIFGCLONERS, &ifcr) < 0) 64 err(1, "SIOCIFGCLONERS for count"); 65 66 buf = malloc(ifcr.ifcr_total * IFNAMSIZ); 67 if (buf == NULL) --- 127 unchanged lines hidden --- | 60 61 memset(&ifcr, 0, sizeof(ifcr)); 62 63 if (ioctl(s, SIOCIFGCLONERS, &ifcr) < 0) 64 err(1, "SIOCIFGCLONERS for count"); 65 66 buf = malloc(ifcr.ifcr_total * IFNAMSIZ); 67 if (buf == NULL) --- 127 unchanged lines hidden --- |