Do you have a question? Post it now! No Registration Necessary
November 10, 2012, 5:23 pm

Hello
I'm trying to study and understand operations of the Linux tcp/ip stack,
specifically how 'ping' sends packets down and receives them.
Ping creates raw socket in AF_INET family, therefore I placed printk in
inet_sendmsg() at net/ipv4/af_inet.c to print out the socket protocol name
(RAW, UDP etc.) and the address of protocol specific sendmsg function which
correctly appears to be raw_sendmsg() from net/ipv4/raw.c
Now, I'm sending a single packet and observe that I'm getting printk form
inet_sendmsg() twice.This puzzles me -- is it normal (has something to do
with interrupts etc. ?) or there's something broken in the kernel?
Platform - ARM5te, kernel 2.6.31.8
Looking forward to hearing from you !
Mark
I'm trying to study and understand operations of the Linux tcp/ip stack,
specifically how 'ping' sends packets down and receives them.
Ping creates raw socket in AF_INET family, therefore I placed printk in
inet_sendmsg() at net/ipv4/af_inet.c to print out the socket protocol name
(RAW, UDP etc.) and the address of protocol specific sendmsg function which
correctly appears to be raw_sendmsg() from net/ipv4/raw.c
Now, I'm sending a single packet and observe that I'm getting printk form
inet_sendmsg() twice.This puzzles me -- is it normal (has something to do
with interrupts etc. ?) or there's something broken in the kernel?
Platform - ARM5te, kernel 2.6.31.8
Looking forward to hearing from you !
Mark

Re: path of packets through network stack
[...]

Presumably, the phenomenon you observed is 'normal' and it is
certainly not related to 'interrupts'. Interrupts are used for
controlling/ driving devices. This happens 'below' the network
stack. sendmsg is something which happens at the top of the latter.

Re: path of packets through network stack

Considering the following possible explanations:
- you found an unknown, major kernel error in the interface
parts of the networking stack which can be triggered in an
extremely simple way
- your code doesn't really do what you think it does
- this is either coincidence or part of the 'normal'
processing but the exact reason for it is unknown
the first seems the least likely to me. This doesn't mean that I'm
necessarily right but I'm not going to investigate this phenomenon in
the kernels I'm responsible for because I'm afraid that it could be
something serious which could affect other stuff I'm also responsible
for in some negative way.
BTW: You aren't per chance doing this on a system you're acessing over
the network?

Re: path of packets through network stack

I'm not certain, but
(Amazon.com product link shortened)
may get into a bit of that.
rick jones
--
The glass is neither half-empty nor half-full. The glass has a leak.
The real question is "Can it be patched?"
The glass is neither half-empty nor half-full. The glass has a leak.
The real question is "Can it be patched?"
We've slightly trimmed the long signature. Click to see the full one.
Site Timeline
- » need ideas for a graduation project related to embedded linux
- — Next thread in » Embedded Linux
-
- » adding new address families (AF_xxx)
- — Previous thread in » Embedded Linux
-
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux
-
- » FPC Buchse gesucht
- — The site's Newest Thread. Posted in » Electronics (German)
-
- » gu10 sijalice
- — The site's Last Updated Thread. Posted in » Electronics (Croatian)
-