summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/nfct-mnl-create.c6
-rw-r--r--examples/nfct-mnl-del.c6
-rw-r--r--examples/nfct-mnl-get.c6
-rw-r--r--examples/nfct-mnl-set-label.c7
-rw-r--r--src/conntrack/build_mnl.c5
5 files changed, 22 insertions, 8 deletions
diff --git a/examples/nfct-mnl-create.c b/examples/nfct-mnl-create.c
index 64387a7..7fd224d 100644
--- a/examples/nfct-mnl-create.c
+++ b/examples/nfct-mnl-create.c
@@ -60,7 +60,11 @@ int main(void)
nfct_set_attr_u8(ct, ATTR_TCP_STATE, TCP_CONNTRACK_SYN_SENT);
nfct_set_attr_u32(ct, ATTR_TIMEOUT, 100);
- nfct_nlmsg_build(nlh, ct);
+ ret = nfct_nlmsg_build(nlh, ct);
+ if (ret == -1) {
+ perror("nfct_nlmsg_build");
+ exit(EXIT_FAILURE);
+ }
ret = mnl_socket_sendto(nl, nlh, nlh->nlmsg_len);
if (ret == -1) {
diff --git a/examples/nfct-mnl-del.c b/examples/nfct-mnl-del.c
index 91ad9e4..806d9f8 100644
--- a/examples/nfct-mnl-del.c
+++ b/examples/nfct-mnl-del.c
@@ -55,7 +55,11 @@ int main(void)
nfct_set_attr_u16(ct, ATTR_PORT_SRC, htons(20));
nfct_set_attr_u16(ct, ATTR_PORT_DST, htons(10));
- nfct_nlmsg_build(nlh, ct);
+ ret = nfct_nlmsg_build(nlh, ct);
+ if (ret == -1) {
+ perror("nfct_nlmsg_build");
+ exit(EXIT_FAILURE);
+ }
ret = mnl_socket_sendto(nl, nlh, nlh->nlmsg_len);
if (ret == -1) {
diff --git a/examples/nfct-mnl-get.c b/examples/nfct-mnl-get.c
index 4858acf..5be3331 100644
--- a/examples/nfct-mnl-get.c
+++ b/examples/nfct-mnl-get.c
@@ -74,7 +74,11 @@ int main(void)
nfct_set_attr_u16(ct, ATTR_PORT_SRC, htons(20));
nfct_set_attr_u16(ct, ATTR_PORT_DST, htons(10));
- nfct_nlmsg_build(nlh, ct);
+ ret = nfct_nlmsg_build(nlh, ct);
+ if (ret == -1) {
+ perror("nfct_nlmsg_build");
+ exit(EXIT_FAILURE);
+ }
ret = mnl_socket_sendto(nl, nlh, nlh->nlmsg_len);
if (ret == -1) {
diff --git a/examples/nfct-mnl-set-label.c b/examples/nfct-mnl-set-label.c
index c52b267..50bebb0 100644
--- a/examples/nfct-mnl-set-label.c
+++ b/examples/nfct-mnl-set-label.c
@@ -19,6 +19,7 @@ static void set_label(struct nf_conntrack *ct, struct callback_args *cbargs)
char buf[MNL_SOCKET_BUFFER_SIZE];
struct nlmsghdr *nlh;
struct nfgenmsg *nfh;
+ int ret;
if (b) {
if (bit < 0)
@@ -55,7 +56,11 @@ static void set_label(struct nf_conntrack *ct, struct callback_args *cbargs)
nfh->version = NFNETLINK_V0;
nfh->res_id = 0;
- nfct_nlmsg_build(nlh, ct);
+ ret = nfct_nlmsg_build(nlh, ct);
+ if (ret == -1) {
+ perror("nfct_nlmsg_build");
+ exit(EXIT_FAILURE);
+ }
if (mnl_socket_sendto(cbargs->nl, nlh, nlh->nlmsg_len) < 0)
perror("mnl_socket_sendto");
diff --git a/src/conntrack/build_mnl.c b/src/conntrack/build_mnl.c
index d9ad268..0067a1c 100644
--- a/src/conntrack/build_mnl.c
+++ b/src/conntrack/build_mnl.c
@@ -496,10 +496,7 @@ nfct_nlmsg_build(struct nlmsghdr *nlh, const struct nf_conntrack *ct)
test_bit(ATTR_REPL_PORT_DST, ct->head.set) ||
test_bit(ATTR_REPL_L3PROTO, ct->head.set) ||
test_bit(ATTR_REPL_L4PROTO, ct->head.set) ||
- test_bit(ATTR_REPL_ZONE, ct->head.set) ||
- test_bit(ATTR_ICMP_TYPE, ct->head.set) ||
- test_bit(ATTR_ICMP_CODE, ct->head.set) ||
- test_bit(ATTR_ICMP_ID, ct->head.set)) {
+ test_bit(ATTR_REPL_ZONE, ct->head.set)) {
const struct __nfct_tuple *t = &ct->repl;
struct nlattr *nest;