projects
/
project
/
uqmi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c618153
)
wds: make ipv6 address endian swap more portable
author
Felix Fietkau
<
[email protected]
>
Sun, 22 Nov 2015 11:30:46 +0000
(12:30 +0100)
committer
Felix Fietkau
<
[email protected]
>
Sun, 22 Nov 2015 11:37:10 +0000
(12:37 +0100)
Signed-off-by: Felix Fietkau <
[email protected]
>
commands-wds.c
patch
|
blob
|
history
diff --git
a/commands-wds.c
b/commands-wds.c
index fabb5f4c6e8a8e846da7cde4cdc42e463dcd0fe4..fca5fe77383a121b912b374bc91608bb102a8385 100644
(file)
--- a/
commands-wds.c
+++ b/
commands-wds.c
@@
-211,13
+211,12
@@
static void wds_to_ipv4(const char *name, const uint32_t addr)
static void wds_to_ipv6(const char *name, const uint16_t *addr)
{
- int i;
- struct in6_addr ip_addr;
char buf[INET6_ADDRSTRLEN];
+ uint16_t ip_addr[8];
+ int i;
- for (i = 0; i < ARRAY_SIZE(ip_addr.s6_addr16); i++) {
- ip_addr.s6_addr16[i] = htons(addr[i]);
- }
+ for (i = 0; i < ARRAY_SIZE(ip_addr); i++)
+ ip_addr[i] = htons(addr[i]);
blobmsg_add_string(&status, name, inet_ntop(AF_INET6, &ip_addr, buf, sizeof(buf)));
}