Author: glebius
Date: Wed Nov 23 18:38:08 2011
New Revision: 227901
URL: http://svn.freebsd.org/changeset/base/227901

Log:
  Fix parsing of redirect_addr argument.
  
  PR:           kern/162739
  MFC after:    3 days

Modified:
  head/sbin/ipfw/nat.c

Modified: head/sbin/ipfw/nat.c
==============================================================================
--- head/sbin/ipfw/nat.c        Wed Nov 23 18:15:49 2011        (r227900)
+++ head/sbin/ipfw/nat.c        Wed Nov 23 18:38:08 2011        (r227901)
@@ -345,11 +345,12 @@ setup_redir_addr(char *buf, int *ac, cha
        space = sizeof(struct cfg_redir);
 
        /* Extract local address. */
-       if ((sep = strtok(**av, ",")) != NULL) {
+       if (strchr(**av, ',') != NULL) {
                struct cfg_spool *spool;
 
                /* Setup LSNAT server pool. */
                r->laddr.s_addr = INADDR_NONE;
+               sep = strtok(**av, ",");
                while (sep != NULL) {
                        spool = (struct cfg_spool *)buf;
                        space += sizeof(struct cfg_spool);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to