recvfrom a large packet

Victor Buciuc victor.buciuc at gmail.com
Tue Nov 6 09:08:50 EST 2012


On Tue, Nov 6, 2012 at 1:35 PM, devendra.aaru <devendra.aaru at gmail.com> wrote:
> if i do a recvfrom (sk, buf, 10000, 0, &addr, &len), shall i recv all the data
> i mean the 10000 bytes?
>
> since fragmentation happen in the ip layer and assembled happen in the
> ip layer it doesnt matter for the upper layer about the packet size.
>
>
> i wrote a test code and it seems to be working.
>
> is there any problem will come if i turn on firewall.
>
> any ideas?
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

   I think a signal can interrupt recvfrom. If you already had some
data copied in the buffer then it will return something. You should
always check what you get in the result returned by recvfrom. If
you're not satisfied with what you got you can always call again. (I
assumed it's UDP we're talking about).

   I'm not an expert, it's my two cents.

Victor.



More information about the Kernelnewbies mailing list