Skip to content

Commit

Permalink
Fix bug when deconfigure fails because of a device not existing
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorRigby committed Jan 16, 2019
1 parent 7d8d558 commit 9ee1e7c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/nerves_network/wifi_manager.ex
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ defmodule Nerves.Network.WiFiManager do
defp consume(:up, :ifdown, state) do
state
|> stop_dhcp
|> deconfigure
|> goto_context(:down)
end

Expand Down Expand Up @@ -584,7 +583,10 @@ defmodule Nerves.Network.WiFiManager do
nameservers: []
]

:ok = Nerves.NetworkInterface.setup(state.ifname, clear)
# This is a "best effort" call.
# This will be called in situations where the IF is removed or
# down, which results in things like ENODEV
_ = Nerves.NetworkInterface.setup(state.ifname, clear)
:ok = Nerves.Network.Resolvconf.clear(Nerves.Network.Resolvconf, state.ifname)
state
end
Expand Down

0 comments on commit 9ee1e7c

Please sign in to comment.