[conntrack-tools PATCH 2/4] conntrack: Fix for unused assignment in do_command_ct()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The variable is overwritten immediately in the next iteration and the
loop can't exit before doing that.

Instead of dropping the assignment, one could add a return code check -
but since event_cb() never fails, that check is pointless as well.

Fixes: e0dac21ed02e3 ("conntrack: use libmnl for conntrack events")
Signed-off-by: Phil Sutter <phil@xxxxxx>
---
 src/conntrack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conntrack.c b/src/conntrack.c
index aa6323dfbd1b1..07fae3dc2ff07 100644
--- a/src/conntrack.c
+++ b/src/conntrack.c
@@ -3479,7 +3479,7 @@ static int do_command_ct(const char *progname, struct ct_cmd *cmd,
 					   strerror(errno));
 				break;
 			}
-			res = mnl_cb_run(buf, res, 0, 0, event_cb, cmd);
+			mnl_cb_run(buf, res, 0, 0, event_cb, cmd);
 		}
 		mnl_socket_close(event_sock->mnl);
 		break;
-- 
2.38.0




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux