[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20120816.145200.694410419765575459.davem@davemloft.net>
Date: Thu, 16 Aug 2012 14:52:00 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: eric@...it.org
Cc: netdev@...r.kernel.org
Subject: Re: [RFC PATCH v1.0] af_packet: don't emit packet on orig fanout
group
From: Eric Leblond <eric@...it.org>
Date: Thu, 16 Aug 2012 17:44:50 +0200
> If a packet is emitted on one socket in one group of fanout sockets,
> it is transmitted again. It is thus read again on one of the sockets
> of the fanout group. This result in a loop for software which
> generate packets when receiving one.
> This retransmission is not the intended behavior: a fanout group
> must behave like a single socket. The packet should not be
> transmitted on a socket if it originates from a socket belonging
> to the same fanout group.
>
> This patch fixes the issue by changing the transmission check to
> take fanout group info account.
This looks mostly fine, thanks for fixing this.
I wonder if it wouldn't be better to simply have a callback? That
would eliminate all of the ifdefs:
if (ptype->id_match) {
if (ptype->id_match(ptype, skb->sk))
return true;
} else if (ptype->af_packet_priv == skb->sk)
return true;
It's a shame that we have a user of af_packet_priv outside of
AF_PACKET, in TIPC. If we could get rid of that we could simplify
things even futher.
--
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