]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
forecast: Fix incompatible function types warning
authorTobias Brunner <tobias@strongswan.org>
Fri, 15 Jul 2022 11:50:43 +0000 (13:50 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 18 Jul 2022 10:42:24 +0000 (12:42 +0200)
src/libcharon/plugins/forecast/forecast_forwarder.c

index f24019e0a38df78df6bb2ffc68e6d3d5685fbe45..0fd199b36d48d3b56dbeda6f4da22ffdd903b171 100644 (file)
@@ -155,7 +155,8 @@ static bool is_bootp(void *buf, size_t len)
 /**
  * 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 iphdr hdr;
@@ -171,7 +172,7 @@ static bool receive_casts(private_forecast_forwarder_t *this)
        socklen_t alen = sizeof(addr);
        bool reinject;
 
-       len = recvfrom(this->kernel.pkt, &buf, sizeof(buf), MSG_DONTWAIT,
+       len = recvfrom(fd, &buf, sizeof(buf), MSG_DONTWAIT,
                                   (struct sockaddr*)&addr, &alen);
        if (len < 0)
        {
@@ -496,7 +497,7 @@ forecast_forwarder_t *forecast_forwarder_create(forecast_listener_t *listener)
                                                                                   &this->kernel.listener);
 
        lib->watcher->add(lib->watcher, this->kernel.pkt, WATCHER_READ,
-                                         (watcher_cb_t)receive_casts, this);
+                                         receive_casts, this);
 
        return &this->public;
 }