Furthermore condition IP waiting behaviour also on -dynamic flag.

This should preserve POLA in all other cases (foreground || non-dynamic).

MFC after:	2 weeks
This commit is contained in:
Maxim Sobolev 2011-04-18 23:45:50 +00:00
parent a8bafa5d3b
commit dde269c93b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=220808

View File

@ -305,9 +305,11 @@ int main (int argc, char** argv)
else {
do {
rval = SetAliasAddressFromIfName (mip->ifName);
if (background != 0 && rval == EAGAIN)
if (background == 0 || dynamicMode == 0)
break;
if (rval == EAGAIN)
sleep(1);
} while (background != 0 && rval == EAGAIN);
} while (rval == EAGAIN);
if (rval != 0)
exit(1);
}
@ -648,9 +650,11 @@ static void DoAliasing (int fd, int direction)
if (mip->assignAliasAddr) {
do {
rval = SetAliasAddressFromIfName (mip->ifName);
if (background != 0 && rval == EAGAIN)
if (background == 0 || dynamicMode == 0)
break;
if (rval == EAGAIN)
sleep(1);
} while (background != 0 && rval == EAGAIN);
} while (rval == EAGAIN);
if (rval != 0)
exit(1);
mip->assignAliasAddr = 0;