Skip to contentSkip to conversation

Corrects small word-size dependency in exposed kernel structure

PATCH New Marc A. Pelletier 1 participant 1 message May 11, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Corrects small word-size dependency in exposed kernel structure

Corrects a small word-size dependency in an exposed kernel structure so that mmaped packet sockets will work correctly from 32-bit userspace on a 64-bit kernel.

---

As an aside, I've considered changing the setsockopt() for that feature so that it returns critical values back to userspace (stride between frames, actual offsets of substructures) rather than needing userspace to guess them, but that can't be done without

(a) breaking current users of PACKET_RX_RING; or
(b) adding a new setsockopt.

Which is best?

Also, I have a couple of sanity fixes for the ring packet implementation I'd like to discuss. Anyone specific maintaining that bit of code?

-- Marc A. Pelletier

include/linux/if_packet.h 2007-05-10 14:27:50 -0400 renamed from include/linux/if_packet.h 2007-05-10 14:27:49 -0400 +1 -1
@@ -50,7 +50,7 @@
 
 struct tpacket_hdr
 {
-       unsigned long   tp_status;
+       unsigned int    tp_status;
 #define TP_STATUS_KERNEL       0
 #define TP_STATUS_USER         1
 #define TP_STATUS_COPY         2