Re: [patch] allow write() on SOCK_PACKET sockets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stas Sergeev <stsp@aknet.ru> wrote:
>
> I think you are looking at a wrong place.
> You are looking into IP raw sockets code.
> Packet sockets are really the different
> layer. Please have a look into
> net/packet/af_packet.c instead.

Yes.  Sorry for the confusion.

> But I don't seem to be able to send any
> mail to you:

Should work now.
 
>> OTOH, write() and send() needs to know where the message is going
>> to.
>
> That's exactly where the packet sockets are
> different. Here's the whole point. Have a
> look into a "struct sockaddr_pkt":
> 
>              struct sockaddr_pkt
>              {
>                  unsigned short  spkt_family;
>                  unsigned char   spkt_device[14];
>                  unsigned short  spkt_protocol;
>              };

I see your point.  But I don't really like the current code that
uses the address from bind for sending.  Even though it works here
because the packet socket is symmetric wrt sending/receiving, it
is counter-intuitive for the socket API in general.

> My patch is probably dead anyway though.
> SOCK_PACKET is mentioned to be deprecated
> in man, so perhaps noone will apply any
> patches on it... Just wanted to point out

Indeed it is.

> that there is a bug/inconsistency in it.

Thanks anyway.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux