On Mon, 2015-04-27 at 17:10 -0500, Thomas Falcon wrote:



> +                             if (be16_to_cpu(skb->protocol) == ETH_P_IP) {
> +                                     skb_set_network_header(skb, 0);
> +                                     skb_set_transport_header(skb, 
> sizeof(struct iphdr));
> +                                     iph = ip_hdr(skb);
> +

All this should really be :

if (skb->protocol == htons(ETH_P_IP)) {
        iph = (struct iphdr *)skb->data;

Because setting network header and a (potentially wrong) transport
header is confusing at this stage.

(It should be done later in core networking stack)


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

Reply via email to