mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-27 06:14:09 +00:00
ip6addr_aton: support scoped address strings (via '%')
See task #15393 Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
parent
4528215c99
commit
a9e73bc412
@ -46,6 +46,7 @@
|
||||
|
||||
#include "lwip/ip_addr.h"
|
||||
#include "lwip/def.h"
|
||||
#include "lwip/netif.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@ -185,6 +186,17 @@ fix_byte_order_and_return:
|
||||
}
|
||||
|
||||
ip6_addr_clear_zone(addr);
|
||||
#if LWIP_IPV6_SCOPES
|
||||
if (*s == '%') {
|
||||
const char *scopestr = s + 1;
|
||||
if (*scopestr) {
|
||||
struct netif *netif = netif_find(scopestr);
|
||||
if (netif) {
|
||||
ip6_addr_assign_zone(addr, IP6_UNKNOWN, netif);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (current_block_index != 7) {
|
||||
|
Loading…
Reference in New Issue
Block a user