Skip to content

Instantly share code, notes, and snippets.

@shimarin
Created April 29, 2022 14:23
Show Gist options
  • Save shimarin/1bdbecec648d5f65dca5d7e0758981d6 to your computer and use it in GitHub Desktop.
Save shimarin/1bdbecec648d5f65dca5d7e0758981d6 to your computer and use it in GitHub Desktop.
diff --git a/src/core/ipv6/ip6_addr.c b/src/core/ipv6/ip6_addr.c
old mode 100644
new mode 100755
index 687c02f7..ad649761
--- a/src/core/ipv6/ip6_addr.c
+++ b/src/core/ipv6/ip6_addr.c
@@ -41,6 +41,7 @@
*/
#include "lwip/opt.h"
+#include "lwip/netif.h"
#if LWIP_IPV6 /* don't build if not configured for use in lwipopts.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) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment