]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
output: IPFIX: correct format specifiers
authorJeremy Sowden <jeremy@azazel.net>
Sun, 21 Nov 2021 20:41:39 +0000 (20:41 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 23 Nov 2021 13:24:53 +0000 (14:24 +0100)
There are a couple of logging calls which use the wrong specifiers for
their integer arguments.  Change the specifiers to match the arguments.

Use the correct type for the variable holding the return-value of
`send(2)`.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
output/ipfix/ulogd_output_IPFIX.c

index 5b59003638531f522021ed960d948dfb58dd4835..4863d008562e4da7572ed7516b5eee1daf219a0b 100644 (file)
@@ -198,7 +198,8 @@ static int send_msgs(struct ulogd_pluginstance *pi)
        struct ipfix_priv *priv = (struct ipfix_priv *) &pi->private;
        struct llist_head *curr, *tmp;
        struct ipfix_msg *msg;
-       int ret = ULOGD_IRET_OK, sent;
+       int ret = ULOGD_IRET_OK;
+       ssize_t sent;
 
        llist_for_each_prev(curr, &priv->list) {
                msg = llist_entry(curr, struct ipfix_msg, link);
@@ -212,8 +213,8 @@ static int send_msgs(struct ulogd_pluginstance *pi)
 
                /* TODO handle short send() for other protocols */
                if ((size_t) sent < ipfix_msg_len(msg))
-                       ulogd_log(ULOGD_ERROR, "short send: %d < %d\n",
-                                       sent, ipfix_msg_len(msg));
+                       ulogd_log(ULOGD_ERROR, "short send: %zd < %zu\n",
+                                 sent, ipfix_msg_len(msg));
        }
 
        llist_for_each_safe(curr, tmp, &priv->list) {
@@ -242,7 +243,7 @@ static int ipfix_ufd_cb(int fd, unsigned what, void *arg)
                        ulogd_log(ULOGD_INFO, "connection reset by peer\n");
                        ulogd_unregister_fd(&priv->ufd);
                } else
-                       ulogd_log(ULOGD_INFO, "unexpected data (%d bytes)\n", nread);
+                       ulogd_log(ULOGD_INFO, "unexpected data (%zd bytes)\n", nread);
        }
 
        return 0;