From: "Rémi Denis-Courmont" <remi.denis-courmont@nokia.com>
To: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] Phonet: set the pipe handle using setsockopt
Date: Wed, 16 Nov 2011 08:30:50 +0200 [thread overview]
Message-ID: <3443203.gVgdO3ogFg@hector> (raw)
In-Reply-To: <81C3A93C17462B4BBD7E272753C105791FB090B0B8@EXDCVYMBSTM005.EQ1STM.local>
Le Lundi 14 Novembre 2011 11:36:12 ext Hemant-vilas RAMDASI a écrit :
> > sockaddr_pn *spn) /* Phonet device ioctl requests */
> > >
> > > #ifdef __KERNEL__
> > > #define SIOCPNGAUTOCONF (SIOCDEVPRIVATE + 0)
> > >
> > > +#define SIOPNPIPE_ENABLE _IO(SIOCPNGAUTOCONF, 1)
> >
> > Does this even work? I am not an expert on this, but I would think that
> > device-private controls are routed to the network device, not the
> > socket. In
> > any case, it does not seem right.
>
> Yes, it works. The ioctl is routed to per-socket functions.
Even if it works, sockets are probably not supposed to use the device-private
ioctl() range, are they?
And why is this inside __KERNEL__ ?
> > > @@ -994,6 +1068,17 @@ static int pep_getsockopt(struct sock *sk, int
> >
> > level,
> >
> > > int optname, return -EINVAL;
> > >
> > > break;
> > >
> > > + case PNPIPE_ENABLE:
> > > + if (sk->sk_state == TCP_ESTABLISHED)
> > > + val = 1;
> > > + else
> > > + val = 0;
> > > + break;
> >
> > Do you still need this read-only option?
>
> Yes.
Why and how?
--
Rémi Denis-Courmont
http://www.remlab.net/
next prev parent reply other threads:[~2011-11-16 6:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-14 7:53 [PATCH] Phonet: set the pipe handle using setsockopt Hemant Vilas RAMDASI
2011-11-14 9:29 ` Rémi Denis-Courmont
2011-11-14 10:36 ` Hemant-vilas RAMDASI
2011-11-16 6:30 ` Rémi Denis-Courmont [this message]
2011-11-16 8:46 ` Hemant-vilas RAMDASI
2011-11-16 10:15 ` Rémi Denis-Courmont
-- strict thread matches above, loose matches on Subject: below --
2011-11-09 11:20 Hemant Vilas RAMDASI
2011-11-09 15:00 ` Rémi Denis-Courmont
2011-11-10 9:44 ` Hemant-vilas RAMDASI
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=3443203.gVgdO3ogFg@hector \
--to=remi.denis-courmont@nokia.com \
--cc=netdev@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).