[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3443203.gVgdO3ogFg@hector>
Date: Wed, 16 Nov 2011 08:30:50 +0200
From: Rémi Denis-Courmont
<remi.denis-courmont@...ia.com>
To: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH] Phonet: set the pipe handle using setsockopt
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/
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists