Clear full-duplex when half-duplex flag is set. This actually makes

'mediaopt half-duplex' working as it should.  It is now equivalent of
'-mediaopt full-duplex'.
This commit is contained in:
Jung-uk Kim 2006-12-19 22:50:49 +00:00
parent b472f371b2
commit f7c6b0a8c6

View File

@ -303,9 +303,13 @@ domediaopt(const char *val, int clear, int s)
ifr.ifr_media = ifmr->ifm_current; ifr.ifr_media = ifmr->ifm_current;
if (clear) if (clear)
ifr.ifr_media &= ~options; ifr.ifr_media &= ~options;
else else {
if (options & IFM_HDX) {
ifr.ifr_media &= ~IFM_FDX;
options &= ~IFM_HDX;
}
ifr.ifr_media |= options; ifr.ifr_media |= options;
}
ifmr->ifm_current = ifr.ifr_media; ifmr->ifm_current = ifr.ifr_media;
callback_register(setifmediacallback, (void *)ifmr); callback_register(setifmediacallback, (void *)ifmr);
} }