From: Ying Xue <ying.xue@windriver.com>
To: David Miller <davem@davemloft.net>
Cc: <eric@regit.org>, <netdev@vger.kernel.org>
Subject: Re: [RFC PATCH v1.0] af_packet: don't emit packet on orig fanout group
Date: Fri, 17 Aug 2012 16:03:11 +0800 [thread overview]
Message-ID: <502DFABF.3000906@windriver.com> (raw)
In-Reply-To: <20120816.145200.694410419765575459.davem@davemloft.net>
David Miller wrote:
> From: Eric Leblond <eric@regit.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.
>
Hi David, next week I will take over the job to get rid the usage of
af_packet_priv from TIPC.
Regards,
Ying
> --
> 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
>
>
prev parent reply other threads:[~2012-08-17 8:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-06 14:21 [BUG] af_packet: loop at reception when using fanout Eric Leblond
2012-08-16 15:44 ` [RFC PATCH v1.0] af_packet: don't emit packet on orig fanout group Eric Leblond
2012-08-16 21:52 ` David Miller
2012-08-16 21:52 ` David Miller
2012-08-17 8:02 ` [PATCH v1.1] " Eric Leblond
2012-08-20 9:37 ` David Miller
2012-08-17 8:03 ` Ying Xue [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=502DFABF.3000906@windriver.com \
--to=ying.xue@windriver.com \
--cc=davem@davemloft.net \
--cc=eric@regit.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.