[systemd-devel] [PATCH v4] Added support for Uplink Failure Detection using BindCarrier

Andrei Borzenkov arvidjaar at gmail.com
Tue Feb 17 19:43:00 PST 2015


В Tue, 17 Feb 2015 04:06:57 -0800
Alin Rauta <alin.rauta at intel.com> пишет:

> +
> +static int link_handle_bound_to_list(Link *link) {
> +        Link *l;
> +        Iterator i;
> +        int r;
> +        bool required_up = false;
> +        bool link_is_up = false;
> +
> +        assert(link);
> +
> +        if (hashmap_isempty(link->bound_to_links))
> +                return 0;
> +
> +        if (link->flags & IFF_UP)
> +                link_is_up = true;
> +
> +        HASHMAP_FOREACH (l, link->bound_to_links, i)
> +                if (link_has_carrier(l)) {
> +                        required_up = true;
> +                        break;
> +                }
> +
> +        if (!required_up && link_is_up) {
> +                r = link_down(link);
> +                if (r < 0)
> +                        return r;
> +        } else if (required_up && !link_is_up) {
> +                r = link_up(link);
> +                if (r < 0)
> +                        return r;
> +        }
> +
> +        return 0;
> +}
> +

This means if link was administratively down it will be
reactivated again

ip link set dev down-link down
unplug up-link
plug up-link

down-link is now up. Is it intentional?


More information about the systemd-devel mailing list