Patchwork [3/3] conntrack: do not exit when update returns an error

login
register
mail settings
Submitter Florian Westphal
Date Sept. 5, 2013, 9:27 a.m.
Message ID <1378373270-6914-3-git-send-email-fw@strlen.de>
Download mbox | patch
Permalink /patch/272839/
State Accepted
Commit fee95ed0db0745b551dfb15c58800da5c1ca9e5f
Headers show

Comments

Florian Westphal - Sept. 5, 2013, 9:27 a.m.
If we fail to update an entry, just try to continue with the next one
instead of exiting.

Can happen f.e. when using "conntrack -U --add-label bla", but the
conntrack entry in the kernel does not have the label extension set.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 src/conntrack.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

Patch

diff --git a/src/conntrack.c b/src/conntrack.c
index 404ecc9..1e45ca8 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -1492,12 +1492,10 @@  static int update_cb(enum nf_conntrack_msg_type type,
 	}
 
 	res = nfct_query(ith, NFCT_Q_UPDATE, tmp);
-	if (res < 0) {
-		nfct_destroy(tmp);
-		exit_error(OTHER_PROBLEM,
-			   "Operation failed: %s",
+	if (res < 0)
+		fprintf(stderr,
+			   "Operation failed: %s\n",
 			   err2str(errno, CT_UPDATE));
-	}
 	nfct_callback_register(ith, NFCT_T_ALL, print_cb, NULL);
 
 	res = nfct_query(ith, NFCT_Q_GET, tmp);