Skip to content

Commit 4721643

Browse files
committed
Fix "net" command on kernel configured with CONFIG_IPV6=m
On a kernel configured with CONFIG_IPV6=m, struct inet6_ifaddr is not defined in kernel. Without the patch, the "net" command fails with the following error. net: invalid structure member offset: inet6_ifaddr_if_next FILE: net.c LINE: 1017 FUNCTION: get_device_ip6_address() Signed-off-by: Lianbo Jiang <[email protected]> Signed-off-by: Kazuhito Hagio <[email protected]>
1 parent 2c7310a commit 4721643

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,9 @@ get_device_ip6_address(ulong devaddr, char **bufp, long buflen)
996996
return;
997997
}
998998

999+
if (INVALID_MEMBER(inet6_ifaddr_if_next))
1000+
return;
1001+
9991002
readmem(ip6_ptr + OFFSET(inet6_dev_addr_list), KVADDR,
10001003
&addr, sizeof(void *), "inet6_dev.addr_list", FAULT_ON_ERROR);
10011004

0 commit comments

Comments
 (0)