diff options
author | obrien <obrien@FreeBSD.org> | 2013-02-08 16:10:16 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2013-02-08 16:10:16 +0000 |
commit | 3028e3f8aba938dfd0bf9fda987b8a72140b8027 (patch) | |
tree | b2f038222ff8a70f687652441df00d2b564c8abe /sbin/ifconfig | |
parent | 952a6d5a7cd3d3f9007acfa06805262fc04a105f (diff) | |
parent | 1d08d5f677c1dfa810e381073590adbae19cc69f (diff) | |
download | FreeBSD-src-3028e3f8aba938dfd0bf9fda987b8a72140b8027.zip FreeBSD-src-3028e3f8aba938dfd0bf9fda987b8a72140b8027.tar.gz |
Sync with HEAD.
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r-- | sbin/ifconfig/af_inet6.c | 46 | ||||
-rw-r--r-- | sbin/ifconfig/af_nd6.c | 4 | ||||
-rw-r--r-- | sbin/ifconfig/ifconfig.8 | 50 | ||||
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 2 | ||||
-rw-r--r-- | sbin/ifconfig/ifieee80211.c | 4 |
5 files changed, 39 insertions, 67 deletions
diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c index d74b0d2..b4db0f1 100644 --- a/sbin/ifconfig/af_inet6.c +++ b/sbin/ifconfig/af_inet6.c @@ -62,7 +62,6 @@ static struct in6_aliasreq in6_addreq = .ifra_lifetime = { 0, 0, ND6_INFINITE_LIFETIME, ND6_INFINITE_LIFETIME } }; static int ip6lifetime; -static void in6_fillscopeid(struct sockaddr_in6 *sin6); static int prefix(void *, int); static char *sec2str(time_t); static int explicit_prefix = 0; @@ -166,18 +165,6 @@ setip6eui64(const char *cmd, int dummy __unused, int s, } static void -in6_fillscopeid(struct sockaddr_in6 *sin6) -{ -#if defined(__KAME__) && defined(KAME_SCOPEID) - if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { - sin6->sin6_scope_id = - ntohs(*(u_int16_t *)&sin6->sin6_addr.s6_addr[2]); - sin6->sin6_addr.s6_addr[2] = sin6->sin6_addr.s6_addr[3] = 0; - } -#endif -} - -static void in6_status(int s __unused, const struct ifaddrs *ifa) { struct sockaddr_in6 *sin, null_sin; @@ -187,7 +174,6 @@ in6_status(int s __unused, const struct ifaddrs *ifa) struct in6_addrlifetime lifetime; time_t t = time(NULL); int error; - u_int32_t scopeid; memset(&null_sin, 0, sizeof(null_sin)); @@ -217,18 +203,6 @@ in6_status(int s __unused, const struct ifaddrs *ifa) lifetime = ifr6.ifr_ifru.ifru_lifetime; close(s6); - /* XXX: embedded link local addr check */ - if (IN6_IS_ADDR_LINKLOCAL(&sin->sin6_addr) && - *(u_short *)&sin->sin6_addr.s6_addr[2] != 0) { - u_short index; - - index = *(u_short *)&sin->sin6_addr.s6_addr[2]; - *(u_short *)&sin->sin6_addr.s6_addr[2] = 0; - if (sin->sin6_scope_id == 0) - sin->sin6_scope_id = ntohs(index); - } - scopeid = sin->sin6_scope_id; - error = getnameinfo((struct sockaddr *)sin, sin->sin6_len, addr_buf, sizeof(addr_buf), NULL, 0, NI_NUMERICHOST); if (error != 0) @@ -245,17 +219,6 @@ in6_status(int s __unused, const struct ifaddrs *ifa) if (sin != NULL && sin->sin6_family == AF_INET6) { int error; - /* XXX: embedded link local addr check */ - if (IN6_IS_ADDR_LINKLOCAL(&sin->sin6_addr) && - *(u_short *)&sin->sin6_addr.s6_addr[2] != 0) { - u_short index; - - index = *(u_short *)&sin->sin6_addr.s6_addr[2]; - *(u_short *)&sin->sin6_addr.s6_addr[2] = 0; - if (sin->sin6_scope_id == 0) - sin->sin6_scope_id = ntohs(index); - } - error = getnameinfo((struct sockaddr *)sin, sin->sin6_len, addr_buf, sizeof(addr_buf), NULL, 0, @@ -288,8 +251,9 @@ in6_status(int s __unused, const struct ifaddrs *ifa) if ((flags6 & IN6_IFF_TEMPORARY) != 0) printf("temporary "); - if (scopeid) - printf("scopeid 0x%x ", scopeid); + if (((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_scope_id) + printf("scopeid 0x%x ", + ((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_scope_id); if (ip6lifetime && (lifetime.ia6t_preferred || lifetime.ia6t_expire)) { printf("pltime "); @@ -458,7 +422,6 @@ in6_status_tunnel(int s) return; if (sa->sa_family != AF_INET6) return; - in6_fillscopeid(&in6_ifr.ifr_addr); if (getnameinfo(sa, sa->sa_len, src, sizeof(src), 0, 0, NI_NUMERICHOST) != 0) src[0] = '\0'; @@ -467,7 +430,6 @@ in6_status_tunnel(int s) return; if (sa->sa_family != AF_INET6) return; - in6_fillscopeid(&in6_ifr.ifr_addr); if (getnameinfo(sa, sa->sa_len, dst, sizeof(dst), 0, 0, NI_NUMERICHOST) != 0) dst[0] = '\0'; @@ -511,6 +473,8 @@ static struct cmd inet6_cmds[] = { DEF_CMD("-nud", -ND6_IFF_PERFORMNUD, setnd6flags), DEF_CMD("auto_linklocal",ND6_IFF_AUTO_LINKLOCAL,setnd6flags), DEF_CMD("-auto_linklocal",-ND6_IFF_AUTO_LINKLOCAL,setnd6flags), + DEF_CMD("no_prefer_iface",ND6_IFF_NO_PREFER_IFACE,setnd6flags), + DEF_CMD("-no_prefer_iface",-ND6_IFF_NO_PREFER_IFACE,setnd6flags), DEF_CMD_ARG("pltime", setip6pltime), DEF_CMD_ARG("vltime", setip6vltime), DEF_CMD("eui64", 0, setip6eui64), diff --git a/sbin/ifconfig/af_nd6.c b/sbin/ifconfig/af_nd6.c index 654e2d9..5c46452 100644 --- a/sbin/ifconfig/af_nd6.c +++ b/sbin/ifconfig/af_nd6.c @@ -58,7 +58,7 @@ static const char rcsid[] = #define MAX_SYSCTL_TRY 5 #define ND6BITS "\020\001PERFORMNUD\002ACCEPT_RTADV\003PREFER_SOURCE" \ "\004IFDISABLED\005DONT_SET_IFROUTE\006AUTO_LINKLOCAL" \ - "\007NO_RADR\020DEFAULTIF" + "\007NO_RADR\010NO_PREFER_IFACE\020DEFAULTIF" static int isnd6defif(int); void setnd6flags(const char *, int, int, const struct afswtch *); @@ -148,7 +148,7 @@ nd6_status(int s) memset(&nd, 0, sizeof(nd)); strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { - if (errno != EPROTONOSUPPORT) + if (errno != EAFNOSUPPORT) warn("socket(AF_INET6, SOCK_DGRAM)"); return; } diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index f22cc50..9c74980 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd July 9, 2012 +.Dd January 10, 2013 .Dt IFCONFIG 8 .Os .Sh NAME @@ -142,7 +142,7 @@ The link-level address is specified as a series of colon-separated hex digits. This can be used to -e.g.\& set a new MAC address on an ethernet interface, though the +e.g.,\& set a new MAC address on an ethernet interface, though the mechanism used is not ethernet-specific. If the interface is already up when this option is used, it will be briefly brought down and @@ -301,7 +301,7 @@ Specify interface FIB. A FIB .Ar fib_number is assigned to all frames or packets received on that interface. -The FIB is not inherited, e.g. vlans or other sub-interfaces will use +The FIB is not inherited, e.g., vlans or other sub-interfaces will use the default FIB (0) irrespective of the parent interface's FIB. The kernel needs to be tuned to support more than the default FIB using the @@ -716,6 +716,13 @@ Set a flag to enable Neighbor Unreachability Detection. .It Cm -nud Clear a flag .Cm nud . +.It Cm no_prefer_iface +Set a flag to not prefer address on the interface as candidates of the +source address for outgoing packets, even when the interface is +outgoing interface. +.It Cm -no_prefer_iface +Clear a flag +.Cm no_prefer_iface . .El .Pp The following parameters are specific to cloning @@ -1003,7 +1010,7 @@ For example, if a device is capable of operating on channel 6 with 802.11n and 802.11g then one can specify that g-only use should be used by specifying ``6:g''. Similarly the channel width can be specified by appending it -with ``/''; e.g. ``6/40'' specifies a 40MHz wide channel, +with ``/''; e.g., ``6/40'' specifies a 40MHz wide channel, These attributes can be combined as in: ``6:ht/40''. The full set of flags specified following a ``:'' are: .Cm a @@ -1036,7 +1043,7 @@ and In addition, a 40MHz HT channel specification may include the location of the extension channel by appending ``+'' or ``-'' for above and below, -respectively; e.g. ``2437:ht/40+'' specifies 40MHz wide HT operation +respectively; e.g., ``2437:ht/40+'' specifies 40MHz wide HT operation with the center channel at frequency 2437 and the extension channel above. .It Cm country Ar name Set the country code to use in calculating the regulatory constraints @@ -1046,7 +1053,7 @@ will operation on the channels, and the maximum transmit power that can be used on a channel are defined by this setting. Country/Region codes are specified as a 2-character abbreviation defined by ISO 3166 or using a longer, but possibly ambiguous, spelling; -e.g. "ES" and "Spain". +e.g., "ES" and "Spain". The set of country codes are taken from /etc/regdomain.xml and can also be viewed with the ``list countries'' request. Note that not all devices support changing the country code from a default @@ -1063,7 +1070,7 @@ DFS embodies several facilities including detection of overlapping radar signals, dynamic transmit power control, and channel selection according to a least-congested criteria. DFS support is mandatory for some 5GHz frequencies in certain -locales (e.g. ETSI). +locales (e.g., ETSI). By default DFS is enabled according to the regulatory definitions specified in /etc/regdomain.xml and the current country code, regdomain, and channel. @@ -1115,7 +1122,7 @@ specifies the number of beacon intervals between DTIM and must be in the range 1 to 15. By default DTIM is 1 (i.e., DTIM occurs at each beacon). .It Cm quiet -Enable the use of quiet IE. Hostap will use this to silent other +Enable the use of quiet IE. Hostap will use this to silence other stations to reduce interference for radar detection when operating on 5GHz frequency and doth support is enabled. Use @@ -1168,7 +1175,7 @@ Enable Dynamic WDS (DWDS) support. DWDS is a facility by which 4-address traffic can be carried between stations operating in infrastructure mode. A station first associates to an access point and authenticates using -normal procedures (e.g. WPA). +normal procedures (e.g., WPA). Then 4-address frames are passed to carry traffic for stations operating on either side of the wireless link. DWDS extends the normal WDS mechanism by leveraging existing security @@ -1186,7 +1193,7 @@ When DWDS is enabled on a station, traffic with a destination address different from the peer station are encapsulated in a 4-address frame and transmitted to the peer. All 4-address traffic uses the security information of the stations -(e.g. cryptographic keys). +(e.g., cryptographic keys). A station is associated using 802.11n facilities may transport 4-address traffic using these same mechanisms; this depends on available resources and capabilities of the device. @@ -1236,7 +1243,7 @@ Stations negotiate use of these facilities, termed HT20 and HT40, when they associate. To disable all use of 802.11n use .Fl ht . -To disable use of HT20 (e.g. to force only HT40 use) use +To disable use of HT20 (e.g., to force only HT40 use) use .Fl ht20 . To disable use of HT40 use .Fl ht40 . @@ -1250,7 +1257,7 @@ Auto Channel Selection is used to locate a channel to operate on, HT configuration controls whether legacy, HT20, or HT40 operation is setup on the selected channel. If a fixed channel is specified for a station then HT configuration can -be given as part of the channel specification; e.g. 6:ht/20 to setup +be given as part of the channel specification; e.g., 6:ht/20 to setup HT20 operation on channel 6. .It Cm htcompat Enable use of compatibility support for pre-802.11n devices (default). @@ -1506,13 +1513,13 @@ The default setting is 6 but drivers may override this with a value they choose. .It Cm mcastrate Ar rate Set the rate for transmitting multicast/broadcast frames. -Rates are specified as megabits/second in decimal; e.g.\& 5.5 for 5.5 Mb/s. +Rates are specified as megabits/second in decimal; e.g.,\& 5.5 for 5.5 Mb/s. This rate should be valid for the current operating conditions; if an invalid rate is specified drivers are free to chose an appropriate rate. .It Cm mgtrate Ar rate Set the rate for transmitting management and/or control frames. -Rates are specified as megabits/second in decimal; e.g.\& 5.5 for 5.5 Mb/s. +Rates are specified as megabits/second in decimal; e.g.,\& 5.5 for 5.5 Mb/s. .It Cm outdoor Set the location to use in calculating regulatory constraints. The location is also advertised in beacon and probe response frames @@ -1672,7 +1679,7 @@ request can be used to show recent scan results without initiating a new scan. .It Cm scanvalid Ar threshold Set the maximum time the scan cache contents are considered valid; -i.e. will be used without first triggering a scan operation to +i.e., will be used without first triggering a scan operation to refresh the data. The .Ar threshold @@ -1734,7 +1741,7 @@ When operating with TDMA, setup a BSS with slots. The slot count may be at most 8. The current implementation is only tested with two stations -(i.e. point to point applications). +(i.e., point to point applications). This setting is only meaningful when a station is configured as slot 0; other stations adopt this setting from the BSS they join. By default @@ -1758,7 +1765,7 @@ is set to 10 milliseconds. When operating with TDMA, setup a BSS such that beacons are transmitted every .Ar intval superframes to synchronize the TDMA slot timing. -A superframe is defined as the number of slots times the slot length; e.g. +A superframe is defined as the number of slots times the slot length; e.g., a BSS with two slots of 10 milliseconds has a 20 millisecond superframe. The beacon interval may not be zero. A lower setting of @@ -1784,7 +1791,7 @@ the driver will use the setting closest to the specified value. Not all adapters support changing the transmit power. .It Cm ucastrate Ar rate Set a fixed rate for transmitting unicast frames. -Rates are specified as megabits/second in decimal; e.g.\& 5.5 for 5.5 Mb/s. +Rates are specified as megabits/second in decimal; e.g.,\& 5.5 for 5.5 Mb/s. This rate should be valid for the current operating conditions; if an invalid rate is specified drivers are free to chose an appropriate rate. @@ -2519,7 +2526,7 @@ protocol on an interface: Set the virtual host ID. This is a required setting to initiate .Xr carp 4 . -If the virtual host ID doesn't exist yet, it is created and attached to the +If the virtual host ID does not exist yet, it is created and attached to the interface, otherwise configuration of an existing vhid is adjusted. If the .Cm vhid @@ -2628,9 +2635,6 @@ The flag disables this behavior. .Pp Only the super-user may modify the configuration of a network interface. -.Sh NOTES -The media selection system is relatively new and only some drivers support -it (or have need for it). .Sh EXAMPLES Assign the IPv4 address .Li 192.0.2.10 , @@ -2714,7 +2718,9 @@ tried to alter an interface's configuration. .Xr pfsync 4 , .Xr polling 4 , .Xr vlan 4 , +.Xr devd.conf 5 , .\" .Xr eon 5 , +.Xr devd 8 , .Xr rc 8 , .Xr routed 8 , .Xr jail 8 , diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 870acdd..983e21f 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -520,7 +520,7 @@ top: AF_LOCAL : afp->af_af; if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0 && - (uafp != NULL || errno != EPROTONOSUPPORT || + (uafp != NULL || errno != EAFNOSUPPORT || (s = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0)) err(1, "socket(family %u,SOCK_DGRAM", ifr.ifr_addr.sa_family); diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index c2b7678..d0b4917 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -4025,7 +4025,9 @@ list_mesh(int s) (rt->imr_flags & IEEE80211_MESHRT_FLAGS_VALID) ? 'V' : '!', (rt->imr_flags & IEEE80211_MESHRT_FLAGS_PROXY) ? - 'P' : ' '); + 'P' : + (rt->imr_flags & IEEE80211_MESHRT_FLAGS_GATE) ? + 'G' :' '); } } |