netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org
Subject: [PATCH 1/2] netlink: use set location for IO errors
Date: Fri,  7 Mar 2014 11:12:47 +0100	[thread overview]
Message-ID: <1394187168-18977-1-git-send-email-kaber@trash.net> (raw)

We currently crash when reporting a permission denied error for set additions.
This is due to using the wrong location, fix by passing in the set location.

Signed-off-by: Patrick McHardy <kaber@trash.net>
---
 src/netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/netlink.c b/src/netlink.c
index b2bd3c5..daac64c 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -777,7 +777,7 @@ int netlink_add_set(struct netlink_ctx *ctx, const struct handle *h,
 
 	err = mnl_nft_set_add(nf_sock, nls, NLM_F_EXCL | NLM_F_ECHO);
 	if (err < 0)
-		netlink_io_error(ctx, NULL, "Could not add set: %s",
+		netlink_io_error(ctx, &set->location, "Could not add set: %s",
 				 strerror(errno));
 
 	set->handle.set =
-- 
1.8.5.3


             reply	other threads:[~2014-03-07 10:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-07 10:12 Patrick McHardy [this message]
2014-03-07 10:12 ` [PATCH 2/2] parser: add grammatical distinction for verdict maps Patrick McHardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1394187168-18977-1-git-send-email-kaber@trash.net \
    --to=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).