Extract the payload of the packet from SKB buffer at Layer-2
Hi All, Is there any mechanism to get the payload area after extracting the transport header from skb at layer-2. I think we can do this with the combination of skb_full and skb_reset_mac_header, skb_reset_network_header, and skb_reset_transport_header functions. My main interest is extract the payload from the skb and reset the all the headers so that the skb remains unchanged. Help in this regards is highly appreciated. Thanks, Ramana.
On Thu, 29 May 2014 13:06:58 +0530, Ramana Reddy said:
Is there any mechanism to get the payload area after extracting the transport header from skb at layer-2.
Step 0: Figure out why you're committing a layering violation and poking around in the data down at layer 2. Ask yourself if a fragmented packet has been dealt with at that point. Or if you even *know* down at layer 2 of the OSI 7-layer burrito if there *is* a payload (Hint - which types of ICMP packets do and don't have a payload? How about a TCP window probe?). How does IPv4 versus IPv6 versus Decnet fit in here? So what are you trying to do here? It's usually very hard to recommend a good API to use without a hint or two of what the actual goal is...
participants (2)
-
Ramana Reddy -
Valdis.Kletnieks@vt.edu