From f196cf974f8df3afdeb56ea58d34e6a9e741663d Mon Sep 17 00:00:00 2001 From: Giuseppe Lettieri Date: Sat, 6 Jul 2013 19:36:10 +0200 Subject: [PATCH] use struct tun_pi in read/write to pltap --- lib/netdev-pltap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) -- 2.43.0