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?


I am adding header by following code
 pskb_expand_head(skb,8,0,gfp_mask) ( i think it will take care of all
ip, tcp header values properly) 

 storing the values in the new 8 bytes.
 	






  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