Skip to content

Commit 4f608ec

Browse files
mcsprpabloandresm
authored andcommitted
Use current netif address in NetBIOS response (esp8266#8622)
* fix 8139 netbios in AP mode * take the current if addr * handle enabled ipv6 Co-authored-by: pablo <pablomartikian@hotmail.com>
1 parent 1234d9d commit 4f608ec

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libraries/ESP8266NetBIOS/ESP8266NetBIOS.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,7 @@ void ESP8266NetBIOS::_recv(udp_pcb *upcb, pbuf *pb, const ip_addr_t *addr, uint1
212212
nbnsa.NBNSA_TIMETOLIVE = LWIP_PLATFORM_HTONL(300000UL);// Time to live (30000 sekund)
213213
nbnsa.NBNSA_LENGTH = LWIP_PLATFORM_HTONS(6);
214214
nbnsa.NBNSA_NODEFLAGS = LWIP_PLATFORM_HTONS(0);
215-
nbnsa.NBNSA_NODEADDRESS = WiFi.localIP(); // ulozime nasi IP adresu
216-
215+
nbnsa.NBNSA_NODEADDRESS = ip_addr_get_ip4_u32(&ip_current_netif()->ip_addr);
217216
pbuf* pbt = pbuf_alloc(PBUF_TRANSPORT, sizeof(nbnsa), PBUF_RAM);
218217
if(pbt != NULL) {
219218
uint8_t* dst = reinterpret_cast<uint8_t*>(pbt->payload);

0 commit comments

Comments
 (0)