diff options
author | sobomax <sobomax@FreeBSD.org> | 2011-04-18 23:45:50 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2011-04-18 23:45:50 +0000 |
commit | 80e6f3156a1798175e36fcab284b72f5ddf48a0c (patch) | |
tree | ad231b0a3d1fb6d861146e9a5100b6f7c86ec9c8 /sbin/natd | |
parent | 26cf3dd5d7cd0fdfd791bb2a70a50f597ccecce9 (diff) | |
download | FreeBSD-src-80e6f3156a1798175e36fcab284b72f5ddf48a0c.zip FreeBSD-src-80e6f3156a1798175e36fcab284b72f5ddf48a0c.tar.gz |
Furthermore condition IP waiting behaviour also on -dynamic flag.
This should preserve POLA in all other cases (foreground || non-dynamic).
MFC after: 2 weeks
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; |