From: Yan Zheng <yanzheng@21cn.com>
To: David Stevens <dlstevens@us.ibm.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH 2/2][MCAST] Fix for add_grec(...)
Date: Thu, 10 Nov 2005 09:20:33 +0800 [thread overview]
Message-ID: <4372A061.2030106@21cn.com> (raw)
In-Reply-To: <OFD5769042.0E81A890-ON882570B4.0075A92B-882570B4.00796FDC@us.ibm.com>
David Stevens wrote:
> Yan,
> I think your patch has some problems.
>
> Yan Zheng <yanzheng@21cn.com> wrote on 11/09/2005 03:58:20 AM:
>
>
>>+#if 0
>> if (!*psf_list) {
>> if (type == MLD2_ALLOW_NEW_SOURCES ||
>> type == MLD2_BLOCK_OLD_SOURCES)
>>@@ -1474,12 +1477,15 @@ static struct sk_buff *add_grec(struct s
>> }
>> return skb;
>> }
>>+#endif
>
>
>
> This code is the only place in the current code where you
> can generate a group header with an empty source list (what it is
> checking for). Your patch has added an add_grhead() for change
> and EXCLUDE records, but it isn't checking mca_crcount or isquery.
> I need to check, but I'm concerned this will create a group header
> in a report for cases where it should not.
>
ischange implicits mca_crcount has already been ckecked in mld_send_cr(...)
Actually, check mca_crcount directly will get mode change report sent one times less
than you intend, because mca_crcount has decreased by one before call add_grec(...).
Now We only have MLD2_MODE_IS_INCLUDE left. but "mode is include and source list is empty"
is an impossible event.
>
>
>> pmr = skb ? (struct mld2_report *)skb->h.raw : NULL;
>>
>> /* EX and TO_EX get a fresh packet, if needed */
>>- if (truncate) {
>>- if (pmr && pmr->ngrec &&
>>- AVAILABLE(skb) < grec_size(pmc, type, gdeleted, sdeleted)) {
>>+ if (truncate || ischange) {
>>+ int min_len;
>>+ min_len = truncate ? grec_size(pmc, type, gdeleted, sdeleted) :
>
>
>>+ (sizeof(struct mld2_grec) + sizeof(struct in6_addr));
>>+ if (pmr && pmr->ngrec && AVAILABLE(skb) < min_len) {
>> if (skb)
>> mld_sendpack(skb);
>> skb = mld_newpack(dev, dev->mtu);
>
>
> This "truncate" code is to handle exclude records that may be
> truncated. It gets a new packet when adding this record and the whole
> thing won't fit in a single packet. This is not appropriate for anything
> but IS_EX and TO_EX, but "ischange" in your patch will be true for
> TO_IN. So, I think this will waste space in a report that could hold
> some of these TO_IN sources.
When type is MLD2_MODE_IS_INCLUDE, min_len is equal to "sizeof(struct mld2_grec) +
sizeof(struct in6_addr)". it satisfies the comment above. (make sure we have room
for group header and at least one source.)
prev parent reply other threads:[~2005-11-10 1:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-09 11:58 [PATCH 2/2][MCAST] Fix for add_grec(...) Yan Zheng
2005-11-09 22:06 ` David Stevens
2005-11-10 1:20 ` Yan Zheng [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=4372A061.2030106@21cn.com \
--to=yanzheng@21cn.com \
--cc=dlstevens@us.ibm.com \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).