[LEDE-DEV] [PATCH netifd] interface: fix "ifup-failed" hotplug event handling

Hans Dedecker dedeckeh at gmail.com
Tue Apr 10 12:20:33 PDT 2018


On Tue, Apr 10, 2018 at 6:21 AM, Martin Schiller <ms at dev.tdt.de> wrote:
> The ifup-failed event should only be triggered when the former
> interface state is IFS_SETUP.
>
> Otherwise, there will also be an ifup-failed event in the
> IFS_TEARDOWN stateif you do an manual ifdown <IFC>.
Patch applied thanks

Hans
>
> Signed-off-by: Martin Schiller <ms at dev.tdt.de>
> ---
>  interface.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/interface.c b/interface.c
> index 900a523..2a23984 100644
> --- a/interface.c
> +++ b/interface.c
> @@ -267,10 +267,16 @@ mark_interface_down(struct interface *iface)
>
>         iface->link_up_event = false;
>         iface->state = IFS_DOWN;
> -       if (state == IFS_UP)
> +       switch (state) {
> +       case IFS_UP:
>                 interface_event(iface, IFEV_DOWN);
> -       else
> +               break;
> +       case IFS_SETUP:
>                 interface_event(iface, IFEV_UP_FAILED);
> +               break;
> +       default:
> +               break;
> +       }
>         interface_ip_set_enabled(&iface->config_ip, false);
>         interface_ip_set_enabled(&iface->proto_ip, false);
>         interface_ip_flush(&iface->proto_ip);
> --
> 2.11.0
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



More information about the Lede-dev mailing list