Fix a parsing bug when specifying more than one address with dotted decimal
netmask. Reported by: Igor Anishchuk PR: kern/107565 MFC after: 3 days
This commit is contained in:
parent
9da038edfd
commit
c2221c3536
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=165851
@ -2763,13 +2763,17 @@ fill_ip(ipfw_insn_ip *cmd, char *av)
|
||||
* ',' indicating another address follows, '{' indicating a
|
||||
* set of addresses of unspecified size.
|
||||
*/
|
||||
char *p = strpbrk(av, "/:,{");
|
||||
char *t = NULL, *p = strpbrk(av, "/:,{");
|
||||
int masklen;
|
||||
char md;
|
||||
char md, nd;
|
||||
|
||||
if (p) {
|
||||
md = *p;
|
||||
*p++ = '\0';
|
||||
if ((t = strpbrk(p, ",{")) != NULL) {
|
||||
nd = *t;
|
||||
*t = '\0';
|
||||
}
|
||||
} else
|
||||
md = '\0';
|
||||
|
||||
@ -2803,6 +2807,8 @@ fill_ip(ipfw_insn_ip *cmd, char *av)
|
||||
break;
|
||||
}
|
||||
d[0] &= d[1]; /* mask base address with mask */
|
||||
if (t)
|
||||
*t = nd;
|
||||
/* find next separator */
|
||||
if (p)
|
||||
p = strpbrk(p, ",{");
|
||||
|
Loading…
Reference in New Issue
Block a user