ETH_P_LLDP is defined in linux/if_ether.h.
#define LOOPBACK_IFINDEX 1
#endif
-/* Not exposed yet. Similar values are defined in net/ethernet.h */
-#ifndef ETHERTYPE_LLDP
-#define ETHERTYPE_LLDP 0x88cc
-#endif
-
/* Not exposed but defined in linux/netdevice.h */
#ifndef MAX_PHYS_ITEM_ID_LEN
#define MAX_PHYS_ITEM_ID_LEN 32
#include "lldp-neighbor.h"
#include "lldp-rx-internal.h"
#include "memory-util.h"
-#include "missing_network.h"
#include "prioq.h"
#include "siphash24.h"
#include "unaligned.h"
memcpy(&h, LLDP_NEIGHBOR_RAW(n), sizeof(h));
- if (h.ether_type != htobe16(ETHERTYPE_LLDP))
+ if (h.ether_type != htobe16(ETH_P_LLDP))
return log_lldp_rx_errno(n->lldp_rx, SYNTHETIC_ERRNO(EBADMSG),
"Received packet with wrong type, ignoring.");
#include "fd-util.h"
#include "lldp-network.h"
-#include "missing_network.h"
#include "socket-util.h"
int lldp_network_bind_raw_socket(int ifindex) {
BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 0x000e, 1, 0), /* A != 00:0e */
BPF_STMT(BPF_RET + BPF_K, 0), /* drop packet */
BPF_STMT(BPF_LD + BPF_H + BPF_ABS, offsetof(struct ethhdr, h_proto)), /* A <- protocol */
- BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, ETHERTYPE_LLDP, 1, 0), /* A != ETHERTYPE_LLDP */
+ BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, ETH_P_LLDP, 1, 0), /* A != ETH_P_LLDP */
BPF_STMT(BPF_RET + BPF_K, 0), /* drop packet */
BPF_STMT(BPF_RET + BPF_K, UINT32_MAX), /* accept packet */
};
assert(ifindex > 0);
fd = socket(AF_PACKET, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK,
- htobe16(ETHERTYPE_LLDP));
+ htobe16(ETH_P_LLDP));
if (fd < 0)
return -errno;
return -ENOMEM;
header = (struct ether_header*) packet;
- header->ether_type = htobe16(ETHERTYPE_LLDP);
+ header->ether_type = htobe16(ETH_P_LLDP);
memcpy(header->ether_dhost, lldp_multicast_addr + lldp_tx->mode, ETH_ALEN);
memcpy(header->ether_shost, &lldp_tx->hwaddr, ETH_ALEN);
sa = (union sockaddr_union) {
.ll.sll_family = AF_PACKET,
- .ll.sll_protocol = htobe16(ETHERTYPE_LLDP),
+ .ll.sll_protocol = htobe16(ETH_P_LLDP),
.ll.sll_ifindex = lldp_tx->ifindex,
.ll.sll_halen = ETH_ALEN,
};