netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Ken-ichirou MATSUZAWA <chamaken@gmail.com>
Cc: The netfilter developer mailinglist
	<netfilter-devel@vger.kernel.org>,
	Florian Westphal <fw@strlen.de>
Subject: Re: [PATCH libmnl] socket: creating a struct mnl_socket from a pre-existing socket
Date: Mon, 22 Sep 2014 12:54:56 +0200	[thread overview]
Message-ID: <20140922105456.GA6952@salvia> (raw)
In-Reply-To: <20140922102432.GA6074@salvia>

On Mon, Sep 22, 2014 at 12:24:32PM +0200, Pablo Neira Ayuso wrote:
> On Sat, Sep 20, 2014 at 03:05:37PM +0900, Ken-ichirou MATSUZAWA wrote:
> > This patch defines a new function mnl_socket_fdopen() which
> > creates a struct mnl_socket object from a pre-existing netlink
> > socket obtained from other process. Now I think of the socket
> > is obtained from child process via send/recvmsg().
> 
> OK, you can also use this to send netlink messages using different
> domain/type sockets from the same process too, I'm going to attach
> this to the description.

I just noticed that, for your usecase, nl->addr is going to be left
unset. So getsockname() is also needed to set nl->addr if the socket
is of netlink type, otherwise, the portID zero should already tell us
that this is not a netlink socket, since this portID is reserved to
the kernel when netlink is used.

Could you address this and resend the patch including my comments in
the previous email? Thanks.


  reply	other threads:[~2014-09-22 10:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-20  6:05 [PATCH libmnl] socket: creating a struct mnl_socket from a pre-existing socket Ken-ichirou MATSUZAWA
2014-09-22 10:24 ` Pablo Neira Ayuso
2014-09-22 10:54   ` Pablo Neira Ayuso [this message]
2014-09-25  0:33 ` [PATCHv2 " Ken-ichirou MATSUZAWA
2014-09-25 10:49   ` Pablo Neira Ayuso

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=20140922105456.GA6952@salvia \
    --to=pablo@netfilter.org \
    --cc=chamaken@gmail.com \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.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).