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 73760403AE for ; Sun, 23 Jan 2022 14:12:22 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 145CB68AF97; Sun, 23 Jan 2022 16:12:20 +0200 (EET) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 71D3668AF75 for ; Sun, 23 Jan 2022 16:12:13 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 872E4E600A for ; Sun, 23 Jan 2022 15:12:12 +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 FeVupcNlbOpS for ; Sun, 23 Jan 2022 15:12:07 +0100 (CET) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id 92BE6E58C6 for ; Sun, 23 Jan 2022 15:12:07 +0100 (CET) Date: Sun, 23 Jan 2022 15:12:07 +0100 (CET) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: <20220123115700.GB2829255@pb2> Message-ID: <68d41af3-c89c-deb1-339a-b4cbe9847ff@passwd.hu> References: <20220123115700.GB2829255@pb2> MIME-Version: 1.0 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 Sun, 23 Jan 2022, 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 ? As far as I remember linux supports both sizes. So maybe just remove the check entirely? Regards, 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".