Deleted Added
full compact
ifconfig.c (216089) ifconfig.c (216267)
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

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

33 The Regents of the University of California. All rights reserved.\n";
34#endif /* not lint */
35
36#ifndef lint
37#if 0
38static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
39#endif
40static 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

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

33 The Regents of the University of California. All rights reserved.\n";
34#endif /* not lint */
35
36#ifndef lint
37#if 0
38static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
39#endif
40static const char rcsid[] =
41 "$FreeBSD: head/sbin/ifconfig/ifconfig.c 216089 2010-12-01 03:24:38Z weongyo $";
41 "$FreeBSD: head/sbin/ifconfig/ifconfig.c 216267 2010-12-07 20:23:47Z weongyo $";
42#endif /* not lint */
43
44#include <sys/param.h>
45#include <sys/ioctl.h>
46#include <sys/socket.h>
47#include <sys/time.h>
48#include <sys/module.h>
49#include <sys/linker.h>

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

290 }
291
292 if (ifname != NULL && strcmp(ifname, ifa->ifa_name) != 0)
293 continue;
294 if (ifa->ifa_addr->sa_family == AF_LINK)
295 sdl = (const struct sockaddr_dl *) ifa->ifa_addr;
296 else
297 sdl = NULL;
42#endif /* not lint */
43
44#include <sys/param.h>
45#include <sys/ioctl.h>
46#include <sys/socket.h>
47#include <sys/time.h>
48#include <sys/module.h>
49#include <sys/linker.h>

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

290 }
291
292 if (ifname != NULL && strcmp(ifname, ifa->ifa_name) != 0)
293 continue;
294 if (ifa->ifa_addr->sa_family == AF_LINK)
295 sdl = (const struct sockaddr_dl *) ifa->ifa_addr;
296 else
297 sdl = NULL;
298 if (sdl != NULL && sdl->sdl_type == IFT_USB)
299 continue;
300 if (cp != NULL && strcmp(cp, ifa->ifa_name) == 0 && !namesonly)
301 continue;
302 iflen = strlcpy(name, ifa->ifa_name, sizeof(name));
303 if (iflen >= sizeof(name)) {
304 warnx("%s: interface name too long, skipping",
305 ifa->ifa_name);
306 continue;
307 }
308 cp = ifa->ifa_name;
309
298 if (cp != NULL && strcmp(cp, ifa->ifa_name) == 0 && !namesonly)
299 continue;
300 iflen = strlcpy(name, ifa->ifa_name, sizeof(name));
301 if (iflen >= sizeof(name)) {
302 warnx("%s: interface name too long, skipping",
303 ifa->ifa_name);
304 continue;
305 }
306 cp = ifa->ifa_name;
307
308 if ((ifa->ifa_flags & IFF_CANTCONFIG) != 0)
309 continue;
310 if (downonly && (ifa->ifa_flags & IFF_UP) != 0)
311 continue;
312 if (uponly && (ifa->ifa_flags & IFF_UP) == 0)
313 continue;
314 /*
315 * Are we just listing the interfaces?
316 */
317 if (namesonly) {

--- 867 unchanged lines hidden ---
310 if (downonly && (ifa->ifa_flags & IFF_UP) != 0)
311 continue;
312 if (uponly && (ifa->ifa_flags & IFF_UP) == 0)
313 continue;
314 /*
315 * Are we just listing the interfaces?
316 */
317 if (namesonly) {

--- 867 unchanged lines hidden ---