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 2732840584 for ; Wed, 26 Jan 2022 01:10:18 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BD5F968B06F; Wed, 26 Jan 2022 03:10:15 +0200 (EET) Received: from mail.comstyle.com (speedy.comstyle.com [206.51.28.2]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D446868ACAE for ; Wed, 26 Jan 2022 03:10:08 +0200 (EET) Received: from mail.comstyle.com (localhost [127.0.0.1]) by mail.comstyle.com (Postfix) with ESMTP id 4Jk5HL2bb8z8PbN; Tue, 25 Jan 2022 20:10:06 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=comstyle.com; h=message-id :date:mime-version:subject:to:references:from:in-reply-to :content-type:content-transfer-encoding; s=default; bh=vq4Y7jNY8 iYbLqCsSKtKQGhD6l4=; b=pl5ME+IKdGe6ejelW8ByXxY0ERkKJCQ1W2MlItKqE BHfKkexrFwXc+CkXCTilAR0M4MlBAaHTmNZX0e7X8tGZkA2lX/9sh0M/xPgrDM4D oT4UCVYiTvfPWc0oJFjmPAz3wfLQM/Dt0xfRXW+c33wRC5UMFYjsk6ycKi6mWPEf E8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=comstyle.com; h=message-id :date:mime-version:subject:to:references:from:in-reply-to :content-type:content-transfer-encoding; q=dns; s=default; b=fmZ 6wBodFlk07fomWFwuObbzOtQkk3Z9BEnMUTrN1d5Ek1A49TBfAxYi7B4GAPVCdJi t3JqDnqHTfjjBKyQjnIlvjb3zu18IHHk0951X+f3YkEvG7pKA/N3foqJFnyahqMd gHMYmrJKMWPkudkFKP6s1L/J87wJRV0d0c3xoV38= Received: from [192.168.6.70] (bras-base-toroon2719w-grc-53-142-114-5-252.dsl.bell.ca [142.114.5.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: brad) by mail.comstyle.com (Postfix) with ESMTPSA id 4Jk5HL1qdSz8PbK; Tue, 25 Jan 2022 20:10:06 -0500 (EST) Message-ID: <99224d20-d310-a213-662c-3191f4010c0d@comstyle.com> Date: Tue, 25 Jan 2022 20:10:05 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Thunderbird/97.0 Content-Language: en-US To: FFmpeg development discussions and patches , Chad Fraleigh References: <20220125072514.GA19401@gmail.com> <8e52c403-c58c-98d0-ccca-e5549c9d88ea@triularity.org> From: Brad Smith In-Reply-To: <8e52c403-c58c-98d0-ccca-e5549c9d88ea@triularity.org> Subject: Re: [FFmpeg-devel] [PATCH] Fix setsockopt IP_MULTICAST_TTL on OpenBSD 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 1/25/2022 7:28 PM, Chad Fraleigh wrote: > Since apparently linux will auto-detect (as mentioned by Marton Balint), based on the optlen parameter, just using unsigned char in all cases seems to be the cleanest. However, I would advise including a comment in the code to that effect which says to ignore the [outdated] linux documentation (so someone doesn't needlessly "correct" it in the future). > > I looked at the kernel source and it does work both ways: > > static int do_ip_setsockopt(struct sock *sk, int level, int optname, > sockptr_t optval, unsigned int optlen) > { > ... > switch (optname) { > ... > case IP_MULTICAST_TTL: > ... > if (optlen >= sizeof(int)) { > if (copy_from_sockptr(&val, optval, sizeof(val))) > return -EFAULT; > } else if (optlen >= sizeof(char)) { > unsigned char ucval; > > if (copy_from_sockptr(&ucval, optval, sizeof(ucval))) > return -EFAULT; > val = (int) ucval; > } > } > ... > } > > This check has been in the kernel since at least 2.6.12-rc2 (from Apr 2005). It should work fine, unless newer ffmpeg builds support is needed on older systems. So the only question is how old are the kernels in IoT and android devices which might use the current ffmpeg? Thanks. This would he much simpler. The oldest Android, 1.5, uses the 2.6.27 kernel. The oldest still supported Android, 4.4, uses the 3.10 kernel. I cannot imagine anyone shipping anything older than a 3.x (something like 3.18) kernel on anything IoT that is still supported and wanting to ship up to date software. _______________________________________________ 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".