diff options
author | jamie <jamie@FreeBSD.org> | 2016-01-16 22:32:57 +0000 |
---|---|---|
committer | jamie <jamie@FreeBSD.org> | 2016-01-16 22:32:57 +0000 |
commit | 2595beb23eaefead7d0a7c8928f688e2bacc8574 (patch) | |
tree | 7dc0c69f70306ebc343e9da94174a180ca1bf491 /usr.sbin | |
parent | b6b45431998429c11543b3f0ce9b9b3929c5428b (diff) | |
download | FreeBSD-src-2595beb23eaefead7d0a7c8928f688e2bacc8574.zip FreeBSD-src-2595beb23eaefead7d0a7c8928f688e2bacc8574.tar.gz |
Don't bother checking an ip[46].addr netmask/prefixlen. This is already
handled by ifconfig, and it was doing it wrong when the paramater included
extra ifconfig options.
PR: 205926
MFC after: 5 days
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/jail/config.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/usr.sbin/jail/config.c b/usr.sbin/jail/config.c index 87b8ef9..cb06bac 100644 --- a/usr.sbin/jail/config.c +++ b/usr.sbin/jail/config.c @@ -454,7 +454,7 @@ check_intparams(struct cfjail *j) struct addrinfo hints; struct addrinfo *ai0, *ai; const char *hostname; - int gicode, defif, prefix; + int gicode, defif; #endif #ifdef INET struct in_addr addr4; @@ -597,15 +597,7 @@ check_intparams(struct cfjail *j) strcpy(s->s, cs + 1); s->len -= cs + 1 - s->s; } - if ((cs = strchr(s->s, '/'))) { - prefix = strtol(cs + 1, &ep, 10); - if (*ep == '.' - ? inet_pton(AF_INET, cs + 1, &addr4) != 1 - : *ep || prefix < 0 || prefix > 32) { - jail_warnx(j, - "ip4.addr: bad netmask \"%s\"", cs); - error = -1; - } + if ((cs = strchr(s->s, '/')) != NULL) { *cs = '\0'; s->len = cs - s->s; } @@ -626,14 +618,7 @@ check_intparams(struct cfjail *j) strcpy(s->s, cs + 1); s->len -= cs + 1 - s->s; } - if ((cs = strchr(s->s, '/'))) { - prefix = strtol(cs + 1, &ep, 10); - if (*ep || prefix < 0 || prefix > 128) { - jail_warnx(j, - "ip6.addr: bad prefixlen \"%s\"", - cs); - error = -1; - } + if ((cs = strchr(s->s, '/')) != NULL) { *cs = '\0'; s->len = cs - s->s; } |