linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* net/packet/af_packet.c:{1057,1073}: flags vs. msg->flags
@ 2003-11-10 11:10 Ihar 'Philips' Filipau
  2003-11-11  7:12 ` David S. Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Ihar 'Philips' Filipau @ 2003-11-10 11:10 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: netdev

Hi!

    [ I'm trying to cc: netdev - but they are not that welcome - and 
require subscription. I'm way too lazy (and my mail box is not that 
fast) to subscribe to send simple typo - if this is a case at all. ]

    [ kernel v2.6.0-test7 as found on lxr.linux.no, 2.4.{18,22} has the 
same - but line numbers are different. ]

    On line 1057 we have: "msg->msg_flags|=MSG_TRUNC;" to indicate that 
message was truncated.

    But on line 1073, where we make return status to user, we check 
against user suplied flags, but NOT msg->msg_flags.

    It looks like obvious typo.

-- 
Ihar 'Philips' Filipau  / with best regards from Saarbruecken.
--                                                           _ _ _
  "... and for $64000 question, could you get yourself       |_|*|_|
    vaguely familiar with the notion of on-topic posting?"   |_|_|*|
                                 -- Al Viro @ LKML           |*|*|*|


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: net/packet/af_packet.c:{1057,1073}: flags vs. msg->flags
  2003-11-10 11:10 net/packet/af_packet.c:{1057,1073}: flags vs. msg->flags Ihar 'Philips' Filipau
@ 2003-11-11  7:12 ` David S. Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David S. Miller @ 2003-11-11  7:12 UTC (permalink / raw)
  To: Ihar 'Philips' Filipau; +Cc: linux-kernel, netdev

On Mon, 10 Nov 2003 12:10:46 +0100
"Ihar 'Philips' Filipau" <filia@softhome.net> wrote:

>     On line 1057 we have: "msg->msg_flags|=MSG_TRUNC;" to indicate that 
> message was truncated.
> 
>     But on line 1073, where we make return status to user, we check 
> against user suplied flags, but NOT msg->msg_flags.
> 
>     It looks like obvious typo.

Indeed, you're right.

Thanks for the report, I'll fix this in both 2.4.x and 2.6.x

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: net/packet/af_packet.c:{1057,1073}: flags vs. msg->flags
       [not found] <Qifs.Pr.1@gated-at.bofh.it>
@ 2003-11-10 12:36 ` Ihar 'Philips' Filipau
  0 siblings, 0 replies; 3+ messages in thread
From: Ihar 'Philips' Filipau @ 2003-11-10 12:36 UTC (permalink / raw)
  To: Linux Kernel Mailing List


   RTFM (man recv) brought the response:

MSG_TRUNC
     Return the real length of the packet, even when  it  was  longer
     than the passed buffer. Only valid for packet sockets.

   So packet socket is special case here.

   Sorry for disturbing.

P.S. Wondering - is there any way to find a size of next queued 
datagram? SIOCINQ? cannot find its description - not listed in man 
ioctl_list - but implementation inside of ap_packet.c does exactly this.

Ihar 'Philips' Filipau wrote:
> Hi!
> 
>    [ I'm trying to cc: netdev - but they are not that welcome - and 
> require subscription. I'm way too lazy (and my mail box is not that 
> fast) to subscribe to send simple typo - if this is a case at all. ]
> 
>    [ kernel v2.6.0-test7 as found on lxr.linux.no, 2.4.{18,22} has the 
> same - but line numbers are different. ]
> 
>    On line 1057 we have: "msg->msg_flags|=MSG_TRUNC;" to indicate that 
> message was truncated.
> 
>    But on line 1073, where we make return status to user, we check 
> against user suplied flags, but NOT msg->msg_flags.
> 
>    It looks like obvious typo.
> 


-- 
Ihar 'Philips' Filipau  / with best regards from Saarbruecken.
--                                                           _ _ _
  "... and for $64000 question, could you get yourself       |_|*|_|
    vaguely familiar with the notion of on-topic posting?"   |_|_|*|
                                 -- Al Viro @ LKML           |*|*|*|


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-11-11  7:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-10 11:10 net/packet/af_packet.c:{1057,1073}: flags vs. msg->flags Ihar 'Philips' Filipau
2003-11-11  7:12 ` David S. Miller
     [not found] <Qifs.Pr.1@gated-at.bofh.it>
2003-11-10 12:36 ` Ihar 'Philips' Filipau

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).