summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig
diff options
context:
space:
mode:
authorvsevolod <vsevolod@FreeBSD.org>2015-02-02 19:00:18 +0000
committervsevolod <vsevolod@FreeBSD.org>2015-02-02 19:00:18 +0000
commit143df1bc49248dce22ad0ac3fad8ea428a7710ae (patch)
tree594be559e85cae552ef99aa9728ce8c7506fcc5a /sbin/ifconfig
parentc5880225ff8728678a96990b4f6b3e7807ac2c6e (diff)
downloadFreeBSD-src-143df1bc49248dce22ad0ac3fad8ea428a7710ae.zip
FreeBSD-src-143df1bc49248dce22ad0ac3fad8ea428a7710ae.tar.gz
Revert the change of flowid output format. [1]
Reverse the sorting order of the interfaces addresses familise so it should be the same as getifaddrs(3) order. [2] Suggested by: hrs [1], bz [2] Approved by: hrs, bapt
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r--sbin/ifconfig/af_inet6.c32
-rw-r--r--sbin/ifconfig/ifconfig.c2
2 files changed, 4 insertions, 30 deletions
diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c
index b8121a6..3749400 100644
--- a/sbin/ifconfig/af_inet6.c
+++ b/sbin/ifconfig/af_inet6.c
@@ -167,33 +167,6 @@ setip6eui64(const char *cmd, int dummy __unused, int s,
}
static void
-in6_print_scope(uint8_t *a)
-{
- const char *sname = NULL;
- uint16_t val;
-
- val = (a[0] << 4) + ((a[1] & 0xc0) >> 4);
-
- if ((val & 0xff0) == 0xff0)
- sname = "Multicast";
- else {
- switch(val) {
- case 0xfe8:
- sname = "Link";
- break;
- case 0xfec:
- sname = "Site";
- break;
- default:
- sname = "Global";
- break;
- }
- }
-
- printf("scope: %s ", sname);
-}
-
-static void
in6_status(int s __unused, const struct ifaddrs *ifa)
{
struct sockaddr_in6 *sin, null_sin;
@@ -284,8 +257,9 @@ in6_status(int s __unused, const struct ifaddrs *ifa)
if ((flags6 & IN6_IFF_PREFER_SOURCE) != 0)
printf("prefer_source ");
- in6_print_scope((uint8_t *)&((struct sockaddr_in6 *)
- (ifa->ifa_addr))->sin6_addr);
+ 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 ");
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 73d84f5..5a805a7 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -235,7 +235,7 @@ cmpifaddrs(struct ifaddrs *a, struct ifaddrs *b, struct ifa_queue *q)
if (af1 < ORDERS_SIZE(e1->af_orders) &&
af2 < ORDERS_SIZE(e1->af_orders))
- return (e1->af_orders[af2] - e1->af_orders[af1]);
+ return (e1->af_orders[af1] - e1->af_orders[af2]);
}
return (0);
OpenPOWER on IntegriCloud