From owner-freebsd-net@freebsd.org Tue Oct 13 13:59:08 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ADBC14431D4 for ; Tue, 13 Oct 2020 13:59:08 +0000 (UTC) (envelope-from dkandula@gmail.com) Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9cbb6LpWz3X0Z for ; Tue, 13 Oct 2020 13:59:07 +0000 (UTC) (envelope-from dkandula@gmail.com) Received: by mail-oi1-x22b.google.com with SMTP id w204so7372544oiw.1 for ; Tue, 13 Oct 2020 06:59:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zHctmUlO7SGW+Uu8+PmrcJXQhjU/h0P2zd3iGH61U10=; b=lAEQYoZNnkJFHMrM4x3VGjueh7hCrE8kVIMqMZar33IQE7ZXmJj4oyU9tDtQWS5fN1 XCrmHoiyFJk1AZ0FTf/Ah8z24X9ES1OQ7zV6kXF8BG9wI9RaAkz1IKJh6LjNsanen0Ov y4sZ3XhNObfKvsw5JA6LhTx1pj1jw72SjfsoxHdKyd9tXP3DL9s2tTAHFxEGe1GMPUZD ledmpf7C4SvUp+rW/3AUCVz/E2HLIELbW+FIxCHoFTuAF7Ybr4aq/tHzUXX3qow61Sxi yvptLGwkwliAgL4ejfX9JiTLPGbTUrHyYT0P1ok/22d1PQ4dhD8NGbr974/Cs0G+fDuj QwcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zHctmUlO7SGW+Uu8+PmrcJXQhjU/h0P2zd3iGH61U10=; b=neS0NEoLeJ10ULWRpGSzKWYSxXd5XDw9EvbtZayYwnoo4ar1f+MoKYYlc6rG6TxZIo wQ1ggzS14f5dw51YqHmuxp91MglBhMaxxOI+IkJ2lx12hIsZbhjGfDpcXvWtSjFmbXu5 9rxVwKlO1Gsp0wIKLJcqrzfJzEqRkr/NCeApF+xhbRe76xB8Q/4x+iWX4KSuO+XfzYzt Xp9NtUVOIHppCBOxRdiCozP6XLkliqqVjr1MgDaIOzw4658a8UHBXI55xjdmL3piElpg RXg0+Okeg4BM8mDxzaVWYZBe/5uHCM5Y3i66zmN3WecZYidDrvJsLn2rE8EBbzKZViTC 6q+Q== X-Gm-Message-State: AOAM5328gAS4Bc8HxtXKKDlsUXV2zMQmoi38Y4kDTXPZNBxrP1N6fAzv FKZFjzMFKFiBv6oeu75BXLdBKmKr1xV3TLgEsenjBV0qTgg= X-Google-Smtp-Source: ABdhPJw6xsX1YY4V/YR6elMbYnKhNy8ytdu+z02Y5uQ/vAxcYs5HZhg8T+sBzmmO18TMveZrmVViJc3j1YoO7oln63M= X-Received: by 2002:aca:6501:: with SMTP id m1mr41812oim.124.1602597546146; Tue, 13 Oct 2020 06:59:06 -0700 (PDT) MIME-Version: 1.0 References: <5f8b19d0-f833-0566-2336-d75ce0881ffa@selasky.org> In-Reply-To: <5f8b19d0-f833-0566-2336-d75ce0881ffa@selasky.org> From: Dheeraj Kandula Date: Tue, 13 Oct 2020 09:58:54 -0400 Message-ID: Subject: Re: ims_merge in in_mcast.c To: Hans Petter Selasky Cc: freebsd-net@freebsd.org X-Rspamd-Queue-Id: 4C9cbb6LpWz3X0Z X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=lAEQYoZN; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of dkandula@gmail.com designates 2607:f8b0:4864:20::22b as permitted sender) smtp.mailfrom=dkandula@gmail.com X-Spamd-Result: default: False [-3.68 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.97)[-0.971]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; NEURAL_HAM_LONG(-0.98)[-0.982]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::22b:from]; NEURAL_HAM_SHORT(-0.73)[-0.726]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-net]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2020 13:59:08 -0000 Thanks, HPS for the response. I think the index 0 is for a state (previous to current) and 1 indicates the current state. I am still trying to figure out what they really mean. Maybe reading the RFC will shed some light on the intention. My understanding is that the state transition is from index 0 to index 1. Hence when we are reverting, the state has to be reverted from index 1 to index 0. Isn't it? For a regular non-rollback scenario, the operation of -1 on line (987 or 991) and +1 (997 or 1001) adds up to 0. What are we trying to achieve here? Maybe that will help me to understand this code better. Dheeraj On Tue, Oct 13, 2020 at 4:18 AM Hans Petter Selasky wrote: > On 2020-10-12 19:11, Dheeraj Kandula wrote: > > On line 987 and 991 shouldn't the index be 0 instead of 1. > > > > i.e. ims->ims_st[0].ex -= n; > > and > > ims->ims_st[0].in -= n; > > > > On a rollback, the entry at index 0 is incremented and the entry at > index 1 > > is decremented. > > > > On a non-rollback merge, the entry at index 0 is decremented and the > entry > > at index 1 is incremented. > > Hi, > > If you look at inm_commit() you see that [0] is overwritten by [1], so I > believe the current code is correct. Same goes for both IPv4 and IPv6. > Are you seeing an issue with multicast investigating this issue? > > --HPS >