diff options
author | jamie <jamie@FreeBSD.org> | 2010-10-27 20:25:55 +0000 |
---|---|---|
committer | jamie <jamie@FreeBSD.org> | 2010-10-27 20:25:55 +0000 |
commit | 0cc1eb58369550147e49374b59c58673074f2b21 (patch) | |
tree | 2783ca1259f3013d6bfca37860721326e0628cad /usr.sbin/jail | |
parent | 3c30caa6545349f6810a60f536f3fa8aee2c52fc (diff) | |
download | FreeBSD-src-0cc1eb58369550147e49374b59c58673074f2b21.zip FreeBSD-src-0cc1eb58369550147e49374b59c58673074f2b21.tar.gz |
Use a little more "ifdef INET6".
Diffstat (limited to 'usr.sbin/jail')
-rw-r--r-- | usr.sbin/jail/config.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/usr.sbin/jail/config.c b/usr.sbin/jail/config.c index f37b49f..4bc8938 100644 --- a/usr.sbin/jail/config.c +++ b/usr.sbin/jail/config.c @@ -580,13 +580,23 @@ ip_params(struct cfjail *j) } if ((cs = strchr(s->s, '/'))) { prefix = strtol(cs + 1, &ep, 10); - if (!isip6 && *ep == '.' + if ( +#ifdef INET6 + !isip6 && +#endif + *ep == '.' ? inet_pton(AF_INET, cs + 1, &addr4) != 1 - : *ep || prefix < 0 || prefix > - (isip6 ? 128 : 32)) { - jail_warnx(j, isip6 - ? "ip6.addr: bad prefixlen \"%s\"" - : "ip4.addr: bad netmask \"%s\"", + : *ep || prefix < 0 || prefix > ( +#ifdef INET6 + isip6 ? 128 : +#endif + 32)) { + jail_warnx(j, +#ifdef INET6 + isip6 + ? "ip6.addr: bad prefixlen \"%s\"" : +#endif + "ip4.addr: bad netmask \"%s\"", cs); error = -1; } |