Accessing a udp header in device driver

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

 



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/


[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