LinkLiar icon indicating copy to clipboard operation
LinkLiar copied to clipboard

bug? wifi unable to connect on sleep-wake

Open braco opened this issue 2 years ago • 3 comments

I think this was being caused by linkliar.

for a long time my laptop seemed to be unable to connect back to wifi on waking up from a sleep state. it would see the network, but hang on reconnection and eventually fail. I would have to restart the computer to get it work.

I uninstalled linkliar and I think the problem is resolved.

I originally assumed this was a hardware problem and only realized it was a soft issue because I copied my user profile to a different laptop and started having the same problem.

not sure how else to diagnose, just wanted to flag this up.

braco avatar Aug 03 '22 00:08 braco

Hi! Thank you for reporting this.

I'm using LinkLiar on several generations of MacBooks and what you describe happens to me only a few times per year.

Changing the MAC address on wake would consistently cause the problems you describe consistently. However, LinkLiar changes the MAC address just before the computer goes to sleep!

A few thoughts:

  • Is this on LAN or Wi-FI?
  • Does this happen on every Wi-Fi or only with a particular hotspot?
  • Is LinkLiar configured to randomize the address on sleep ("Allow Rerandomization")?
  • Is the LinkLiar daemon active? ("Keep running in Background")
  • Do you use a very old version of LinkLiar?
  • If you manually change the MAC address back to what it was before going to sleep, does it then connect? (It seems odd to me that you would have to restart the entire computer)

halo avatar Aug 03 '22 07:08 halo

Is this on LAN or Wi-FI?

wifi

Does this happen on every Wi-Fi or only with a particular hotspot?

more than 10 different networks probably

Is LinkLiar configured to randomize the address on sleep ("Allow Rerandomization")?

yes

Is the LinkLiar daemon active? ("Keep running in Background")

yes

Do you use a very old version of LinkLiar?

yes, 1 year~ but upgraded and it happened again

If you manually change the MAC address back to what it was before going to sleep, does it then connect? (It seems odd to me that you would have to restart the entire computer)

you're suggesting to wait for fail state, change to original mac, put laptop to sleep?

braco avatar Aug 05 '22 02:08 braco

yes, 1 year~ but upgraded and it happened again

I was afraid you used a LinkLiar version that is 7 years old, but yours is up-to-date. Is the Mac very old? Stationary or Laptop?

Is LinkLiar configured to randomize the address on sleep ("Allow Rerandomization")?

Oh, I just realized I'm not even using that option myself at the moment. I turned in on now and will observe how often it fails to reconnect.

you're suggesting to wait for fail state, change to original mac, put laptop to sleep?

I suggest you try to reproduce the error manually (using ifconfig) or at least confirm the cause.

Example 1

  • Start LinkLiar and connect to your Wi-Fi
  • Run /Applications/LinkLiar.app/Contents/Resources/logs in a Terminal
  • Put the Mac to sleep and wait 1 minute
  • Wake up the Mac again
  • Check the logs when exactly the MAC address changed (did it change on sleep? Did it change exactly once or multiple times?)

Example 2

  • Start LinkLiar and connect to your Wi-Fi
  • Write down the current MAC address
  • Put the Mac to sleep
  • Wake it up again
  • (I expect your Wi-Fi connection is lost)
  • Use ifconfig to set the MAC address back to what it was before
  • See if the Wi-Fi re-connects automatically
  • If not, Turn Wi-Fi off and on again, see if it now connects

Example 3

  • Deactivate the Daemon
  • Quit LinkLiar
  • Use ifconfig to change your MAC address
  • Immediately put your Mac to sleep
  • Wake it up again
  • See if you recreated the problem LinkLiar seems to cause

If nothing else works

Do not re-randomize. I realize that there simply may be limitations as to how often and when re-randomization can take place before it becomes to difficult for the OS and the router to re-negotiate. Maybe it's simply not possible to re-randomize every time your computer goes to sleep.

There are various requests for changing MAC addresses depending on geolocation or depending on SSIDs and I'm not sure how feasible they really are, because your Wi-Fi may simply not recover at all from a MAC change.

One way or the other, you should never have to reboot your computer. If turning Wi-Fi off and on on again your Mac does not solve the problem, something else is wrong.

Good luck, let me know if I can do anything more. 📟

halo avatar Aug 05 '22 07:08 halo

Any update on this? I'm experiencing the same issues with the same settings. It's quite annoying to have to reboot after every wake, as I can't get wifi back without a reboot.

emizzle avatar Jan 13 '23 05:01 emizzle

Hi @emizzle thank you for your ping.

I don't have an update, but maybe you could try the steps I mentioned above to narrow down the problem. If you activate "Anonymize Logs" in the LinkLiar settings menu, you could even post your logs here if you want.

There are also still a few open questions. When you deactivate re-randomization, does that eliminate the problem, for example? Does deactivating and reactivating Wi-Fi avoid the need for a reboot?

Are you on Apple Silicon or Intel? Does the connection re-establish when you set the MAC address manually to what it was before? Do you see anything unusual in the LinkLiar logs?

halo avatar Jan 13 '23 08:01 halo

Does the Wi-Fi Icon have an exclamation mark in it and no IP address is assigned, even though you're connected to the Access Point? Or what exactly do you mean by "unable to connect back"?

halo avatar Apr 24 '23 13:04 halo

I'll close this issue for now. My recommendation remains that you should deactivate re-randomization. Then there should not be any effect on your Wi-Fi while your computer goes to sleep and wakes up again.

(For what it's worth, I'm planing on releasing a new version of LinkLiar in the coming weeks, though I don't think this particular problem you're describing is going to be affected, as it relates to the sleep/wake logic and I don't see what I could improve there.)

Please feel free to re-open this issue, once you have more info about whether this problem occurs even without re-randomization.

Any update on this? I'm experiencing the same issues with the same settings. It's quite annoying to have to reboot after every wake, as I can't get wifi back without a reboot.

I'm rather certain that a reboot is not required to bring your Wi-Fi back into a working state. You should be able to change the MAC address back to whatever it was before and then it should connect properly again. Sorry I don't have better news at this point.

halo avatar Jan 02 '24 14:01 halo