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 2E5E6405E0 for ; Wed, 26 Jan 2022 15:36:44 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0433A68B040; Wed, 26 Jan 2022 17:36:43 +0200 (EET) Received: from mail.comstyle.com (speedy.comstyle.com [206.51.28.2]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 63EFA68AEBD for ; Wed, 26 Jan 2022 17:36:36 +0200 (EET) Received: from mail.comstyle.com (localhost [127.0.0.1]) by mail.comstyle.com (Postfix) with ESMTP id 4JkSW70Cg1z8PbN for ; Wed, 26 Jan 2022 10:36:35 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=comstyle.com; h=date:from :to:subject:message-id:references:mime-version:content-type :in-reply-to; s=default; bh=OVMVgK4dcGXRWFuE7IeXcjfr+QA=; b=X8BV BbYZKcbC3eandavqQ3sOvmJT7z57F3CxeL4aeK8Hp/ZrkSw4mnBRHCUXQA0u1EA0 OgXIDxdbeTXJCGOG1T5h9yX6TX+EVz/aIQdezE9KZZNGRqBNkmkzN0f+iRa6f71v VcJWH78LqyuA95iohdtkEBY6ArPucAxYa5M9AaI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=comstyle.com; h=date:from:to :subject:message-id:references:mime-version:content-type :in-reply-to; q=dns; s=default; b=dHglOlo+Hn/9nYeRJsme2PQoeiakJb KphhUvMf9advH/vfuSQOx23swhjTksMw00Za/3wd4VOBGs5SO2rUHLzmeErEuDzY Vye+HaYUQuzSP2E4QNZhKHsVUMFVeJzJvjtVYQ0gkj7+6eGRDilfuzih236ifJbL YR+bUYZ91yA4M= Received: from humpty.home.comstyle.com (bras-base-toroon2719w-grc-53-142-114-5-252.dsl.bell.ca [142.114.5.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: brad) by mail.comstyle.com (Postfix) with ESMTPSA id 4JkSW66fpVz8PbK for ; Wed, 26 Jan 2022 10:36:34 -0500 (EST) Date: Wed, 26 Jan 2022 10:36:33 -0500 From: Brad Smith To: FFmpeg development discussions and patches Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Wed, Jan 12, 2022 at 12:13:14AM -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. Based on feedback so far. Here is a much simpler approach to this issue.. diff --git a/libavformat/udp.c b/libavformat/udp.c index 83c042d079..da1b98890b 100644 --- a/libavformat/udp.c +++ b/libavformat/udp.c @@ -164,7 +164,9 @@ 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) { + unsigned char ttl = mcastTTL; /* ignore the outdated Linux documentation */ + + if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)) < 0) { ff_log_net_error(logctx, AV_LOG_ERROR, "setsockopt(IP_MULTICAST_TTL)"); return ff_neterrno(); } _______________________________________________ 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".