From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id BC7D340CC9 for ; Sun, 6 Feb 2022 22:15:28 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CC2B868B1BD; Mon, 7 Feb 2022 00:15:26 +0200 (EET) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8945F68AFBA for ; Mon, 7 Feb 2022 00:15:20 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 7CD6EE6532 for ; Sun, 6 Feb 2022 23:15:20 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id svkmwfHJuR-h for ; Sun, 6 Feb 2022 23:15:18 +0100 (CET) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id B78EEE63F3 for ; Sun, 6 Feb 2022 23:15:18 +0100 (CET) Date: Sun, 6 Feb 2022 23:15:18 +0100 (CET) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: <20220206020933.GA29837@gmail.com> Message-ID: <67dbd414-60b3-f272-80cf-50822420d811@passwd.hu> References: <1643260580-25792-1-git-send-email-lance.lmwang@gmail.com> <1644038899-15433-1-git-send-email-lance.lmwang@gmail.com> <1644038899-15433-2-git-send-email-lance.lmwang@gmail.com> <20220206020933.GA29837@gmail.com> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v2 2/3] avformat/udp: Fix IP_MULTICAST_TTL for BSD compatibility X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Sun, 6 Feb 2022, lance.lmwang@gmail.com wrote: > On Sat, Feb 05, 2022 at 01:26:18PM -0800, Chad Fraleigh wrote: >> Since any [valid] value over 255 is impossible in the IPv4 protocol (the TTL field is only 8-bits), it should always be capped at 255 (for consistency) or return an invalid value error (the one I would suggest). >> > > zhilizhao have submit a patch to limit the range of ttl from option. Do you want > to return an invalid error here still? I have applied the patch, so capping is no longer needed. > > >> Despite VLC's reversed comment, using an int seems to be the exception >> to the rule (i.e. only linux and windows seem to use it >> [as-documented]), perhaps doing the unsigned char first and using the >> int as the fallback would be better? It's not really just a BSD thing, >> unless you also count LWIP and Solaris as BSD. Unless VLC's code >> history shows them doing it this way at one time and swapping it (but >> forgetting the comment) to fix a known bug? >> > > I have blamed vlc code and sure the code doing it this way at one time(104938796a3). > For the mismatch of code and comments, I prefer to code always as code were build > and used by all kinds of system which vlc is supported already. > Yeah, I agree, if we are copying VLC approach then probably it makes more sense to use the same order as they do in their code. Thanks, Marton _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".