aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2013-11-28 19:40:33 +0000
committerPeter Wemm <peter@FreeBSD.org>2013-11-28 19:40:33 +0000
commitb5019bc45b19a7bf154b3d9ca6c868dcaf8810b3 (patch)
tree1819bacbf5d702cf17da5aaa65ae96c44b196784
parent456a87bb3b5b1077bcf9f30b2df11bb780d6a2ea (diff)
downloadsrc-b5019bc45b19a7bf154b3d9ca6c868dcaf8810b3.tar.gz
src-b5019bc45b19a7bf154b3d9ca6c868dcaf8810b3.zip
jail_v0.ip_number was always in host byte order. This was handled
in one of the many layers of indirection and shims through stable/7 in jail_handle_ips(). When it was cleaned up and unified through kern_jail() for 8.x, the byte order swap was lost. This only matters for ancient binaries that call jail(2) themselves internally.
Notes
Notes: svn path=/head/; revision=258718
-rw-r--r--sys/compat/freebsd32/freebsd32_misc.c2
-rw-r--r--sys/kern/kern_jail.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c
index 9a5dd4365c2d..0703fd300853 100644
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -1928,7 +1928,7 @@ freebsd32_jail(struct thread *td, struct freebsd32_jail_args *uap)
CP(j32_v0, j, version);
PTRIN_CP(j32_v0, j, path);
PTRIN_CP(j32_v0, j, hostname);
- j.ip4s = j32_v0.ip_number;
+ j.ip4s = htonl(j32_v0.ip_number); /* jail_v0 is host order */
break;
}
diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c
index 3f3ef3446cee..e5d0ad70e258 100644
--- a/sys/kern/kern_jail.c
+++ b/sys/kern/kern_jail.c
@@ -314,7 +314,7 @@ sys_jail(struct thread *td, struct jail_args *uap)
j.version = j0.version;
j.path = j0.path;
j.hostname = j0.hostname;
- j.ip4s = j0.ip_number;
+ j.ip4s = htonl(j0.ip_number); /* jail_v0 is host order */
break;
}