summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2014-01-09 18:55:50 +0000
committerPatrick McHardy <kaber@trash.net>2014-01-09 18:55:50 +0000
commit01cd6fa3cce3517f92a16151d94e4ce35542e88c (patch)
treecd78851d10e3f409c297c9b7710d9c5492de3357 /src
parent87787ee86ec95a8a5494615268a03a756f48433f (diff)
parentf930cc50031851c6975058e33408214ad0c240b6 (diff)
Merge remote-tracking branch 'origin/master' into next-3.14
Diffstat (limited to 'src')
-rw-r--r--src/main.c12
-rw-r--r--src/mnl.c8
2 files changed, 13 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c
index 859ddaac..33a02e1a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -160,9 +160,10 @@ static int nft_netlink(struct parser_state *state, struct list_head *msgs)
struct cmd *cmd, *next;
struct mnl_err *err, *tmp;
LIST_HEAD(err_list);
+ uint32_t batch_seqnum;
int ret = 0;
- mnl_batch_begin();
+ batch_seqnum = mnl_batch_begin();
list_for_each_entry(cmd, &state->cmds, list) {
memset(&ctx, 0, sizeof(ctx));
ctx.msgs = msgs;
@@ -183,12 +184,15 @@ static int nft_netlink(struct parser_state *state, struct list_head *msgs)
list_for_each_entry_safe(err, tmp, &err_list, head) {
list_for_each_entry(cmd, &state->cmds, list) {
- if (err->seqnum == cmd->seqnum) {
+ if (err->seqnum == cmd->seqnum ||
+ err->seqnum == batch_seqnum) {
netlink_io_error(&ctx, &cmd->location,
"Could not process rule in batch: %s",
strerror(err->err));
- mnl_err_list_free(err);
- break;
+ if (err->seqnum == cmd->seqnum) {
+ mnl_err_list_free(err);
+ break;
+ }
}
}
}
diff --git a/src/mnl.c b/src/mnl.c
index a711b5e2..a4a4c4af 100644
--- a/src/mnl.c
+++ b/src/mnl.c
@@ -106,7 +106,7 @@ static void mnl_batch_page_add(void)
batch = mnl_batch_alloc();
}
-static void mnl_batch_put(int type)
+static uint32_t mnl_batch_put(int type)
{
struct nlmsghdr *nlh;
struct nfgenmsg *nfg;
@@ -123,11 +123,13 @@ static void mnl_batch_put(int type)
if (!mnl_nlmsg_batch_next(batch))
mnl_batch_page_add();
+
+ return nlh->nlmsg_seq;
}
-void mnl_batch_begin(void)
+uint32_t mnl_batch_begin(void)
{
- mnl_batch_put(NFNL_MSG_BATCH_BEGIN);
+ return mnl_batch_put(NFNL_MSG_BATCH_BEGIN);
}
void mnl_batch_end(void)