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 668D0403BD for ; Sun, 23 Jan 2022 19:55:49 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0D96D68AF9F; Sun, 23 Jan 2022 21:55:47 +0200 (EET) Received: from mail.comstyle.com (speedy.comstyle.com [206.51.28.2]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8F34A68AF78 for ; Sun, 23 Jan 2022 21:55:40 +0200 (EET) Received: from mail.comstyle.com (localhost [127.0.0.1]) by mail.comstyle.com (Postfix) with ESMTP id 4JhkPR1WjNz8PbN; Sun, 23 Jan 2022 14:55:39 -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=3f65NiYR+ usaizokBzJCA1zLfJ0=; b=rOyQjNZpvPAYhahXW9FD2DNivP4eGPB1QU8+a3nGq +uCb7KQQnJUsOm/bp6mY45xk8uSQWKYM4dvoL7ab714pGIKR5TE3VF7kjsMT5mnV j+XFDTj9s9/11K0lA1HXATwrPhNv5ItPYQp+9YA2toGtlwsgdxpO1BNiJEZ1SUPs tw= 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=Fiy pN5dadTBCJbKMQHwkidtYFQqmzmO75gKzBxh9tyJjb1Sz97WLdJSxHZYneW+Xp/O A+j++yATOE6qXAYfGxdPnB1AtiSIQRY8131CNMWKFL3NWPiQNJ8kGESHcyBdIzNa Le5SobqfV/cWFMH5yMnGkr1FiKlFfO0HMBN2h+2c= Received: from [192.168.6.68] (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 4JhkPR0glgz8PbK; Sun, 23 Jan 2022 14:55:39 -0500 (EST) Message-ID: Date: Sun, 23 Jan 2022 14:55:38 -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 , Michael Niedermayer References: <20220123115700.GB2829255@pb2> From: Brad Smith In-Reply-To: <20220123115700.GB2829255@pb2> 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/23/2022 6:57 AM, Michael Niedermayer wrote: > On Wed, Jan 12, 2022 at 12:13:13AM -0500, Brad Smith wrote: >> Fix setsockopt() usage on OpenBSD with IP_MULTICAST_TTL. The field >> type should be an unsigned char on anything but Linux. >> >> >> diff --git a/libavformat/udp.c b/libavformat/udp.c >> index 180d96a988..29aa865fff 100644 >> --- a/libavformat/udp.c >> +++ b/libavformat/udp.c >> @@ -163,7 +163,13 @@ static int udp_set_multicast_ttl(int sockfd, int mcastTTL, >> { >> #ifdef IP_MULTICAST_TTL >> if (addr->sa_family == AF_INET) { >> - if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &mcastTTL, sizeof(mcastTTL)) < 0) { >> +#ifdef __linux__ >> + int ttl = mcastTTL; >> +#else >> + unsigned char ttl = mcastTTL; >> +#endif > this "ifdef __linux__" feels like the wrong thing to check, dont you agree ? Not sure what you mean. But as I said in one of my other posts.. "FreeBSD, NetBSD, OpenBSD, DragonFlyBSD, macOS, Solaris, AIX, IRIX, HP-UX, QNX, Minix3 and a few others define the ttl parameter to IP_MULTICAST_TTL as an unsigned char. Linux has it as an integer." I looked for various examples of IP_MULTICAST_TTL usage in whatever projects I could find and most of the examples I found used only unsigned char, with BIRD (routing daemon) being one of few that use an int for Linux and unsigned char for *BSD's. It does not have support for any other OS's. _______________________________________________ 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".