On Tue, May 11, 2004 at 06:29:26AM -0000, bunty wrote: > > hi Micha, > > while studying how ping packet formed and send to adjecent machine when > i ping to that machine i found that from icmp.c control goes to ip_build_xmit > in ip_output.c > but i am unable to find alloc_skb that allocates space for ping packet. the > sock_alloc_skb_send in ip_build_xmit_slow have that alloc_skb function call but > it is allocating only hh_len. so where kernel allocates space for ping packet? > Actually ip_build_xmit_slow allocates fraglen + hh_len + 15: skb = sock_alloc_send_skb(sk, fraglen + hh_len + 15, (flags & MSG_DONTWAIT), &err); where fraglen = length - offset + fragheaderlen; Which then does the actual allocation in net/core/sock.c:sock_alloc_send_pskb skb = alloc_skb(header_len, sk->allocation); (this is with 2.4.27-pre1 in my case). Notice that ping sends very little data by default (56) you need to use the -s switch to change that. I also don't remember the ping code, but I am not sure ping actually uses the icmp stack. I don't remember if it was ping or something else I ran into that actually used raw packets building all the data itself and thus bypassing parts of the network stack. > regards, > parag. > > > _[_h_t_t_p_:_/_/_a_d_s_._r_e_d_i_f_f_._c_o_m_/_R_e_a_l_M_e_d_i_a_/_a_d_s_/_a_d_s_t_r_e_a_m___n_x_._c_g_i_/_w_w_w_._r_e_d_i_f_f_m_a_i_l_._c_o_m_/ > _i_n_b_o_x_._h_t_m_@_B_o_t_t_o_m_] > +++++++++++++++++++++++++++++++++++++++++++ > This Mail Was Scanned By Mail-seCure System > at the Tel-Aviv University CC. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/