diff mbox

[net-next-2.6,1/8] af_packet: use skb->skb_iif instead of orig_dev->ifindex

Message ID 1299320969-7951-2-git-send-email-jpirko@redhat.com
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Jiri Pirko March 5, 2011, 10:29 a.m. UTC
Since skb_iif has the desired value (ifindex of physical device actually
received the traffic) use that instead.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 net/packet/af_packet.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Nicolas de Pesloüan March 5, 2011, 2:03 p.m. UTC | #1
Le 05/03/2011 11:29, Jiri Pirko a écrit :
> Since skb_iif has the desired value (ifindex of physical device actually
> received the traffic) use that instead.

This one cause orig_dev to be useless from the af_packet point of view, which is really good.

>
> Signed-off-by: Jiri Pirko<jpirko@redhat.com>

Reviewed-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>

> ---
>   net/packet/af_packet.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
> index 5efef5b..b34294e 100644
> --- a/net/packet/af_packet.c
> +++ b/net/packet/af_packet.c
> @@ -627,7 +627,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
>   	sll->sll_protocol = skb->protocol;
>   	sll->sll_pkttype = skb->pkt_type;
>   	if (unlikely(po->origdev))
> -		sll->sll_ifindex = orig_dev->ifindex;
> +		sll->sll_ifindex = skb->skb_iif;
>   	else
>   		sll->sll_ifindex = dev->ifindex;
>
> @@ -812,7 +812,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
>   	sll->sll_protocol = skb->protocol;
>   	sll->sll_pkttype = skb->pkt_type;
>   	if (unlikely(po->origdev))
> -		sll->sll_ifindex = orig_dev->ifindex;
> +		sll->sll_ifindex = skb->skb_iif;
>   	else
>   		sll->sll_ifindex = dev->ifindex;
>

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

Patch

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 5efef5b..b34294e 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -627,7 +627,7 @@  static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
 	sll->sll_protocol = skb->protocol;
 	sll->sll_pkttype = skb->pkt_type;
 	if (unlikely(po->origdev))
-		sll->sll_ifindex = orig_dev->ifindex;
+		sll->sll_ifindex = skb->skb_iif;
 	else
 		sll->sll_ifindex = dev->ifindex;
 
@@ -812,7 +812,7 @@  static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
 	sll->sll_protocol = skb->protocol;
 	sll->sll_pkttype = skb->pkt_type;
 	if (unlikely(po->origdev))
-		sll->sll_ifindex = orig_dev->ifindex;
+		sll->sll_ifindex = skb->skb_iif;
 	else
 		sll->sll_ifindex = dev->ifindex;