diff options
Diffstat (limited to 'sbin/natd')
-rw-r--r-- | sbin/natd/natd.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sbin/natd/natd.c b/sbin/natd/natd.c index 58a5e99..05f7463 100644 --- a/sbin/natd/natd.c +++ b/sbin/natd/natd.c @@ -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; |