Author: sobomax
Date: Mon Apr 18 23:45:50 2011
New Revision: 220808
URL: http://svn.freebsd.org/changeset/base/220808

Log:
  Furthermore condition IP waiting behaviour also on -dynamic flag.
  This should preserve POLA in all other cases (foreground || non-dynamic).
  
  MFC after:    2 weeks

Modified:
  head/sbin/natd/natd.c

Modified: head/sbin/natd/natd.c
==============================================================================
--- head/sbin/natd/natd.c       Mon Apr 18 23:35:16 2011        (r220807)
+++ head/sbin/natd/natd.c       Mon Apr 18 23:45:50 2011        (r220808)
@@ -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 dire
        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;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to