bluekitchen / btstack

Dual-mode Bluetooth stack, with small memory footprint.
http://bluekitchen-gmbh.com
Other
1.74k stars 618 forks source link

Pan fix dhcp server interface #448

Closed peterharperuk closed 1 year ago

peterharperuk commented 1 year ago

While testing PAN I had an issue with my PC using the wrong address for the PAN network. It wasn't getting the DHCP server replies so was using some random address. This was caused by having another wifi network interface connected on the device at the same time. It was added later and had changed the default interface used for sending data.

I expect everything to route data correctly when IP addresses are assigned, so we just need to make sure the DHCP server sends it's replies on the right network. Add accessors for getting the interface from bnep and setting it in the dhcp server. Then fix this up in the PAN example. I can see from logging in the DHCP server and lease details on my PC that this works as expected.

mringwal commented 1 year ago

Thanks. Is this working as expected now?

peterharperuk commented 1 year ago

Thanks. Yes, definitely works. I have to reboot my Windows PC to get it to forget the address it's got in the past, but with the fix it's getting the right address.