     end
 
     def handle_event({:net_basic, _, :ifchanged, %{:ifname => ifname}}=event, %EventHandler{ifname: ifname}=state) do
-      Logger.info "Got matching event: #{inspect event}"
       send state.manager, event
       {:ok, state}
     end
     def handle_event(event, state) do
-      Logger.error "Got unmatching event: #{inspect event}"
-      send state.manager, event
+      Logger.error "Ignoring unmatching event: #{inspect event}"
       {:ok, state}
     end
   end

  def handle_info({:net_basic, _, :ifchanged, %{:is_lower_up => true}}, state) do
    Logger.info "#{state.ifname} just came up"
    configure(state)
  end
  def handle_info({:net_basic, _, :ifchanged, %{:is_lower_up => false}}, state) do
    Logger.info "#{state.ifname} just went down"
    deconfigure(state)
  end

  defp configure(state) do
    :ok = NetBasic.set_config(state.net_basic, state.profile.static_ip)
    :ok = Resolvconf.configure(state.resolvconf, state.profile.static_dns)
  end

  defp deconfigure(state) do
    :ok = Resolvconf.clear(state.resolvconf, state.profile.ifname)
  end

end

                              profile: profile,
                              ifname: profile.ifname}

    # Check the status and set an initial event through based
    # on whether the interface is up or down
    status = NetBasic.status(net_basic, profile.ifname)
    handle_info({:net_basic, net_basic, :ifchanged, status}, state)

    {:ok, state}
