From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C88855790; Mon, 18 Mar 2024 17:17:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710782222; cv=none; b=P3S7Bww4V/Vg11L8YelIsvC/RR4EmG9D9x2/sNDFQMAZAYuQxjebcC+xg05eiVx68512l18usjIv6Z414B8yiLW/TleQuBiPPMfDUbppucyMzMmZSC/JYzipl/AyqoNRQcc6cpB7Ff+LJhem/43uwTVM6ykcP/3ARFRacJh8nqE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710782222; c=relaxed/simple; bh=vDTqZKYF8IvJ3DljVKzXoNPrU7o1alGyUizdeOTNDuA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GGoHgM7r4F5pUjP3R/IOsGp1OLe+M2h2CGqglQaNkutNRFIpCWwQmHe6t/0xm+w63mOEKm+P/+Xd1VVFTAvCTHxI0WivTfWvqSpv699QZ/bEnrlBuKVAKQ6JRC7J/XZYJcmcs8jY6AQPYia3DXtvJCW7ZOcpl21ZQHxjvLtTawg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=h1pfMRex; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="h1pfMRex" Received: from [100.64.232.101] (unknown [20.29.225.195]) by linux.microsoft.com (Postfix) with ESMTPSA id BB2E920B74C0; Mon, 18 Mar 2024 10:17:00 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com BB2E920B74C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1710782221; bh=oBaGphn3sgS15rqtIpRpiQQCVintTQGUoEgffbht8jc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=h1pfMRex9JeFAIpEfLqo3Ru1rw8Fd+cuLioiO2U87gharO5NtItLjy89I4sXiZUl0 R58UuKXNooldgmFppgYSRNO+Dm3a803YuBiW8zm/gd0MuNSYE2rvM6tNnlOIaZfSVG r3rMFReXC7MIVCvXlg54AqeGpJKrMac3Q4Efu17c= Message-ID: <066c4b0c-c8a5-4abd-9456-20b0352ee1ab@linux.microsoft.com> Date: Mon, 18 Mar 2024 10:16:59 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] hv/hv_kvp_daemon: Handle IPv4 and Ipv6 combination for keyfile format Content-Language: en-CA To: Ani Sinha Cc: Shradha Gupta , linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li , Olaf Hering , Shradha Gupta References: <1710729951-2695-1-git-send-email-shradhagupta@linux.microsoft.com> <9d24633d-b2bf-4cbe-86f7-6df56ba14657@linux.microsoft.com> From: Easwar Hariharan In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 3/18/2024 10:12 AM, Ani Sinha wrote: > > >>> + } >>> + >>> + if (strlen(output_str)) { >>> + output_str[strlen(output_str) - 1] = '\0'; >> >> You don't need this since you're using strncat which adds its own '\0'. > > If I understand this correctly, this code simply eliminates the extra “,” character in the end. Therefore it is needed. > Since it is not obvious, in the previous review and before, I asked the author to add a comment to explain this clearly. > >> I wasn't quite able to follow along >> on the discussion between Ani and you, so putting this in here in case it wasn't already mentioned. >> Ah, great, that makes sense. I did see that it was destroying data but didn't spend enough time to think through what data it was destroying, and if that was a feature or a bug. Thanks for calling it out! - Easwar