retrieving data from socket buffer

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

 



Hello together,

I'm a bit confused on how to retrieve data from a socket buffer
correctly. If I have a pointer to the sk_buff struct and now I want to
retrieve the last two octets from the data, say (skb->tail - 2), do I
need to use 
	u16 fcs = get_unaligned(skb->tail - 2);
or even
	u16 fcs = __le16_to_cpu(skb->tail - 2);
or anything else?

What assumptions can be made about the socket buffer concerning data
alignment and endianess?

Thanks for any help,
Martin


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