Skip to content

Commit

Permalink
macvtap: drop broken IFF_VNET_LE
Browse files Browse the repository at this point in the history
Use TUNSETVNETLE/TUNGETVNETLE instead.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michael S. Tsirkin authored and David S. Miller committed Dec 16, 2014
1 parent 1cf8e41 commit 01b07fb
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions drivers/net/macvtap.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,18 @@ struct macvtap_queue {
struct list_head next;
};

#define MACVTAP_FEATURES (IFF_VNET_HDR | IFF_VNET_LE | IFF_MULTI_QUEUE)
#define MACVTAP_FEATURES (IFF_VNET_HDR | IFF_MULTI_QUEUE)

#define MACVTAP_VNET_LE 0x80000000

static inline u16 macvtap16_to_cpu(struct macvtap_queue *q, __virtio16 val)
{
return __virtio16_to_cpu(q->flags & IFF_VNET_LE, val);
return __virtio16_to_cpu(q->flags & MACVTAP_VNET_LE, val);
}

static inline __virtio16 cpu_to_macvtap16(struct macvtap_queue *q, u16 val)
{
return __cpu_to_virtio16(q->flags & IFF_VNET_LE, val);
return __cpu_to_virtio16(q->flags & MACVTAP_VNET_LE, val);
}

static struct proto macvtap_proto = {
Expand Down Expand Up @@ -1070,6 +1072,21 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd,
q->vnet_hdr_sz = s;
return 0;

case TUNGETVNETLE:
s = !!(q->flags & MACVTAP_VNET_LE);
if (put_user(s, sp))
return -EFAULT;
return 0;

case TUNSETVNETLE:
if (get_user(s, sp))
return -EFAULT;
if (s)
q->flags |= MACVTAP_VNET_LE;
else
q->flags &= ~MACVTAP_VNET_LE;
return 0;

case TUNSETOFFLOAD:
/* let the user check for future flags */
if (arg & ~(TUN_F_CSUM | TUN_F_TSO4 | TUN_F_TSO6 |
Expand Down

0 comments on commit 01b07fb

Please sign in to comment.