• Beniamino Galvani's avatar
    manager: set interface as removed when the link disappears · df537d2e
    Beniamino Galvani authored
    Set the device state as removed when the link disappears, so that in
    the call to unrealize() when the device is unmanaged we also perform a
    cleanup of it and especially, we terminate any DHCP client instances
    running on the device.
    
    If we keep DHCP clients running, we can hit assertions later when we
    start another instance on the same interface, because we kill the old
    dhclient from the pidfile, and the g_child_watch_add() done by the
    first client instance is not able to waitpid() it, complaining with:
    
      GChildWatchSource: Exit status of a child process was requested but
      ECHILD was received by waitpid(). Most likely the process is
      ignoring SIGCHLD, or some other thread is invoking waitpid() with a
      nonpositive first argument; either behavior can break applications
      that use g_child_watch_add()/g_spawn_sync() either directly or
      indirectly.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1436602
    df537d2e
nm-manager.c 221 KB