From patchwork Wed Jan 12 05:13:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Smith X-Patchwork-Id: 33271 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp4329320iog; Tue, 11 Jan 2022 21:13:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAq+sDQy6Dhu4ak+TVyZX2tTbTJPK2APgrcuwkd4PYKkRM2HYvQd9XPoyJO2UUnz5d1E70 X-Received: by 2002:a17:907:7d8a:: with SMTP id oz10mr1628944ejc.320.1641964405900; Tue, 11 Jan 2022 21:13:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641964405; cv=none; d=google.com; s=arc-20160816; b=v/XfHtt/IJYINdlBH5IXtD7a86Rm8sYIreICsMDT+rcdKu60lOiQgrxuIl656NVWeJ UXYxZrZTqj6ZoFwhzZBMWTrj27DpUjD6L5LquKvb7onNilK4ujkov/Em/xCkdcqJVThA 1yGh2UP2own1Q4jsdu2FQGM7qHzCByz0As/ZfT3g9EAwjXx4HgRTxOQEot8/MH95TuYk pZwIoILzcrMkJWquEU6efOYs+VILlBEUXGAE7VjJRTHQXhtbHt5KV3GiJDoB3DaJbSmE ITyGosZiBCNGjqE7OUKWFaYHL6KSCfW9iWR2eaRGPkAcc92gVyL4krBOtjj9EEvroVkk rUSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-disposition:mime-version:message-id:to :from:date:domainkey-signature:dkim-signature:delivered-to; bh=e9TiZuzpLoVQYP/u7J30kNx6MTbKR348ZFcP5OeNShA=; b=p3UmqwX1rZsdUZzQiJKdEpCGarX4BPTcv/J9HECT14N8Ic/FWX73QSZlMepiZagWdk oA+lt5fgKIbyb7bP1zA8pmm/4XfBDJjrYoGLBuVSqOCzZtKbPEhfTYaGoU482uPuso6/ J9ozqiB8xhF1qGmipvjZ90jaBrQRP8YDJABxtb/oEBv5ImW4TffDsXx7b66mtMSXKXsC Q8cGo4gEtr5MUiJQ7p2eLWCjHVCAr/3z+s/NnLDnkjDduyJ/w4DunNN/DzOHm6MjZ7EY Anqmsj2Tzye90DPkO20/SAEm+5t49nzwCpfWRRy5wNfMHQHbAeJ3N4rtbWb8tG5CT9RW 8uEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@comstyle.com header.s=default header.b=bGqavImX; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id k12si5616454edq.290.2022.01.11.21.13.25; Tue, 11 Jan 2022 21:13:25 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@comstyle.com header.s=default header.b=bGqavImX; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D79E668AA6E; Wed, 12 Jan 2022 07:13:21 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.comstyle.com (speedy.comstyle.com [206.51.28.2]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CA2EF680BBE for ; Wed, 12 Jan 2022 07:13:15 +0200 (EET) Received: from mail.comstyle.com (localhost [127.0.0.1]) by mail.comstyle.com (Postfix) with ESMTP id 4JYbLL4Lmfz8PbN for ; Wed, 12 Jan 2022 00:13:14 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=comstyle.com; h=date:from :to:subject:message-id:mime-version:content-type; s=default; bh= tCKqHszOz5EYL5kx7RGvf08t01Q=; b=bGqavImXieJkenYZ8YD++9kzDj3lkIso 9XVJgGgP/PZ3J7mMFzKv3XlhlpYYLJXckZ4blPuQpWf2lbBN8mQf8D86W6G5n9ff QXXQ+6R6Dn2FuRJx6FRtIUSgtUb/02isHTA45tYsWyepg9A+HxKCVTTImVXkTXrx HhUkFJqpL88= DomainKey-Signature: a=rsa-sha1; c=nofws; d=comstyle.com; h=date:from:to :subject:message-id:mime-version:content-type; q=dns; s=default; b= mjTYNb3Bd3jBMaUJkXSzBKufhrQF0sp6M4qTbaxLXkl9BxA0XDi1RkQk+PIAxWFD r2THiD3Y6D/t0S8o+ZwFGBX2KmuwGFP4a26na5YQo/M8GzN6L+TjQvi2PmbRcq/g 5p2lov8vBhrjUDWADwXOU+zrLlX7Uo2+T3LoQ2/3eto= 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 4JYbLL3bCcz8PbK for ; Wed, 12 Jan 2022 00:13:14 -0500 (EST) Date: Wed, 12 Jan 2022 00:13:13 -0500 From: Brad Smith To: FFmpeg development discussions and patches Message-ID: MIME-Version: 1.0 Content-Disposition: inline Subject: [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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: uuxvVFvrAwsT 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 + + if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)) < 0) { ff_log_net_error(NULL, AV_LOG_ERROR, "setsockopt(IP_MULTICAST_TTL)"); return ff_neterrno(); }