The packetsocket fanout test uses a packet ring. Use TPACKET_V2
instead of TPACKET_V1 to work around a known 32/64 bit issue in
the older ring that manifests on sparc64.
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
.tp_frame_nr = RING_NUM_FRAMES,
};
char *ring;
.tp_frame_nr = RING_NUM_FRAMES,
};
char *ring;
+ if (setsockopt(fd, SOL_PACKET, PACKET_VERSION, (void *) &val,
+ sizeof(val))) {
+ perror("packetsock ring setsockopt version");
+ exit(1);
+ }
if (setsockopt(fd, SOL_PACKET, PACKET_RX_RING, (void *) &req,
sizeof(req))) {
perror("packetsock ring setsockopt");
if (setsockopt(fd, SOL_PACKET, PACKET_RX_RING, (void *) &req,
sizeof(req))) {
perror("packetsock ring setsockopt");
static int sock_fanout_read_ring(int fd, void *ring)
{
static int sock_fanout_read_ring(int fd, void *ring)
{
- struct tpacket_hdr *header = ring;
+ struct tpacket2_hdr *header = ring;
int count = 0;
while (header->tp_status & TP_STATUS_USER && count < RING_NUM_FRAMES) {
int count = 0;
while (header->tp_status & TP_STATUS_USER && count < RING_NUM_FRAMES) {