Skip to content

Commit

Permalink
Use current netif address in NetBIOS response (#8622)
Browse files Browse the repository at this point in the history
* fix 8139 netbios in AP mode

* take the current if addr

* handle enabled ipv6

Co-authored-by: pablo <[email protected]>
  • Loading branch information
mcspr and pabloandresm committed Jun 29, 2022
1 parent 678a477 commit a2c8a63
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libraries/ESP8266NetBIOS/ESP8266NetBIOS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a2c8a63

Please sign in to comment.