Re: Re: Re: Re: Re: can i increase alloc_skb size in TCP layer?

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

 



On Fri, May 14, 2004 at 10:10:38AM -0000, bunty  wrote:
>  
> hi Michia,
>             so i have to implement a new protocol in between ICMP and IP
> protocol. so for that i have to implement a function that takes control from
> ICMP and gives to IP layer. but still dont you feel that there should be
> problem again of space. Because how does it knoes total space to be alloacted
> for packet with new protocol layer.
> regards,
> parag.
> 

You would actually want to implement a protocol that sits above ICMP,
since your protocol will be aware of ICMP, but not the other way
around.

Your protocol would implement a new socket type so the entry function
would be in your protocol, it would add its header and then send call
ICMP to handle the data further.

I am not sure though how to get incoming packets to pass through your
protocol handler. You should probably look at the specs or the code for
incoming packets to see how the kernel is aware of the next protocol
layer, you may need to modify the ICMP code for that.

Any reason why you want this in kernel space and not user space?

> 
> On Thu, 13 May 2004 Micha Feigin wrote :
> >On Thu, May 13, 2004 at 07:21:25AM -0000, bunty  wrote:
> > >
> > > hi,
> > >      i acually increase icmp header length but when i build kernel i
> > > am getting iph hook: happy cracking which is because of ip packet
> > > header is not completely add to skb so its iphdr's len became  short
> > > for that i want to know where should i change the space allocated for
> > > packet i change the same sock_alloc_send_skb length by the value i
> > > want it should be increased?
> > >
> >
> >I'm afraid I don't know the answer to that. Some googling seems to show
> >that icmp is part of IP so you may have to enlarge the size of the IP
> >header to allow for the extra data or maybe play with the value of
> >skb->nh.iph.
> >
> >You should look at the specs first to see if they allow that though.
> >
> >I think the right (although maybe not the easiest) method is to add
> >another protocol layer either at the level of tcp/ip (level 4 i think)
> >or above them, depending on where you want the data.
> >
> >Try having a look for example at:
> >http://www.freesoft.org/CIE/Course/Section3/7.htm
> >http://www.onlamp.com/pub/a/bsd/2001/04/04/FreeBSD_Basics.html
> >http://www.freesoft.org/CIE/Course/Section3/index.htm
> >
> >
> > > 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.
> 
> 
> _[_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/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux