From owner-freebsd-net@freebsd.org Wed Oct 21 16:09:42 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 965EC44F7B6 for ; Wed, 21 Oct 2020 16:09:42 +0000 (UTC) (envelope-from dkandula@gmail.com) Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) (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 4CGb6Y1t6Tz4TlF for ; Wed, 21 Oct 2020 16:09:41 +0000 (UTC) (envelope-from dkandula@gmail.com) Received: by mail-ot1-x32e.google.com with SMTP id f37so2291507otf.12 for ; Wed, 21 Oct 2020 09:09:41 -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=3wTiQ30tDfxigdtq0SPUmOSm+gVB9xsbSQyTqviLLGI=; b=ggUDiUD2PfTLbAyah+ozQUtxuem7TpXj5gqjI2IHBU0GCUk58CNixtDW5BasDpufBj 6q3NASePNIwBBq6dP+5OObnLYaFjHlkBNnUPhu+pjpvvNpO4Vg2JnOCafK8mH+801Ql/ K7M58o53eLn5BffY3qucbi8uPZeaRbCHa0ncrjGZvVzlxRZu1K4N6Q/KnPcsahSy8J2T VPCTJbCe8+M32QQcBYbZJH9zXatfGBXduqjuE8ZoONqOn6ojmeJQLA+10jzqasflEICB auh7dsdXmaLpfpw+OeDFgPZ7I0WZIDS6Fos+e8cGEoQehQzL1uZ0kO4BKpSosXpm/vgJ Ivlw== 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=3wTiQ30tDfxigdtq0SPUmOSm+gVB9xsbSQyTqviLLGI=; b=l5hii9PIivvzXMJ66+31/sDheL/uvc61nOEGgBOidWuP+nQH67pwJrYWb/PndlTKNF SqOciqLs0SycQVKtm8UaIUuKQ/T6C+n7mB8xOIazU0YMLPauDjdte2gfaP56X9yI8ViI hRGLZ3f1kkUKfjFyIdC5wiClMaS8TMXoK0pyeKmpLZLcq/KIh/efW/qEanLReq++R5ps 0TqTwXbB6z8xxRolJX9oBHpla0Zcgk8nhYfsIUv50O2liLspnbBwl6XSm2l25vhYnnsh HZZt5bgVt47WI1VuxikkIzMlf8lvngQMshIvPowEq3gm3nfgibufjwL6/6yFRrGM//gl FOsw== X-Gm-Message-State: AOAM5339LUVGKtkesCN1x38IvpOC71WSSfjbPyU7SN7b58s9O/k5vr5O AnGPDSx5t3ipnFHdwC9py3Lt8EcF0NEmozK7bi+GSsNvATI= X-Google-Smtp-Source: ABdhPJwJZDqJ8SfTKt71gZl2bX5kUyOUfM9y8yxEbwJgA8NsCAO8BJbhPddmDtLom16EUScasO6xevoBjxYWO3+WpsU= X-Received: by 2002:a9d:53cc:: with SMTP id i12mr2982772oth.215.1603296579838; Wed, 21 Oct 2020 09:09:39 -0700 (PDT) MIME-Version: 1.0 References: <5f8b19d0-f833-0566-2336-d75ce0881ffa@selasky.org> In-Reply-To: From: Dheeraj Kandula Date: Wed, 21 Oct 2020 12:09:28 -0400 Message-ID: Subject: Re: ims_merge in in_mcast.c To: Hans Petter Selasky Cc: freebsd-net@freebsd.org X-Rspamd-Queue-Id: 4CGb6Y1t6Tz4TlF X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=ggUDiUD2; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of dkandula@gmail.com designates 2607:f8b0:4864:20::32e as permitted sender) smtp.mailfrom=dkandula@gmail.com X-Spamd-Result: default: False [-3.82 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.01)[-1.010]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.002]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::32e:from]; NEURAL_HAM_SHORT(-0.80)[-0.804]; 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: Wed, 21 Oct 2020 16:09:42 -0000 The ims_merge function is invoked only when the imsl_st[0] and imsl_st[1] are different i.e. a filter mode change. The new filter mode is updated in ims_st[1]. Thanks for the clarification. Thanks Dheeraj On Tue, Oct 13, 2020 at 9:58 AM Dheeraj Kandula wrote: > 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 >> >