Merge pull request #12528 from benpicco/ifconfig_scope
shell_commands: gnrc_netif: print correct scope for IPv6 address
This commit is contained in:
commit
42968ccc6b
@ -352,11 +352,17 @@ static void _netif_list_ipv6(ipv6_addr_t *addr, uint8_t flags)
|
|||||||
printf("inet6 addr: ");
|
printf("inet6 addr: ");
|
||||||
ipv6_addr_to_str(addr_str, addr, sizeof(addr_str));
|
ipv6_addr_to_str(addr_str, addr, sizeof(addr_str));
|
||||||
printf("%s scope: ", addr_str);
|
printf("%s scope: ", addr_str);
|
||||||
if ((ipv6_addr_is_link_local(addr))) {
|
if (ipv6_addr_is_link_local(addr)) {
|
||||||
printf("local");
|
printf("link");
|
||||||
|
}
|
||||||
|
else if (ipv6_addr_is_site_local(addr)) {
|
||||||
|
printf("site");
|
||||||
|
}
|
||||||
|
else if (ipv6_addr_is_global(addr)) {
|
||||||
|
printf("global");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
printf("global");
|
printf("unknown");
|
||||||
}
|
}
|
||||||
if (flags & GNRC_NETIF_IPV6_ADDRS_FLAGS_ANYCAST) {
|
if (flags & GNRC_NETIF_IPV6_ADDRS_FLAGS_ANYCAST) {
|
||||||
printf(" [anycast]");
|
printf(" [anycast]");
|
||||||
|
|||||||
@ -371,7 +371,7 @@ def testfunc(child):
|
|||||||
child.expect("HWaddr: (?P<hwaddr>[A-Fa-f:0-9]+)")
|
child.expect("HWaddr: (?P<hwaddr>[A-Fa-f:0-9]+)")
|
||||||
hwaddr_dst = child.match.group("hwaddr").lower()
|
hwaddr_dst = child.match.group("hwaddr").lower()
|
||||||
res = child.expect([
|
res = child.expect([
|
||||||
r"(?P<lladdr>fe80::[A-Fa-f:0-9]+)\s+scope:\s+local\s+VAL",
|
r"(?P<lladdr>fe80::[A-Fa-f:0-9]+)\s+scope:\s+link\s+VAL",
|
||||||
pexpect.TIMEOUT
|
pexpect.TIMEOUT
|
||||||
])
|
])
|
||||||
count += 1
|
count += 1
|
||||||
|
|||||||
@ -50,7 +50,7 @@ static void _print_addr(ipv6_addr_t *addr, uint8_t flags)
|
|||||||
ipv6_addr_to_str(addr_str, addr, sizeof(addr_str));
|
ipv6_addr_to_str(addr_str, addr, sizeof(addr_str));
|
||||||
printf("%s scope: ", addr_str);
|
printf("%s scope: ", addr_str);
|
||||||
if ((ipv6_addr_is_link_local(addr))) {
|
if ((ipv6_addr_is_link_local(addr))) {
|
||||||
printf("local");
|
printf("link");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
printf("global");
|
printf("global");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user