Commit 5884ef61 authored by Adam Wujek's avatar Adam Wujek 💬 Committed by Grzegorz Daniluk

lib/lldp: fix formating

Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent c81b799e
......@@ -17,6 +17,7 @@
#include "endpoint.h"
#include "ipv4.h"
#include "shell.h"
#include <wrpc.h> /*needed for htons()*/
static char lldpdu[LLDP_PKT_LEN];
static uint16_t lldpdu_len;
......@@ -38,10 +39,6 @@ static void lldp_header_tlv(int tlv_type) {
lldpdu_len += LLDP_HEADER;
}
#ifndef htons
#define htons(x) x
#endif
static void lldp_add_tlv(int tlv_type) {
unsigned char mac[6];
......@@ -169,7 +166,7 @@ static void lldp_poll(void)
/* periodic tasks */
if (ticks > LLDP_TX_FQ) {
if (HAS_IP & (ip_status != IP_TRAINING)) {
if (HAS_IP && (ip_status != IP_TRAINING)) {
lldp_add_tlv(PORT);
/* update other dynamic TLVs */
}
......@@ -177,9 +174,9 @@ static void lldp_poll(void)
ptpd_netif_sendto(lldp_socket, &addr, lldpdu, LLDP_PKT_LEN, 0);
ticks = 0;
}
else
} else {
ticks += 1;
}
}
DEFINE_WRC_TASK(lldp) = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment