forecast: Fix incompatible function types warning

This commit is contained in:
Tobias Brunner 2022-07-15 13:50:43 +02:00
parent b37a3e249a
commit 36d16e5b24

View File

@ -155,7 +155,8 @@ static bool is_bootp(void *buf, size_t len)
/** /**
* Broadcast/Multicast receiver * Broadcast/Multicast receiver
*/ */
static bool receive_casts(private_forecast_forwarder_t *this) CALLBACK(receive_casts, bool,
private_forecast_forwarder_t *this, int fd, watcher_event_t event)
{ {
struct __attribute__((packed)) { struct __attribute__((packed)) {
struct iphdr hdr; struct iphdr hdr;
@ -171,7 +172,7 @@ static bool receive_casts(private_forecast_forwarder_t *this)
socklen_t alen = sizeof(addr); socklen_t alen = sizeof(addr);
bool reinject; bool reinject;
len = recvfrom(this->kernel.pkt, &buf, sizeof(buf), MSG_DONTWAIT, len = recvfrom(fd, &buf, sizeof(buf), MSG_DONTWAIT,
(struct sockaddr*)&addr, &alen); (struct sockaddr*)&addr, &alen);
if (len < 0) if (len < 0)
{ {
@ -496,7 +497,7 @@ forecast_forwarder_t *forecast_forwarder_create(forecast_listener_t *listener)
&this->kernel.listener); &this->kernel.listener);
lib->watcher->add(lib->watcher, this->kernel.pkt, WATCHER_READ, lib->watcher->add(lib->watcher, this->kernel.pkt, WATCHER_READ,
(watcher_cb_t)receive_casts, this); receive_casts, this);
return &this->public; return &this->public;
} }