RE: Extracting UDP header from skb while forwarding

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

 



Hi,
You can access UDP header like this:

udp_header = (struct udphdr *)(skb->data + (skb->nh.iph->ihl *4));

Regards,
Mahesh.

-----Original Message-----
From: linux-net-owner@xxxxxxxxxxxxxxx
[mailto:linux-net-owner@xxxxxxxxxxxxxxx] On Behalf Of Shrikrishna Khare
Sent: Wednesday, April 30, 2008 7:14 AM
To: linux-net@xxxxxxxxxxxxxxx
Subject: Extracting UDP header from skb while forwarding

Hello All,

   My queuing discipline requires me to access destination port for UDP
packets that I am sending. When I have machine A sending to machine B, a
simple code like
struct udphdr* udp_header = udp_hdr(skb) works fine. 

 However, when I have A sending data to C through B (i.e. B as
forwarding engine), I find that both, 
skb->transport_header and skb_network_header are equal when accessed
from queuing discipline code. How can I access transport_header then? 

I tried extracting it from skb->data but the code keeps crashing. Could
anyone please tell me how can I access transport header from queuing
disciplines code then? I know machine B should not be looking at
transport layer fields. But I need to do it for testing some
functionality.

Thanks in advance!
Shrikrishna



 
________________________________________________________________________
____________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
--
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
SASKEN BUSINESS DISCLAIMER
-------------------------
This message may contain confidential, proprietary or legally privileged information. In 
case you are not the original intended Recipient of the message, you must not, directly or 
indirectly, use, Disclose, distribute, print, or copy any part of this message and you are 
requested to delete it and inform the sender. Any views expressed in this message are 
those of the individual sender unless otherwise stated. Nothing contained in this message 
shall be construed as an offer or acceptance of any offer by Sasken Communication 
Technologies Limited ("Sasken") unless sent with that express intent and with due 
authority of Sasken. Sasken has taken enough precautions to prevent the spread of 
viruses. However the company accepts no liability for any damage caused by any virus 
transmitted by this email

--
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux