????????

??????????bonding???????????????????????????в???????????????????bonding??ifconfig????????RUNNING?????????????slave??????????ε??ifconfig???RUNNING??????

??????????

???????????????????????????????????????OS??????????????keepalived??track_interfaces???????????????VRRP??????л????????????в???????????????????е????????????????????????????????в?????????????????????MASTER??????keepalived??????bonding??????RUNNING?????????????????????????????????MASTER????

????????????????

???????????????????????????????????????????keepalived?л???RUNNING???ж???????LOWER_UP???ж??LOWER_UP????????????в???????????????????????????????????????-?????????????????????????????????????????????????????????????Υ????track_interfaces????????????????????

????????????????????????????????????????????????Ρ???????????????state???????state?????state??

????????state???????????????????????????????????

????????state?????state??????????????????????????????????ò?????????????????

???????????Linux?????????????state??

????IFF_LOWER_UP-???????????????

????IFF_RUNNING-????state??UP?????????????state????DOWN???1.?????state?DOWN??????????????????down????????2.??????в???

???????????Щ???????????keepalived?????????????????л??????????keepalived????д??????????????keepalived?????bonding???????????????????????...????bonding??????bug?????????ж????

????bond_open????????0?????bonding?????????START??????????????????enslave??bonding????????????bonding??????IF_UP???????????bond_enslave?????????????????????bond_set_carrier???ú????ж?bonding??????????slave?????????????DOWN????bonding????????ó?DOWN??????????????????????????????????????bonding??miimon??????????????????????????bond_set_carrier?????????μ?slave??bongding???????????bond_enslave???????????bond_set_carrier??????????????

static int bond_set_carrier(struct bonding *bond)
{
    struct slave *slave;
    int i;

    if (bond->slave_cnt == 0)
        goto down;

    if (bond->params.mode == BOND_MODE_8023AD)
        return bond_3ad_set_carrier(bond);
//???????е?slave?????????UP?????bondingUP
    bond_for_each_slave(bond?? slave?? i) {
        if (slave->link == BOND_LINK_UP) {
            if (!netif_carrier_ok(bond->dev)) {
                netif_carrier_on(bond->dev);
                return 1;
            }
            return 0;
        }
    }

down:
    if (netif_carrier_ok(bond->dev)) {
        netif_carrier_off(bond->dev);
        return 1;
    }
    return 0;
}