netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
To: David Ahern
	<dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: pablo-Cap9r6Oaw4JrovVCs/uTlw@public.gmane.org,
	Jamal Hadi Salim <jhs-jkUAjuhPggJWk0Htik3J/w@public.gmane.org>,
	Jiri Benc <jbenc-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	jiri-rHqAuBHg3fBzbRFIqnYvSA@public.gmane.org
Subject: Re: [PATCH v3 1/5] netlink: extended ACK reporting
Date: Mon, 10 Apr 2017 17:30:18 +0200	[thread overview]
Message-ID: <1491838218.28432.5.camel@sipsolutions.net> (raw)
In-Reply-To: <fddba2c8-3b85-d5df-81c4-ef31c459e40c-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org> (sfid-20170410_172609_028607_E5C0AF14)

On Mon, 2017-04-10 at 09:26 -0600, David Ahern wrote:
> On 4/8/17 2:24 PM, Johannes Berg wrote:
> > @@ -2300,14 +2332,35 @@ void netlink_ack(struct sk_buff *in_skb,
> > struct nlmsghdr *nlh, int err)
> >  			  NLMSG_ERROR, payload, 0);
> >  	errmsg = nlmsg_data(rep);
> >  	errmsg->error = err;
> > -	memcpy(&errmsg->msg, nlh, payload > sizeof(*errmsg) ? nlh-
> > >nlmsg_len : sizeof(*nlh));
> > +	memcpy(&errmsg->msg, nlh,
> > +	       !(nlk->flags & NETLINK_F_CAP_ACK) ? nlh->nlmsg_len
> > +						 : sizeof(*nlh));
> > +
> 
> generically this makes userspace parsing more problematic: the
> parsing layer may not know if the socket option has been set to
> precisely know the size of errmsg->msg and how much data needs to be
> skipped to get to the new attributes.

Yes, I know. I'd hope that userspace can remember that per socket - I
don't see a good other way to do this.

If we insert the TLVs in front of, or instead of (with a TLV containing
it), the request message then at least libnl's debugging will need to
be changed.

As it is, I can assume that libnl will not set the CAP setting, and
everything works fine even if I don't change libnl, which makes things
easier.

Do you have any better ideas?

johannes

  parent reply	other threads:[~2017-04-10 15:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-08 20:24 [PATCH v3 0/5] netlink extended ACK reporting Johannes Berg
     [not found] ` <20170408202434.12018-1-johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
2017-04-08 20:24   ` [PATCH v3 1/5] netlink: " Johannes Berg
2017-04-10 15:26     ` David Ahern
     [not found]       ` <fddba2c8-3b85-d5df-81c4-ef31c459e40c-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
2017-04-10 15:30         ` Johannes Berg [this message]
2017-04-10 15:35           ` David Ahern
     [not found]             ` <029e6587-c0e8-bdb0-49e9-2abe2946a7ff-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
2017-04-10 15:40               ` Johannes Berg
2017-04-10 18:38                 ` Johannes Berg
2017-04-11  6:59             ` Pablo Neira Ayuso
2017-04-11  7:02               ` Johannes Berg
     [not found]                 ` <1491894172.31620.2.camel-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
2017-04-11 14:25                   ` David Ahern
     [not found]                     ` <9a68aa01-474c-7054-30c2-473ee1250abe-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
2017-04-11 17:31                       ` Pablo Neira Ayuso
2017-04-11 17:42                         ` David Miller
2017-04-11 18:57                           ` David Ahern
2017-04-11 19:05                             ` David Miller
     [not found]                               ` <20170411.150527.283014710949232666.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2017-04-11 19:12                                 ` David Ahern
2017-04-11 19:43                           ` Johannes Berg
2017-04-08 20:24   ` [PATCH v3 2/5] genetlink: pass extended ACK report down Johannes Berg
2017-04-08 20:24 ` [PATCH v3 3/5] netlink: allow sending extended ACK with cookie on success Johannes Berg
2017-04-08 20:24 ` [PATCH v3 4/5] netlink: pass extended ACK struct to parsing functions Johannes Berg
2017-04-08 20:24 ` [PATCH v3 5/5] netlink: pass extended ACK struct where available Johannes Berg
2017-04-10 11:20 ` [PATCH v3 0/5] netlink extended ACK reporting Johannes Berg
2017-04-10 11:38 ` Johannes Berg

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=1491838218.28432.5.camel@sipsolutions.net \
    --to=johannes-cdvu00un1vgdhxzaddlk8q@public.gmane.org \
    --cc=dsa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org \
    --cc=jbenc-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jhs-jkUAjuhPggJWk0Htik3J/w@public.gmane.org \
    --cc=jiri-rHqAuBHg3fBzbRFIqnYvSA@public.gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pablo-Cap9r6Oaw4JrovVCs/uTlw@public.gmane.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).