Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/sys



Module Name:    src
Committed By:   bouyer
Date:           Tue Aug 30 14:22:22 UTC 2011

Modified Files:
        src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h
        src/sys/net: bpf.c bpf.h bpfdesc.h

Log Message:
Provide netbsd32 compat for bpf. Beside the ioctls, the structure
returned to userland by read(2) also needs to be converted.
For this, the bpf descriptor is flagged as compat32 (or not) in the
open and ioctl functions (where the user process's pid is also updated
in the descriptor). When the bpf buffer is filled in, the 32bits or native
header is used depending on the information stored in the descriptor.

This won't work if a 64bit binary does the open and ioctls, and then
exec a 32bit program which will do the read. But this is very
unlikely to happen in real life ...

Tested on i386 and loongson; with these changes my loongson can run
dhclient and tcpdump with a n32 userland.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.38 -r1.39 src/sys/compat/netbsd32/netbsd32_ioctl.h
cvs rdiff -u -r1.165 -r1.166 src/sys/net/bpf.c
cvs rdiff -u -r1.57 -r1.58 src/sys/net/bpf.h
cvs rdiff -u -r1.32 -r1.33 src/sys/net/bpfdesc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index