Re: [PATCH net-next v3 2/5] net: dsa: add out-of-band tagging protocol

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

 



> +struct dsa_oob_tag_info {
> +	u16 proto;
> +	u16 dp;
> +};

> +#define DSA_OOB_TAG_LEN 4
> +
> +int dsa_oob_tag_push(struct sk_buff *skb, struct dsa_oob_tag_info *ti)
> +{
> +	struct dsa_oob_tag_info *tag_info;
> +
> +	tag_info = (struct dsa_oob_tag_info *)skb->head;
> +
> +	tag_info->proto = ti->proto;
> +	tag_info->dp = ti->dp;

Do you need to be worried about alignment here? Is skb->head
guaranteed to be at least 16 bit aligned? I think you would be safer
to use get_unaligned_le16(val, tag);

	Andrew



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux