[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20130731.173017.624144247713296239.davem@davemloft.net>
Date: Wed, 31 Jul 2013 17:30:17 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: phil@....cc
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH 1/3] af_packet: when sending ethernet frames, parse
header for skb->protocol
From: Phil Sutter <phil@....cc>
Date: Wed, 31 Jul 2013 19:27:45 +0200
> @@ -2324,6 +2328,13 @@ static int packet_snd(struct socket *sock,
>
> sock_tx_timestamp(sk, &skb_shinfo(skb)->tx_flags);
>
> + if (dev->type == ARPHRD_ETHER) {
> + skb->protocol = eth_type_trans(skb, dev);
> + } else {
> + skb->protocol = proto;
> + skb->dev = dev;
> + }
> +
> if (!gso_type && (len > dev->mtu + reserve + extra_len)) {
> /* Earlier code assumed this would be a VLAN pkt,
> * double-check this now that we have the actual
> @@ -2338,8 +2349,6 @@ static int packet_snd(struct socket *sock,
> }
> }
>
> - skb->protocol = proto;
> - skb->dev = dev;
> skb->priority = sk->sk_priority;
> skb->mark = sk->sk_mark;
I don't see anything explaining why you are avoiding setting skb->dev when
you use eth_type_trans() to set the skb->protocol field.
Also, why isn't the user setting the protocol field correctly? Isn't
that the _real_ source of these problems?
This patch series cannot be applied as is, it's either wrong, or
explanations are missing from the commit messages.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists