From: Giuseppe Lettieri <g.lettieri@iet.unipi.it>
Date: Sat, 6 Jul 2013 17:36:10 +0000 (+0200)
Subject: use struct tun_pi in read/write to pltap
X-Git-Tag: sliver-openvswitch-1.10.90-3~1
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=f196cf974f8df3afdeb56ea58d34e6a9e741663d;p=sliver-openvswitch.git

use struct tun_pi in read/write to pltap
---

diff --git a/lib/netdev-pltap.c b/lib/netdev-pltap.c
index 26a8a05a1..0c492650a 100644
--- a/lib/netdev-pltap.c
+++ b/lib/netdev-pltap.c
@@ -456,9 +456,9 @@ static int
 netdev_rx_pltap_recv(struct netdev_rx *rx_, void *buffer, size_t size)
 {
     struct netdev_rx_pltap *rx = netdev_rx_pltap_cast(rx_);
-    char prefix[4];
+    struct tun_pi pi;
     struct iovec iov[2] = {
-        { .iov_base = prefix, .iov_len = 4 },
+        { .iov_base = &pi, .iov_len = sizeof(pi) },
 	{ .iov_base = buffer, .iov_len = size }
     };
     for (;;) {
@@ -496,9 +496,9 @@ netdev_pltap_send(struct netdev *netdev_, const void *buffer, size_t size)
 {
     struct netdev_pltap *dev = 
     	netdev_pltap_cast(netdev_);
-    char prefix[4] = { 0, 0, 8, 6 };
+    struct tun_pi pi = { 0, 0x86 };
     struct iovec iov[2] = {
-        { .iov_base = prefix, .iov_len = 4 },
+        { .iov_base = &pi, .iov_len = sizeof(pi) },
 	{ .iov_base = (char*) buffer, .iov_len = size }
     };
     if (dev->fd < 0)