From: Vincent Bernat Date: Tue, 7 Jul 2009 07:38:53 +0000 (+0200) Subject: Fix compilation issues when DOT1 or DOT3 are not enabled. X-Git-Tag: 0.5.0~56 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7a00807502e7c7e477c430bf33bc17c096fb5e03;p=thirdparty%2Flldpd.git Fix compilation issues when DOT1 or DOT3 are not enabled. --- diff --git a/src/edp.c b/src/edp.c index 7a628b9d..47f9d81b 100644 --- a/src/edp.c +++ b/src/edp.c @@ -228,7 +228,7 @@ edp_decode(struct lldpd *cfg, char *frame, int s, struct lldpd_chassis **newchassis, struct lldpd_port **newport) { struct lldpd_chassis *chassis; - struct lldpd_port *port, *oport; + struct lldpd_port *port; #ifdef ENABLE_DOT1 struct lldpd_vlan *lvlan = NULL, *lvlan_next; #endif @@ -237,7 +237,10 @@ edp_decode(struct lldpd *cfg, char *frame, int s, int edp_port, edp_slot; u_int8_t *pos, *pos_edp, *tlv; u_int8_t version[4]; +#ifdef ENABLE_DOT1 struct in_addr address; + struct lldpd_port *oport; +#endif if ((chassis = calloc(1, sizeof(struct lldpd_chassis))) == NULL) { LLOG_WARN("failed to allocate remote chassis"); diff --git a/src/interfaces.c b/src/interfaces.c index 009fabad..046aa03a 100644 --- a/src/interfaces.c +++ b/src/interfaces.c @@ -74,8 +74,10 @@ extern unsigned int if_nametoindex (__const char *__ifname) __THROW; extern char *if_indextoname (unsigned int __ifindex, char *__ifname) __THROW; static int iface_is_bridge(struct lldpd *, const char *); +#ifdef ENABLE_DOT1 static int iface_is_bridged_to(struct lldpd *, const char *, const char *); +#endif static int iface_is_wireless(struct lldpd *, const char *); static int iface_is_vlan(struct lldpd *, const char *); static int iface_is_bond(struct lldpd *, const char *); @@ -159,6 +161,7 @@ iface_is_bridge(struct lldpd *cfg, const char *name) return 1; } +#ifdef ENABLE_DOT1 static int old_iface_is_bridged_to(struct lldpd *cfg, const char *slave, const char *master) { @@ -205,6 +208,7 @@ iface_is_bridged_to(struct lldpd *cfg, const char *slave, const char *master) close(f); return 1; } +#endif static int iface_is_vlan(struct lldpd *cfg, const char *name) @@ -896,7 +900,9 @@ lldpd_ifh_bond(struct lldpd *cfg, struct ifaddrs *ifap) iface_port_name_desc(hardware); /* Fill additional info */ +#ifdef ENABLE_DOT3 port->p_aggregid = master; +#endif iface_macphy(hardware); iface_mtu(cfg, hardware); }