Skip to content

Commit

Permalink
Lack of IPv4 doesn't mean disconnected
Browse files Browse the repository at this point in the history
The Internet connectivity checker would declare that the network was
disconnected if an IPv4 address wasn't available. This is untrue for a
couple reasons:

1. IPv6 addresses are available
2. DHCP and layer 2 protocols could still be used

This also had a weird side effect where interfaces would initially come
up (`lan` connectivity), then go disconnected when an IPv4 address
wasn't found, and then come back when an IPv4 address was found.

Fixes #268
  • Loading branch information
fhunleth committed Apr 6, 2021
1 parent 94e305b commit 6ecbe54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/vintage_net/interface/internet_connectivity_checker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ defmodule VintageNet.Interface.InternetConnectivityChecker do
{:disconnected, @max_fails_in_a_row}

{:error, :no_ipv4_address} ->
{:disconnected, @max_fails_in_a_row}
{:lan, @max_fails_in_a_row}

{:error, reason} ->
if strikes < @max_fails_in_a_row do
Expand Down

0 comments on commit 6ecbe54

Please sign in to comment.