Fixes dp-packet access. Removes netinet/if_ether.h
include due to duplicate definition of ether_addr error.
------
In file included from /usr/include/netinet/if_ether.h:60:0,
from lib/lldp/lldpd.h:23,
from lib/ovs-lldp.h:26,
from lib/ovs-lldp.c:30:
/usr/include/net/ethernet.h: At top level:
/usr/include/net/ethernet.h:32:8: error: redefinition of 'struct
ether_addr'
struct ether_addr
^
In file included from
../dpdk/dpdk/x86_64-native-linuxapp-gcc/include/rte_ethdev.h:179:0,
from lib/netdev-dpdk.h:18,
from lib/dp-packet.h:25,
from lib/ovs-lldp.h:23,
from lib/ovs-lldp.c:30:
../dpdk/dpdk/x86_64-native-linuxapp-gcc/include/rte_ether.h:83:8: note:
originally defined here
struct ether_addr {
^
lib/ovs-lldp.c: In function 'lldp_process_packet':
lib/ovs-lldp.c:676:30: error: 'const struct dp_packet' has no member
named 'data_'
(char *) p->data_, p->size_);
^
lib/ovs-lldp.c:676:40: error: 'const struct dp_packet' has no member
named 'size_'
(char *) p->data_, p->size_);
------
Signed-off-by: Pravin B Shelar <[email protected]>
---
lib/lldp/lldpd-structs.h | 1 -
lib/lldp/lldpd.c | 1 -
lib/lldp/lldpd.h | 1 -
lib/ovs-lldp.c | 2 +-
tests/test-aa.c | 4 ++--
5 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/lib/lldp/lldpd-structs.h b/lib/lldp/lldpd-structs.h
index 02448a8..59d239c 100644
--- a/lib/lldp/lldpd-structs.h
+++ b/lib/lldp/lldpd-structs.h
@@ -22,7 +22,6 @@
#include <net/if.h>
#ifndef _WIN32
#include <netinet/in.h>
-#include <netinet/if_ether.h>
#endif
#include <sys/socket.h>
#include <sys/types.h>
diff --git a/lib/lldp/lldpd.c b/lib/lldp/lldpd.c
index ded4563..7f6e348 100644
--- a/lib/lldp/lldpd.c
+++ b/lib/lldp/lldpd.c
@@ -34,7 +34,6 @@
#ifndef _WIN32
#include <grp.h>
#include <libgen.h>
-#include <netinet/if_ether.h>
#include <pwd.h>
#include <sys/select.h>
#include <sys/utsname.h>
diff --git a/lib/lldp/lldpd.h b/lib/lldp/lldpd.h
index 0022467..6bd4b05 100644
--- a/lib/lldp/lldpd.h
+++ b/lib/lldp/lldpd.h
@@ -20,7 +20,6 @@
#define _LLDPD_H
#ifndef _WIN32
-#include <netinet/if_ether.h>
#include <netinet/in.h>
#endif
#include <stdlib.h>
diff --git a/lib/ovs-lldp.c b/lib/ovs-lldp.c
index e5e20f1..a30eca5 100644
--- a/lib/ovs-lldp.c
+++ b/lib/ovs-lldp.c
@@ -673,7 +673,7 @@ lldp_process_packet(struct lldp *lldp, const struct
dp_packet *p)
{
if (lldp) {
lldpd_recv(lldp->lldpd, lldpd_first_hardware(lldp->lldpd),
- (char *) p->data_, p->size_);
+ (char *) dp_packet_data(p), dp_packet_size(p));
}
}
diff --git a/tests/test-aa.c b/tests/test-aa.c
index c61dade..4fb2618 100644
--- a/tests/test-aa.c
+++ b/tests/test-aa.c
@@ -177,7 +177,7 @@ test_aa_send(void)
/* Local chassis info */
chassis.c_id_subtype = LLDP_CHASSISID_SUBTYPE_LLADDR;
chassis.c_id = chassis_mac;
- chassis.c_id_len = ETHER_ADDR_LEN;
+ chassis.c_id_len = ETH_ADDR_LEN;
chassis.c_name = "Dummy chassis";
chassis.c_descr = "Long dummy chassis description";
chassis.c_cap_available = LLDP_CAP_BRIDGE;
@@ -272,7 +272,7 @@ test_aa_send(void)
}
/* Decode the constructed LLDPPDU */
- assert(lldp_decode(NULL, packet.data_, packet.size_, hw,
+ assert(lldp_decode(NULL, dp_packet_data(&packet), dp_packet_size(&packet),
hw,
&nchassis, &nport) != -1);
/* Expecting returned pointers to allocated structures */
--
1.7.1
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev