Re: Accessing a udp header in device driver

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

 



Hello,
     I am also working on implemenring my own 8 byte header after IP
header. To access header values did you check skb pointers at
transport layes? Are you have taken into consideration about pointers
require to move 8 bytes towards payload when you try to access udp
header values after adding own 8 byte header?
regards,
cranium



On Thu, 10 Feb 2005 06:24:00 +0530 (IST), durgam@xxxxxxxxxxxxx
<durgam@xxxxxxxxxxxxx> wrote:
> i am implementing a virtual network device driver. I added my own header
> of 8 bytes after ip header.  Then I am accessing udp header values source
> and dest(both ports). I used spinlock before accessing these two values(to
> avoid conccurent access to kerenl). But  it is not receiving proper udp
> header ports. some times it is giving correct values and some times it is
> giving random values. Is there any way to access the header value?
> 
>   The following code i am using to access the code.
> 
> spin_lock(&udp_lock)
>  uh=skb->h.uh;
>  sport=uh->source;
>  dport=uh->dest;
> spin_lock(&udp_lock)
> 
> thanks in advance
> phani
> 
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
> 
>

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