git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2b13d31
)
use struct tun_pi in read/write to pltap
author
Giuseppe Lettieri
<g.lettieri@iet.unipi.it>
Sat, 6 Jul 2013 17:36:10 +0000
(19:36 +0200)
committer
Giuseppe Lettieri
<g.lettieri@iet.unipi.it>
Sat, 6 Jul 2013 17:36:10 +0000
(19:36 +0200)
lib/netdev-pltap.c
patch
|
blob
|
history
diff --git
a/lib/netdev-pltap.c
b/lib/netdev-pltap.c
index
26a8a05
..
0c49265
100644
(file)
--- 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_);
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] = {
struct iovec iov[2] = {
- { .iov_base =
prefix, .iov_len = 4
},
+ { .iov_base =
&pi, .iov_len = sizeof(pi)
},
{ .iov_base = buffer, .iov_len = size }
};
for (;;) {
{ .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_);
{
struct netdev_pltap *dev =
netdev_pltap_cast(netdev_);
-
char prefix[4] = { 0, 0, 8,
6 };
+
struct tun_pi pi = { 0, 0x8
6 };
struct iovec iov[2] = {
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)
{ .iov_base = (char*) buffer, .iov_len = size }
};
if (dev->fd < 0)