Date: Wed, 24 May 2017 09:01:55 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r318777 - stable/11/sbin/ipfw Message-ID: <201705240901.v4O91tVF014520@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ae Date: Wed May 24 09:01:54 2017 New Revision: 318777 URL: https://svnweb.freebsd.org/changeset/base/318777 Log: MFC r318400: Allow zero port specification in table entries with type flow. PR: 217620 Modified: stable/11/sbin/ipfw/tables.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/tables.c ============================================================================== --- stable/11/sbin/ipfw/tables.c Wed May 24 06:49:01 2017 (r318776) +++ stable/11/sbin/ipfw/tables.c Wed May 24 09:01:54 2017 (r318777) @@ -1260,16 +1260,14 @@ tentry_fill_key_type(char *arg, ipfw_obj if ((p = strchr(arg, ',')) != NULL) *p++ = '\0'; - if ((port = htons(strtol(arg, NULL, 10))) == 0) { + port = htons(strtol(arg, &pp, 10)); + if (*pp != '\0') { if ((sent = getservbyname(arg, NULL)) == NULL) errx(EX_DATAERR, "Unknown service: %s", arg); - else - key = sent->s_port; + port = sent->s_port; } - tfe->sport = port; - arg = p; } @@ -1304,16 +1302,14 @@ tentry_fill_key_type(char *arg, ipfw_obj if ((p = strchr(arg, ',')) != NULL) *p++ = '\0'; - if ((port = htons(strtol(arg, NULL, 10))) == 0) { + port = htons(strtol(arg, &pp, 10)); + if (*pp != '\0') { if ((sent = getservbyname(arg, NULL)) == NULL) errx(EX_DATAERR, "Unknown service: %s", arg); - else - key = sent->s_port; + port = sent->s_port; } - tfe->dport = port; - arg = p; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705240901.v4O91tVF014520>