lldp: Fix DPDK build.
authorPravin B Shelar <pshelar@nicira.com>
Tue, 3 Mar 2015 22:08:58 +0000 (14:08 -0800)
committerPravin B Shelar <pshelar@nicira.com>
Wed, 4 Mar 2015 17:59:44 +0000 (09:59 -0800)
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 <pshelar@nicira.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/lldp/lldpd-structs.h
lib/lldp/lldpd.c
lib/lldp/lldpd.h
lib/ovs-lldp.c
tests/test-aa.c

index 02448a8..59d239c 100644 (file)
@@ -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>
index ded4563..7f6e348 100644 (file)
@@ -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>
index 0022467..6bd4b05 100644 (file)
@@ -20,7 +20,6 @@
 #define _LLDPD_H
 
 #ifndef _WIN32
-#include <netinet/if_ether.h>
 #include <netinet/in.h>
 #endif
 #include <stdlib.h>
index e5e20f1..a30eca5 100644 (file)
@@ -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));
     }
 }
 
index c61dade..4fb2618 100644 (file)
@@ -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 */