Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157810617
D56399.id175582.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D56399.id175582.diff
View Options
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -1201,7 +1201,7 @@
case BIOCGDLTLIST32:
case BIOCGRTIMEOUT32:
case BIOCSRTIMEOUT32:
- if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) {
+ if (SV_CURPROC_FLAG(SV_ILP32)) {
BPFD_LOCK(d);
d->bd_compat32 = 1;
BPFD_UNLOCK(d);
@@ -1209,6 +1209,14 @@
}
#endif
+#if defined(COMPAT_FREEBSD32)
+ if (SV_CURPROC_FLAG(SV_ILP32)) {
+ if (cmd == BIOCSRTIMEOUT32)
+ cmd = BIOCSRTIMEOUT;
+ if (cmd == BIOCGRTIMEOUT32)
+ cmd = BIOCGRTIMEOUT;
+ }
+#endif
CURVNET_SET(TD_TO_VNET(td));
switch (cmd) {
default:
@@ -1419,23 +1427,19 @@
* Set read timeout.
*/
case BIOCSRTIMEOUT:
-#if defined(COMPAT_FREEBSD32) && defined(__amd64__)
- case BIOCSRTIMEOUT32:
-#endif
{
struct timeval *tv = (struct timeval *)addr;
-#if defined(COMPAT_FREEBSD32)
+#ifdef COMPAT_FREEBSD32
struct timeval32 *tv32;
struct timeval tv64;
- if (cmd == BIOCSRTIMEOUT32) {
+ if (SV_CURPROC_FLAG(SV_ILP32)) {
tv32 = (struct timeval32 *)addr;
tv = &tv64;
tv->tv_sec = tv32->tv_sec;
tv->tv_usec = tv32->tv_usec;
- } else
+ }
#endif
- tv = (struct timeval *)addr;
/*
* Subtract 1 tick from tvtohz() since this isn't
@@ -1450,31 +1454,24 @@
* Get read timeout.
*/
case BIOCGRTIMEOUT:
-#if defined(COMPAT_FREEBSD32) && defined(__amd64__)
- case BIOCGRTIMEOUT32:
-#endif
{
- struct timeval *tv;
-#if defined(COMPAT_FREEBSD32) && defined(__amd64__)
+ struct timeval *tv = (struct timeval *)addr;
+#ifdef COMPAT_FREEBSD32
struct timeval32 *tv32;
struct timeval tv64;
- if (cmd == BIOCGRTIMEOUT32)
+ if (SV_CURPROC_FLAG(SV_ILP32))
tv = &tv64;
- else
#endif
- tv = (struct timeval *)addr;
-
tv->tv_sec = d->bd_rtout / hz;
tv->tv_usec = (d->bd_rtout % hz) * tick;
-#if defined(COMPAT_FREEBSD32) && defined(__amd64__)
- if (cmd == BIOCGRTIMEOUT32) {
+#ifdef COMPAT_FREEBSD32
+ if (SV_CURPROC_FLAG(SV_ILP32)) {
tv32 = (struct timeval32 *)addr;
tv32->tv_sec = tv->tv_sec;
tv32->tv_usec = tv->tv_usec;
}
#endif
-
break;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 26, 11:00 AM (55 m, 16 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31612886
Default Alt Text
D56399.id175582.diff (2 KB)
Attached To
Mode
D56399: bpf: fix setting read timeout on ppc64
Attached
Detach File
Event Timeline
Log In to Comment