From 09c28fa3210affd9ca79303348aaa502f5821139 Mon Sep 17 00:00:00 2001 From: Pravin B Shelar Date: Tue, 3 Mar 2015 14:08:58 -0800 Subject: [PATCH] lldp: Fix DPDK build. Fixes following dp-packet access. Removes netinet/if_ether.h include due to duplicate definition of ether_addr. ------ 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 Acked-by: Daniele Di Proietto Acked-by: Ben Pfaff --- 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 02448a8a7..59d239c3e 100644 --- a/lib/lldp/lldpd-structs.h +++ b/lib/lldp/lldpd-structs.h @@ -22,7 +22,6 @@ #include #ifndef _WIN32 #include -#include #endif #include #include diff --git a/lib/lldp/lldpd.c b/lib/lldp/lldpd.c index ded456340..7f6e348b0 100644 --- a/lib/lldp/lldpd.c +++ b/lib/lldp/lldpd.c @@ -34,7 +34,6 @@ #ifndef _WIN32 #include #include -#include #include #include #include diff --git a/lib/lldp/lldpd.h b/lib/lldp/lldpd.h index 00224679c..6bd4b055c 100644 --- a/lib/lldp/lldpd.h +++ b/lib/lldp/lldpd.h @@ -20,7 +20,6 @@ #define _LLDPD_H #ifndef _WIN32 -#include #include #endif #include diff --git a/lib/ovs-lldp.c b/lib/ovs-lldp.c index e5e20f197..a30eca59a 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 c61dade51..4fb26188f 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 */ -- 2.20.1