The original patchset changed as little as possible from the original. Whitespace fixes in particular are confusing during patch review so leave them until now. Signed-off-by: Duncan Roe <duncan_roe@xxxxxxxxxxxxxxx> --- src/libnetfilter_queue.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/libnetfilter_queue.c b/src/libnetfilter_queue.c index 56d51ca..2f50b47 100644 --- a/src/libnetfilter_queue.c +++ b/src/libnetfilter_queue.c @@ -147,11 +147,11 @@ gcc -g3 -ggdb -Wall -lmnl -lnetfilter_queue -o nf-queue nf-queue.c #define NFNL_MAX_SUBSYS 16 struct nfnl_subsys_handle { - struct nfnl_handle *nfnlh; + struct nfnl_handle *nfnlh; uint32_t subscriptions; uint8_t subsys_id; uint8_t cb_count; - struct nfnl_callback *cb; /* array of callbacks */ + struct nfnl_callback *cb; /* array of callbacks */ }; struct nfnl_handle { @@ -163,13 +163,13 @@ struct nfnl_handle { uint32_t dump; uint32_t rcv_buffer_size; /* for nfnl_catch */ uint32_t flags; - struct nlmsghdr *last_nlhdr; + struct nlmsghdr *last_nlhdr; struct nfnl_subsys_handle subsys[NFNL_MAX_SUBSYS+1]; }; /* Copy of private libmnl structure */ struct mnl_socket { - int fd; + int fd; struct sockaddr_nl addr; }; @@ -581,11 +581,13 @@ unsigned int nfnl_rcvbufsiz(const struct nfnl_handle *h, unsigned int size) /* first we try the FORCE option, which is introduced in kernel * 2.6.14 to give "root" the ability to override the system wide - * maximum */ + * maximum + */ status = setsockopt(h->fd, SOL_SOCKET, SO_RCVBUFFORCE, &size, socklen); if (status < 0) { /* if this didn't work, we try at least to get the system - * wide maximum (or whatever the user requested) */ + * wide maximum (or whatever the user requested) + */ setsockopt(h->fd, SOL_SOCKET, SO_RCVBUF, &size, socklen); } getsockopt(h->fd, SOL_SOCKET, SO_RCVBUF, &read_size, &socklen); @@ -658,7 +660,7 @@ int nfq_unbind_pf(struct nfq_handle *h, uint16_t pf) * @} */ - static int __nfq_handle_msg(const struct nlmsghdr *nlh, void *data) +static int __nfq_handle_msg(const struct nlmsghdr *nlh, void *data) { struct nfq_handle *h = data; struct nfq_q_handle *qh; @@ -959,7 +961,8 @@ static int __set_verdict(struct nfq_q_handle *qh, uint32_t id, /* Efficiency gain: when there is only 1 iov, * sendto() is faster than sendmsg() because the kernel only has - * 1 userspace address to validate instead of 2. */ + * 1 userspace address to validate instead of 2. + */ if (!data_len) return mnl_socket_sendto(qh->h->nl, nlh, nlh->nlmsg_len); { @@ -967,7 +970,7 @@ static int __set_verdict(struct nfq_q_handle *qh, uint32_t id, struct nlattr *data_attr = mnl_nlmsg_get_payload_tail(nlh); const struct msghdr msg = { .msg_name = &snl, - .msg_namelen = sizeof snl, + .msg_namelen = sizeof(snl), .msg_iov = iov, .msg_iovlen = 2, .msg_control = NULL, -- 2.35.8