ifconfig.c (223078) | ifconfig.c (224179) |
---|---|
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 223078 2011-06-14 12:40:55Z luigi $"; | 41 "$FreeBSD: head/sbin/ifconfig/ifconfig.c 224179 2011-07-18 10:29:16Z bz $"; |
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> --- 443 unchanged lines hidden (view full) --- 493 * This is the historical "accident" allowing users to configure IPv4 494 * addresses without the "inet" keyword which while a nice feature has 495 * proven to complicate other things. We cannot remove this but only 496 * make sure we will never have a similar implicit default for IPv6 or 497 * any other address familiy. We need a fallback though for 498 * ifconfig IF up/down etc. to work without INET support as people 499 * never used ifconfig IF link up/down, etc. either. 500 */ | 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> --- 443 unchanged lines hidden (view full) --- 493 * This is the historical "accident" allowing users to configure IPv4 494 * addresses without the "inet" keyword which while a nice feature has 495 * proven to complicate other things. We cannot remove this but only 496 * make sure we will never have a similar implicit default for IPv6 or 497 * any other address familiy. We need a fallback though for 498 * ifconfig IF up/down etc. to work without INET support as people 499 * never used ifconfig IF link up/down, etc. either. 500 */ |
501#ifndef RESCUE |
|
501#ifdef INET 502 if (afp == NULL && feature_present("inet")) 503 afp = af_getbyname("inet"); 504#endif | 502#ifdef INET 503 if (afp == NULL && feature_present("inet")) 504 afp = af_getbyname("inet"); 505#endif |
506#endif |
|
505 if (afp == NULL) 506 afp = af_getbyname("link"); 507 if (afp == NULL) { 508 warnx("Please specify an address_family."); 509 usage(); 510 } 511top: 512 ifr.ifr_addr.sa_family = --- 695 unchanged lines hidden --- | 507 if (afp == NULL) 508 afp = af_getbyname("link"); 509 if (afp == NULL) { 510 warnx("Please specify an address_family."); 511 usage(); 512 } 513top: 514 ifr.ifr_addr.sa_family = --- 695 unchanged lines hidden --- |