If vhid exists return more informative EEXIST instead of EINVAL. While here

remove redundant brackets.
This commit is contained in:
Gleb Smirnoff 2005-03-18 13:41:38 +00:00
parent 2322a0a77d
commit ee6f227017

View File

@ -1844,9 +1844,8 @@ carp_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr)
cif = (struct carp_if *)sc->sc_carpdev->if_carp; cif = (struct carp_if *)sc->sc_carpdev->if_carp;
TAILQ_FOREACH(vr, &cif->vhif_vrs, sc_list) TAILQ_FOREACH(vr, &cif->vhif_vrs, sc_list)
if (vr != sc && if (vr != sc &&
vr->sc_vhid == carpr.carpr_vhid) { vr->sc_vhid == carpr.carpr_vhid)
return EINVAL; return EEXIST;
}
} }
sc->sc_vhid = carpr.carpr_vhid; sc->sc_vhid = carpr.carpr_vhid;
sc->sc_ac.ac_enaddr[0] = 0; sc->sc_ac.ac_enaddr[0] = 0;