1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

Use current netif address in NetBIOS response (#8622)

* fix 8139 netbios in AP mode

* take the current if addr

* handle enabled ipv6

Co-authored-by: pablo <pablomartikian@hotmail.com>
This commit is contained in:
Max Prokhorov 2022-06-29 14:05:19 +03:00 committed by GitHub
parent 678a477559
commit a2c8a63360
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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