#ifndef __linux__
#include <pcap.h>
+
+/* Old versions of PCAP defined it as D_IN */
+#ifndef PCAP_D_IN
+#define PCAP_D_IN D_IN
+#endif
+
#endif
#include <avahi-common/malloc.h>
#include "main.h"
#include "iface.h"
+
+
/* An implementation of RFC 3927 */
/* Constants from the RFC */
sa.sll_halen = ETHER_ADDRLEN;
memset(sa.sll_addr, 0xFF, ETHER_ADDRLEN);
- if (sendto(fd, packet, packet_len, 0, (struct sockaddr*) &sa, sizeof(sa)) < 0) {
+ if (sendto(fd, packet->ether_payload, packet_len, 0, (struct sockaddr*) &sa, sizeof(sa)) < 0) {
daemon_log(LOG_ERR, "sendto() failed: %s", strerror(errno));
return -1;
}
FD_ARP,
FD_IFACE,
FD_SIGNAL,
- FD_MAX,
+ FD_MAX
};
int fd = -1, ret = -1;