* comment on [NET]: Delete support for old-style protocols, no longer necessary.
@ 2003-10-07 18:37 Joe Perches
2003-10-07 18:52 ` David S. Miller
0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2003-10-07 18:37 UTC (permalink / raw)
To: davem, linux-net, netdev
How about
netdevice.h
struct sock;
struct packet_type {
unsigned short type; /* This is really htons(ether_type). */
struct net_device *dev; /* NULL is wildcarded here */
int (*func) (struct sk_buff *, struct net_device *,
struct packet_type *);
- void *af_packet_priv;
+ struct sock *sk; /* appropriate comment: socket copy? */
struct list_head list;
};
and s/af_packet_priv/sk/g in the rest of the files?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: comment on [NET]: Delete support for old-style protocols, no longer necessary.
2003-10-07 18:37 comment on [NET]: Delete support for old-style protocols, no longer necessary Joe Perches
@ 2003-10-07 18:52 ` David S. Miller
2003-10-07 23:33 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: David S. Miller @ 2003-10-07 18:52 UTC (permalink / raw)
To: Joe Perches; +Cc: davem, linux-net, netdev
On Tue, 07 Oct 2003 11:37:09 -0700
Joe Perches <joe@perches.com> wrote:
> - void *af_packet_priv;
> + struct sock *sk; /* appropriate comment: socket copy? */
AF_PACKET is the only user of this private field, and
I want people to be aware of this and not try to use it
for other stuff.
Nobody else can use it for something different, the code
in net/core/dev.c does specific things when it's non-NULL
knowing that this non-NULL value means that it's an
AF_PACKET packet_type being passed to it.
So we won't make your suggested change.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: comment on [NET]: Delete support for old-style protocols, no longer necessary.
2003-10-07 18:52 ` David S. Miller
@ 2003-10-07 23:33 ` Joe Perches
2003-10-08 0:22 ` Dan Kegel
0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2003-10-07 23:33 UTC (permalink / raw)
To: David S Miller; +Cc: davem, linux-net, netdev
On Tue, 2003-10-07 at 11:52, David S. Miller wrote:
> On Tue, 07 Oct 2003 11:37:09 -0700
> Joe Perches <joe@perches.com> wrote:
>
> > - void *af_packet_priv;
> > + struct sock *sk; /* appropriate comment: socket copy? */
>
> AF_PACKET is the only user of this private field, and
> I want people to be aware of this and not try to use it
> for other stuff.
>
> Nobody else can use it for something different, the code
> in net/core/dev.c does specific things when it's non-NULL
> knowing that this non-NULL value means that it's an
> AF_PACKET packet_type being passed to it.
>
> So we won't make your suggested change.
Even so, why not call it a struct sock*?
It is after all and is used as one.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: comment on [NET]: Delete support for old-style protocols, no longer necessary.
2003-10-07 23:33 ` Joe Perches
@ 2003-10-08 0:22 ` Dan Kegel
0 siblings, 0 replies; 4+ messages in thread
From: Dan Kegel @ 2003-10-08 0:22 UTC (permalink / raw)
To: Joe Perches; +Cc: David S Miller, davem, linux-net, netdev
Joe Perches wrote:
>>>- void *af_packet_priv;
>>>+ struct sock *sk; /* appropriate comment: socket copy? */
>>
>>AF_PACKET is the only user of this private field, and
>>I want people to be aware of this and not try to use it
>>for other stuff.
>>
>>Nobody else can use it for something different, the code
>>in net/core/dev.c does specific things when it's non-NULL
>>knowing that this non-NULL value means that it's an
>>AF_PACKET packet_type being passed to it.
>>
>>So we won't make your suggested change.
>
> Even so, why not call it a struct sock*?
> It is after all and is used as one.
To discourage other modules from using it, and to keep
programmers who aren't working on AF_PACKET from thinking about it.
It's SOP to use opaque cookies when you want to make data private.
- Dan
--
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-10-08 0:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-07 18:37 comment on [NET]: Delete support for old-style protocols, no longer necessary Joe Perches
2003-10-07 18:52 ` David S. Miller
2003-10-07 23:33 ` Joe Perches
2003-10-08 0:22 ` Dan Kegel
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).