Author: peter
Date: Thu Nov 28 19:40:33 2013
New Revision: 258718
URL: http://svnweb.freebsd.org/changeset/base/258718

Log:
  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.

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/kern/kern_jail.c

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_misc.c  Thu Nov 28 19:37:22 2013        
(r258717)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Thu Nov 28 19:40:33 2013        
(r258718)
@@ -1928,7 +1928,7 @@ freebsd32_jail(struct thread *td, struct
                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;
        }
 

Modified: head/sys/kern/kern_jail.c
==============================================================================
--- head/sys/kern/kern_jail.c   Thu Nov 28 19:37:22 2013        (r258717)
+++ head/sys/kern/kern_jail.c   Thu Nov 28 19:40:33 2013        (r258718)
@@ -314,7 +314,7 @@ sys_jail(struct thread *td, struct jail_
                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;
        }
 
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to