* [PATCH] fix for nfacct infrastructure in net-next @ 2012-01-01 16:22 pablo 2012-01-01 16:22 ` [PATCH] netfilter: nfnetlink_acct: fix nfnl_acct_get operation pablo 2012-01-01 16:23 ` [PATCH] fix for nfacct infrastructure in net-next Pablo Neira Ayuso 0 siblings, 2 replies; 6+ messages in thread From: pablo @ 2012-01-01 16:22 UTC (permalink / raw) To: netfilter-devel; +Cc: davem, netdev From: Pablo Neira Ayuso <pablo@netfilter.org> Hi Dave, Please, pull the following fix for the nfacct infrastructure already in your net-next tree. You can pull it from: git://1984.lsi.us.es/net-net nf-next Thanks! Pablo Neira Ayuso (1): netfilter: nfnetlink_acct: fix nfnl_acct_get operation net/netfilter/nfnetlink_acct.c | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) -- 1.7.7.3 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] netfilter: nfnetlink_acct: fix nfnl_acct_get operation 2012-01-01 16:22 [PATCH] fix for nfacct infrastructure in net-next pablo @ 2012-01-01 16:22 ` pablo 2012-01-01 16:23 ` [PATCH] fix for nfacct infrastructure in net-next Pablo Neira Ayuso 1 sibling, 0 replies; 6+ messages in thread From: pablo @ 2012-01-01 16:22 UTC (permalink / raw) To: netfilter-devel; +Cc: davem, netdev From: Pablo Neira Ayuso <pablo@netfilter.org> The get operation was not sending the message that was built to user-space. This patch also includes the appropriate handling for the return value of netlink_unicast(). Moreover, fix error codes on error (for example, for non-existing entry was uncorrect). Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> --- net/netfilter/nfnetlink_acct.c | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/net/netfilter/nfnetlink_acct.c b/net/netfilter/nfnetlink_acct.c index 362ab6c..11ba013 100644 --- a/net/netfilter/nfnetlink_acct.c +++ b/net/netfilter/nfnetlink_acct.c @@ -166,7 +166,7 @@ static int nfnl_acct_get(struct sock *nfnl, struct sk_buff *skb, const struct nlmsghdr *nlh, const struct nlattr * const tb[]) { - int ret = 0; + int ret = -ENOENT; struct nf_acct *cur; char *acct_name; @@ -186,17 +186,26 @@ nfnl_acct_get(struct sock *nfnl, struct sk_buff *skb, continue; skb2 = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); - if (skb2 == NULL) + if (skb2 == NULL) { + ret = -ENOMEM; break; + } ret = nfnl_acct_fill_info(skb2, NETLINK_CB(skb).pid, nlh->nlmsg_seq, NFNL_MSG_TYPE(nlh->nlmsg_type), NFNL_MSG_ACCT_NEW, cur); - if (ret <= 0) + if (ret <= 0) { kfree_skb(skb2); + break; + } + ret = netlink_unicast(nfnl, skb2, NETLINK_CB(skb).pid, + MSG_DONTWAIT); + if (ret > 0) + ret = 0; - break; + /* this avoids a loop in nfnetlink. */ + return ret == -EAGAIN ? -ENOBUFS : ret; } return ret; } -- 1.7.7.3 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] fix for nfacct infrastructure in net-next 2012-01-01 16:22 [PATCH] fix for nfacct infrastructure in net-next pablo 2012-01-01 16:22 ` [PATCH] netfilter: nfnetlink_acct: fix nfnl_acct_get operation pablo @ 2012-01-01 16:23 ` Pablo Neira Ayuso 2012-01-01 23:02 ` David Miller 1 sibling, 1 reply; 6+ messages in thread From: Pablo Neira Ayuso @ 2012-01-01 16:23 UTC (permalink / raw) To: netfilter-devel; +Cc: davem, netdev On Sun, Jan 01, 2012 at 05:22:24PM +0100, pablo@netfilter.org wrote: > From: Pablo Neira Ayuso <pablo@netfilter.org> > > Hi Dave, > > Please, pull the following fix for the nfacct infrastructure already > in your net-next tree. > > You can pull it from: > > git://1984.lsi.us.es/net-net nf-next ^^^^^^^ I meant to say net-next, of course. Sorry. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] fix for nfacct infrastructure in net-next 2012-01-01 16:23 ` [PATCH] fix for nfacct infrastructure in net-next Pablo Neira Ayuso @ 2012-01-01 23:02 ` David Miller 2012-01-02 1:04 ` Pablo Neira Ayuso 0 siblings, 1 reply; 6+ messages in thread From: David Miller @ 2012-01-01 23:02 UTC (permalink / raw) To: pablo; +Cc: netfilter-devel, netdev From: Pablo Neira Ayuso <pablo@netfilter.org> Date: Sun, 1 Jan 2012 17:23:58 +0100 > On Sun, Jan 01, 2012 at 05:22:24PM +0100, pablo@netfilter.org wrote: >> From: Pablo Neira Ayuso <pablo@netfilter.org> >> >> Hi Dave, >> >> Please, pull the following fix for the nfacct infrastructure already >> in your net-next tree. >> >> You can pull it from: >> >> git://1984.lsi.us.es/net-net nf-next > ^^^^^^^ > I meant to say net-next, of course. I'm not pulling this. If I pull from your "corrected" URL, "git://1984.lsi.us.es/net-next nf-next" it starts to download 17937 objects. Which means it's going to bring in all of your -next work as well as my net-next tree upon which it is based, not just this one bug fix. These mistakes should never happen in the first place. If you actually use "git request-pull" to generate the pull request email body, you can NEVER get the URL wrong, GIT enforces it to be correct and it enforces that the changes in your local tree are present at the remote URL as well. You can't make these kinds of errors and oversights when you want to ask me to pull in bug fixes at the very last minute when Linus is about to make a final release. Just toss these fixes, if they are so important submit them to Greg KH and the -stable branch after 3.2.0-final goes out. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] fix for nfacct infrastructure in net-next 2012-01-01 23:02 ` David Miller @ 2012-01-02 1:04 ` Pablo Neira Ayuso 2012-01-02 4:42 ` David Miller 0 siblings, 1 reply; 6+ messages in thread From: Pablo Neira Ayuso @ 2012-01-02 1:04 UTC (permalink / raw) To: David Miller; +Cc: netfilter-devel, netdev Hi Dave, On Sun, Jan 01, 2012 at 06:02:29PM -0500, David Miller wrote: > I'm not pulling this. > > If I pull from your "corrected" URL, "git://1984.lsi.us.es/net-next nf-next" > it starts to download 17937 objects. Which means it's going to bring in all > of your -next work as well as my net-next tree upon which it is based, not > just this one bug fix. > > These mistakes should never happen in the first place. > > If you actually use "git request-pull" to generate the pull request > email body, you can NEVER get the URL wrong, GIT enforces it to be > correct and it enforces that the changes in your local tree are > present at the remote URL as well. You caught me here, I wasn't using git request-pull. I'll do next time, sorry. > You can't make these kinds of errors and oversights when you want to > ask me to pull in bug fixes at the very last minute when Linus is > about to make a final release. I think there's a misunderstanding. This is not intended for current 3.2-rc7. This is a fix for something that is in your net-next tree (upcoming 3.3). I can wait and resubmit this later, we have the entire 3.3-rc cycle to get it fixed. Sorry for rushing you. > Just toss these fixes, if they are so important submit them to Greg KH > and the -stable branch after 3.2.0-final goes out. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] fix for nfacct infrastructure in net-next 2012-01-02 1:04 ` Pablo Neira Ayuso @ 2012-01-02 4:42 ` David Miller 0 siblings, 0 replies; 6+ messages in thread From: David Miller @ 2012-01-02 4:42 UTC (permalink / raw) To: pablo; +Cc: netfilter-devel, netdev From: Pablo Neira Ayuso <pablo@netfilter.org> Date: Mon, 2 Jan 2012 02:04:15 +0100 > This is not intended for current 3.2-rc7. This is a fix for something > that is in your net-next tree (upcoming 3.3). I think this is the communication problem we had, I thought this was a netfilter bug fix that was already in net-next that you wanted me to include in net. Now that I understand the situation I've pulled the fix into net-next, thanks. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-01-02 4:43 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-01-01 16:22 [PATCH] fix for nfacct infrastructure in net-next pablo 2012-01-01 16:22 ` [PATCH] netfilter: nfnetlink_acct: fix nfnl_acct_get operation pablo 2012-01-01 16:23 ` [PATCH] fix for nfacct infrastructure in net-next Pablo Neira Ayuso 2012-01-01 23:02 ` David Miller 2012-01-02 1:04 ` Pablo Neira Ayuso 2012-01-02 4:42 ` David Miller
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).