Version in base suite: 1.2.1+dfsg-1 Base version: minidlna_1.2.1+dfsg-1 Target version: minidlna_1.2.1+dfsg-2+deb10u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/m/minidlna/minidlna_1.2.1+dfsg-1.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/m/minidlna/minidlna_1.2.1+dfsg-2+deb10u1.dsc changelog | 34 +++- compat | 1 control | 18 +- copyright | 10 - minidlna.conf | 2 minidlna.conf.5 | 10 - minidlna.default | 16 + minidlna.init | 12 - minidlna.logrotate | 2 minidlna.postrm | 2 minidlna.service | 22 ++ patches/0011-upnphttp-Disallow-negative-HTTP-chunk-lengths.patch | 43 +++++ patches/0012-upnphttp-Validate-SUBSCRIBE-callback-URL.patch | 85 ++++++++++ patches/14-fix-gcc10-ftbfs.patch | 26 +++ patches/15-use-newer-ip_multicast_if-api.patch | 68 ++++++++ patches/series | 4 rules | 2 source/lintian-overrides | 2 upstream/metadata | 2 19 files changed, 322 insertions(+), 39 deletions(-) diff -Nru minidlna-1.2.1+dfsg/debian/changelog minidlna-1.2.1+dfsg/debian/changelog --- minidlna-1.2.1+dfsg/debian/changelog 2017-08-26 22:12:26.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/changelog 2020-12-05 17:21:18.000000000 +0000 @@ -1,3 +1,36 @@ +minidlna (1.2.1+dfsg-2+deb10u1) buster-security; urgency=high + + * Add 0011-upnphttp-Disallow-negative-HTTP-chunk-lengths.patch + CVE-2020-28926 (Closes: #976595). + * Add 0012-upnphttp-Validate-SUBSCRIBE-callback-URL.patch + CVE-2020-12695 (Closes: #976594). + + -- Alexander GQ Gerasiov Sat, 05 Dec 2020 20:21:18 +0300 + +minidlna (1.2.1+dfsg-2) unstable; urgency=medium + + [ Alexander Gerasiov ] + * Add 14-fix-gcc10-ftbfs.patch: Fixes FTBFS with gcc10 (Closes: #957541). + * Move logs to /var/log/minidlna dir. + * Remove unused START_DAEMON var from default file (Closes: #879541). + * Add systemd service file (Closes: #950270). + * Bump debhelper's version to 12. + * Bump Standards-Version. + * d/control: Update Vcs headers. + * d/copyright: Secure links to format and homepage. + + [ Debian Janitor ] + * Trim trailing whitespace. + * debian/copyright: use spaces rather than tabs to start continuation lines. + * Update renamed lintian tag names in lintian overrides. + * Set upstream metadata fields: Archive, Repository. + + [ Alexander Gerasiov ] + * Add 15-use-newer-ip_multicast_if-api.patch: (Closes: #941410). + * d/control: Update description (Closes: #927393). + + -- Alexander GQ Gerasiov Mon, 04 May 2020 14:01:19 +0300 + minidlna (1.2.1+dfsg-1) unstable; urgency=medium * New upstream release. @@ -442,4 +475,3 @@ * Pre- and post- inst/rm scripts to add/remove a minidlna user and group -- Benoît Knecht Fri, 15 Oct 2010 00:32:01 +0200 - diff -Nru minidlna-1.2.1+dfsg/debian/compat minidlna-1.2.1+dfsg/debian/compat --- minidlna-1.2.1+dfsg/debian/compat 2017-08-26 22:08:56.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -9 diff -Nru minidlna-1.2.1+dfsg/debian/control minidlna-1.2.1+dfsg/debian/control --- minidlna-1.2.1+dfsg/debian/control 2017-08-26 22:08:56.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/control 2020-12-05 11:23:31.000000000 +0000 @@ -3,8 +3,7 @@ Priority: optional Maintainer: Alexander GQ Gerasiov Build-Depends: autopoint, - debhelper (>= 9), - dh-autoreconf, + debhelper-compat (= 12), libavcodec-dev, libavformat-dev, libavutil-dev, @@ -15,10 +14,10 @@ libogg-dev, libsqlite3-dev, libvorbis-dev -Standards-Version: 4.0.0 +Standards-Version: 4.5.0 Homepage: https://sourceforge.net/projects/minidlna/ -Vcs-Git: https://anonscm.debian.org/git/collab-maint/minidlna.git -Vcs-Browser: https://anonscm.debian.org/git/collab-maint/minidlna.git +Vcs-Git: https://salsa.debian.org/debian/minidlna.git +Vcs-Browser: https://salsa.debian.org/debian/minidlna.git Package: minidlna Architecture: any @@ -26,14 +25,15 @@ lsb-base, ${misc:Depends}, ${shlibs:Depends} +Pre-Depends: ${misc:Pre-Depends} Description: lightweight DLNA/UPnP-AV server targeted at embedded systems MiniDLNA (aka ReadyDLNA) is server software with the aim of being fully compliant with DLNA/UPnP-AV clients. . - The minidlna daemon serves media files (music, pictures, and video) - to clients on your network. Example clients include applications - such as totem and xbmc, and devices such as portable media players, - smartphones, and televisions. + The minidlna daemon serves media files (music, pictures, and video) to + clients on your network. Example clients include applications such as + totem and Kodi (xbmc), and devices such as portable media players, + smartphones, and televisions (common part of SmartTV kit). . MiniDLNA is a simple, lightweight alternative to mediatomb, but has fewer features. It does not have a web interface for administration diff -Nru minidlna-1.2.1+dfsg/debian/copyright minidlna-1.2.1+dfsg/debian/copyright --- minidlna-1.2.1+dfsg/debian/copyright 2017-08-26 22:08:56.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/copyright 2020-12-05 10:57:45.000000000 +0000 @@ -1,7 +1,7 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: minidlna Upstream-Contact: Justin Maggard -Source: http://sourceforge.net/projects/minidlna/files/ +Source: https://sourceforge.net/projects/minidlna/files/ The icons.c file in the original tarball contained binary blobs of possibly unfree images. It has hence been replaced in the DFSG tarball by a file containing the free Debian logo instead. It can be generated from the SVG logo @@ -30,8 +30,8 @@ Files: avahi.? Copyright: Daniel Stonier - Daniel S. Haischt - 2017, NETGEAR + Daniel S. Haischt + 2017, NETGEAR License: GPL-2 Files: codelength.h getifaddr.? minidlnapath.h minidlnatypes.h minissdp.? @@ -72,7 +72,7 @@ Files: debian/* Copyright: 2010-2014, Benoît Knecht - 2015, Alexander GQ Gerasiov + 2015, Alexander GQ Gerasiov License: BSD-3-clause Files: debian/minidlna.postinst debian/minidlna.postrm debian/minidlna.init diff -Nru minidlna-1.2.1+dfsg/debian/minidlna.conf minidlna-1.2.1+dfsg/debian/minidlna.conf --- minidlna-1.2.1+dfsg/debian/minidlna.conf 2017-08-26 22:08:56.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/minidlna.conf 2020-12-05 10:57:45.000000000 +0000 @@ -33,7 +33,7 @@ #db_dir=/var/cache/minidlna # Path to the directory that should hold the log file. -#log_dir=/var/log +#log_dir=/var/log/minidlna # Type and minimum level of importance of messages to be logged. # diff -Nru minidlna-1.2.1+dfsg/debian/minidlna.conf.5 minidlna-1.2.1+dfsg/debian/minidlna.conf.5 --- minidlna-1.2.1+dfsg/debian/minidlna.conf.5 2017-08-26 22:08:56.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/minidlna.conf.5 2020-12-05 10:57:45.000000000 +0000 @@ -81,7 +81,7 @@ Comma separated list of network interfaces to bind to. Default is empty which means bind to all. .It Cm log_dir Path to the directory where the log file should be stored. Defaults to -.Pa /var/log . +.Pa /var/log/minidlna . .It Cm log_level Defines the type of messages that should be logged, and down to which level of importance they should be considered. @@ -257,13 +257,15 @@ .Dq beacon method. .It Cm user -Specify the user name or UID to run as. Beware that if you are using the init script to start +Specify the user name or UID to run as. Beware that if you are using an init system to start .Nm minidlnad , -then this option has no effect and you should set +then this option has no effect and you should override default user in +.Pa minidlna.service +for systemd or set .Ev USER in .Pa /etc/default/minidlna -instead. +for sysV init. .It Cm uuid Specify device's UPnP UUID minidlna should use. By default MAC address is used to build uniq UUID. .It Cm wide_links diff -Nru minidlna-1.2.1+dfsg/debian/minidlna.default minidlna-1.2.1+dfsg/debian/minidlna.default --- minidlna-1.2.1+dfsg/debian/minidlna.default 2017-08-26 22:08:56.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/minidlna.default 2020-12-05 10:57:45.000000000 +0000 @@ -1,24 +1,26 @@ # Defaults for minidlna initscript -# sourced by /etc/init.d/minidlna -# installed at /etc/default/minidlna by the maintainer scripts +# sourced by minidlna.service and /etc/init.d/minidlna +# +# WARNING: This file is used for compatibility with sysv init only. +# If you are using systemd (Debian default), please override minidlna.service +# unit instead of modifying these variables. + # These options can be set to modify the behavior of the minidlna init script. # The options commented out show the default values. -# Start the daemon if set to "yes" -START_DAEMON="yes" - # Path to the configuration file #CONFIGFILE="/etc/minidlna.conf" # Path to the log file -#LOGFILE="/var/log/minidlna.log" +#LOGFILE="/var/log/minidlna/minidlna.log" # User and group the daemon should run as +# only for sysV init, for systemd please override minidlna.service #USER="minidlna" #GROUP="minidlna" # Additional options that are passed to the daemon # We pass -r option to do soft non-destructive rebuild on every start-up. # If your systerm restarts often, you might want to remove this. -DAEMON_OPTS="-r" +#DAEMON_OPTS="-r" diff -Nru minidlna-1.2.1+dfsg/debian/minidlna.init minidlna-1.2.1+dfsg/debian/minidlna.init --- minidlna-1.2.1+dfsg/debian/minidlna.init 2017-08-26 22:08:56.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/minidlna.init 2020-12-05 10:57:45.000000000 +0000 @@ -19,16 +19,15 @@ DESC="DLNA/UPnP-AV media server" NAME=minidlna DAEMON=/usr/sbin/minidlnad -PIDDIR=/run/$NAME -PIDFILE=$PIDDIR/$NAME.pid +PIDFILE=/run/$NAME/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME # Defaults (could be overridden in /etc/default/$NAME) CONFIGFILE=/etc/minidlna.conf -LOGFILE=/var/log/minidlna.log +LOGFILE=/var/log/$NAME/minidlna.log USER=minidlna GROUP=minidlna -DAEMON_OPTS="" +DAEMON_OPTS="-r" # Exit if the package is not installed [ -x "$DAEMON" ] || exit 0 @@ -55,8 +54,8 @@ # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started - touch $LOGFILE && chown $USER:$GROUP $LOGFILE || return 2 - mkdir -p $PIDDIR && chown $USER:$GROUP $PIDDIR || return 2 + mkdir -p "$(dirname "$LOGFILE")" && chown $USER:$GROUP "$(dirname "$LOGFILE")" || return 2 + mkdir -p "$(dirname "$PIDFILE")" && chown $USER:$GROUP "$(dirname "$PIDFILE")" || return 2 start-stop-daemon --start --quiet --pidfile $PIDFILE \ --chuid $USER:$GROUP --exec $DAEMON --test > /dev/null \ @@ -94,7 +93,6 @@ # do_rotate() { - touch $LOGFILE && chown $USER:$GROUP $LOGFILE || return 2 start-stop-daemon --stop --signal USR2 --quiet --pidfile $PIDFILE --exec $DAEMON return 0 } diff -Nru minidlna-1.2.1+dfsg/debian/minidlna.logrotate minidlna-1.2.1+dfsg/debian/minidlna.logrotate --- minidlna-1.2.1+dfsg/debian/minidlna.logrotate 2017-08-26 22:08:56.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/minidlna.logrotate 2020-12-05 10:57:45.000000000 +0000 @@ -1,4 +1,4 @@ -/var/log/minidlna.log +/var/log/minidlna/*.log { rotate 4 weekly diff -Nru minidlna-1.2.1+dfsg/debian/minidlna.postrm minidlna-1.2.1+dfsg/debian/minidlna.postrm --- minidlna-1.2.1+dfsg/debian/minidlna.postrm 2017-08-26 22:08:56.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/minidlna.postrm 2020-12-05 10:57:45.000000000 +0000 @@ -6,7 +6,7 @@ case "$1" in purge) rm -rf /var/cache/minidlna - rm -f /var/log/minidlna.log* + rm -f /var/log/minidlna.log* /var/log/minidlna ;; remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) diff -Nru minidlna-1.2.1+dfsg/debian/minidlna.service minidlna-1.2.1+dfsg/debian/minidlna.service --- minidlna-1.2.1+dfsg/debian/minidlna.service 1970-01-01 00:00:00.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/minidlna.service 2020-12-05 10:57:45.000000000 +0000 @@ -0,0 +1,22 @@ +[Unit] +Description=MiniDLNA lightweight DLNA/UPnP-AV server +Documentation=man:minidlnad(1) man:minidlna.conf(5) +After=network.target + +[Service] +Type=forking +User=minidlna +Group=minidlna + +Environment=CONFIGFILE=/etc/minidlna.conf +Environment=DAEMON_OPTS=-r +EnvironmentFile=-/etc/default/minidlna + +RuntimeDirectory=minidlna +LogsDirectory=minidlna +PIDFile=/run/minidlna/minidlna.pid +ExecStart=/usr/sbin/minidlnad -f $CONFIGFILE -P /run/minidlna/minidlna.pid $DAEMON_OPTS + + +[Install] +WantedBy=multi-user.target diff -Nru minidlna-1.2.1+dfsg/debian/patches/0011-upnphttp-Disallow-negative-HTTP-chunk-lengths.patch minidlna-1.2.1+dfsg/debian/patches/0011-upnphttp-Disallow-negative-HTTP-chunk-lengths.patch --- minidlna-1.2.1+dfsg/debian/patches/0011-upnphttp-Disallow-negative-HTTP-chunk-lengths.patch 1970-01-01 00:00:00.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/patches/0011-upnphttp-Disallow-negative-HTTP-chunk-lengths.patch 2020-12-05 17:21:18.000000000 +0000 @@ -0,0 +1,43 @@ +From: Justin Maggard +Date: Thu, 24 Sep 2020 08:55:36 -0700 +Subject: upnphttp: Disallow negative HTTP chunk lengths + +[CVE-2020-28926] + +This fixes a couple vulnerabilities that could lead to an infinite loop +or heap corruption. +--- + upnphttp.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/upnphttp.c b/upnphttp.c +index 3b4b58a..61864e3 100644 +--- a/upnphttp.c ++++ b/upnphttp.c +@@ -415,14 +415,14 @@ next_header: + return; + line += 2; + } +- if( h->reqflags & FLAG_CHUNKED ) ++ if (h->reqflags & FLAG_CHUNKED) + { + char *endptr; + h->req_chunklen = -1; +- if( h->req_buflen <= h->req_contentoff ) ++ if (h->req_buflen <= h->req_contentoff) + return; + while( (line < (h->req_buf + h->req_buflen)) && +- (h->req_chunklen = strtol(line, &endptr, 16)) && ++ (h->req_chunklen = strtol(line, &endptr, 16) > 0) && + (endptr != line) ) + { + endptr = strstr(endptr, "\r\n"); +@@ -866,7 +866,7 @@ ProcessHttpQuery_upnphttp(struct upnphttp * h) + char *chunkstart, *chunk, *endptr, *endbuf; + chunk = endbuf = chunkstart = h->req_buf + h->req_contentoff; + +- while( (h->req_chunklen = strtol(chunk, &endptr, 16)) && (endptr != chunk) ) ++ while ((h->req_chunklen = strtol(chunk, &endptr, 16)) > 0 && (endptr != chunk) ) + { + endptr = strstr(endptr, "\r\n"); + if (!endptr) diff -Nru minidlna-1.2.1+dfsg/debian/patches/0012-upnphttp-Validate-SUBSCRIBE-callback-URL.patch minidlna-1.2.1+dfsg/debian/patches/0012-upnphttp-Validate-SUBSCRIBE-callback-URL.patch --- minidlna-1.2.1+dfsg/debian/patches/0012-upnphttp-Validate-SUBSCRIBE-callback-URL.patch 1970-01-01 00:00:00.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/patches/0012-upnphttp-Validate-SUBSCRIBE-callback-URL.patch 2020-12-05 17:21:18.000000000 +0000 @@ -0,0 +1,85 @@ +From: Justin Maggard +Date: Wed, 23 Sep 2020 18:21:53 -0700 +Subject: upnphttp: Validate SUBSCRIBE callback URL + +The UPnP protocol specification mandates that subscribers can request a +callback to an arbitrary URL. This recently resulted in CVE-2020-12695 +(CallStranger) outlining the risk of information disclosure and DoS +attacks. + +This commit ensures that the callback URL sent in a SUBSCRIBE request +points to the same IP address that made the request. +--- + upnphttp.c | 29 +++++++++++++++++++++++------ + 1 file changed, 23 insertions(+), 6 deletions(-) + +diff --git a/upnphttp.c b/upnphttp.c +index 61864e3..e5f749a 100644 +--- a/upnphttp.c ++++ b/upnphttp.c +@@ -694,7 +694,7 @@ ProcessHTTPPOST_upnphttp(struct upnphttp * h) + static int + check_event(struct upnphttp *h) + { +- enum event_type type; ++ enum event_type type = E_INVALID; + + if (h->req_Callback) + { +@@ -702,7 +702,6 @@ check_event(struct upnphttp *h) + { + BuildResp2_upnphttp(h, 400, "Bad Request", + "Bad request", 37); +- type = E_INVALID; + } + else if (strncmp(h->req_Callback, "http://", 7) != 0 || + strncmp(h->req_NT, "upnp:event", h->req_NTLen) != 0) +@@ -711,10 +710,30 @@ check_event(struct upnphttp *h) + * If CALLBACK header is missing or does not contain a valid HTTP URL, + * the publisher must respond with HTTP error 412 Precondition Failed*/ + BuildResp2_upnphttp(h, 412, "Precondition Failed", 0, 0); +- type = E_INVALID; + } + else +- type = E_SUBSCRIBE; ++ { ++ /* Make sure callback URL points to the originating IP */ ++ struct in_addr addr; ++ char addrstr[16]; ++ int i = 0; ++ const char *p = h->req_Callback + 7; ++ while (!strchr("/:>", *p) && i < sizeof(addrstr) - 1 && ++ p < (h->req_Callback + h->req_CallbackLen)) ++ { ++ addrstr[i++] = *(p++); ++ } ++ addrstr[i] = '\0'; ++ ++ if (inet_pton(AF_INET, addrstr, &addr) <= 0 || ++ memcmp(&addr, &h->clientaddr, sizeof(struct in_addr))) ++ { ++ DPRINTF(E_ERROR, L_HTTP, "Bad callback IP (%s)\n", addrstr); ++ BuildResp2_upnphttp(h, 412, "Precondition Failed", 0, 0); ++ } ++ else ++ type = E_SUBSCRIBE; ++ } + } + else if (h->req_SID) + { +@@ -723,7 +742,6 @@ check_event(struct upnphttp *h) + { + BuildResp2_upnphttp(h, 400, "Bad Request", + "Bad request", 37); +- type = E_INVALID; + } + else + type = E_RENEW; +@@ -731,7 +749,6 @@ check_event(struct upnphttp *h) + else + { + BuildResp2_upnphttp(h, 412, "Precondition Failed", 0, 0); +- type = E_INVALID; + } + + return type; diff -Nru minidlna-1.2.1+dfsg/debian/patches/14-fix-gcc10-ftbfs.patch minidlna-1.2.1+dfsg/debian/patches/14-fix-gcc10-ftbfs.patch --- minidlna-1.2.1+dfsg/debian/patches/14-fix-gcc10-ftbfs.patch 1970-01-01 00:00:00.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/patches/14-fix-gcc10-ftbfs.patch 2020-12-05 17:21:18.000000000 +0000 @@ -0,0 +1,26 @@ +--- a/metadata.c ++++ b/metadata.c +@@ -484,12 +484,12 @@ + } + + /* For libjpeg error handling */ +-jmp_buf setjmp_buffer; ++jmp_buf metadata_setjmp_buffer; + static void + libjpeg_error_handler(j_common_ptr cinfo) + { + cinfo->err->output_message (cinfo); +- longjmp(setjmp_buffer, 1); ++ longjmp(metadata_setjmp_buffer, 1); + return; + } + +@@ -613,7 +613,7 @@ + cinfo.err = jpeg_std_error(&jerr); + jerr.error_exit = libjpeg_error_handler; + jpeg_create_decompress(&cinfo); +- if( setjmp(setjmp_buffer) ) ++ if( setjmp(metadata_setjmp_buffer) ) + goto error; + jpeg_stdio_src(&cinfo, infile); + jpeg_read_header(&cinfo, TRUE); diff -Nru minidlna-1.2.1+dfsg/debian/patches/15-use-newer-ip_multicast_if-api.patch minidlna-1.2.1+dfsg/debian/patches/15-use-newer-ip_multicast_if-api.patch --- minidlna-1.2.1+dfsg/debian/patches/15-use-newer-ip_multicast_if-api.patch 1970-01-01 00:00:00.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/patches/15-use-newer-ip_multicast_if-api.patch 2020-12-05 17:21:18.000000000 +0000 @@ -0,0 +1,68 @@ +From 43573257e45728e070a5f30bd74648c86537e625 Mon Sep 17 00:00:00 2001 +From: Gleb Smirnoff +Date: Wed, 19 Dec 2018 19:06:26 -0800 +Subject: [PATCH] Use newer API for IP_MULTICAST_IF which allows one to specify + interface by index, not by address. Introduced in Linux 3.5, it IMHO should + be available on all systems that declare struct ip_mreqn. + +This fixes operation failure when a system has multiple interfaces +with same address, but only on of them is desired. Example: + +> grep interface /usr/local/etc/minidlna.conf +network_interface=igb0 +> ifconfig igb0 +igb0: flags=8843 metric 0 mtu 1500 + ether 0c:c4:7a:xx:xx:xx + inet 10.1.10.3 netmask 0xffffff00 broadcast 10.1.10.255 + media: Ethernet autoselect (1000baseT ) + status: active +> ifconfig ng0 +ng0: flags=88d1 metric 0 mtu 1454 + inet 10.1.10.3 --> 10.1.10.2 netmask 0xffffffff + +In such configuration, ng0 would be chosen before this fix. +--- + minissdp.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/minissdp.c b/minissdp.c +index 79f53c4..0e9c68a 100644 +--- a/minissdp.c ++++ b/minissdp.c +@@ -145,7 +145,11 @@ OpenAndConfSSDPNotifySocket(struct lan_addr_s *iface) + int s; + unsigned char loopchar = 0; + uint8_t ttl = 4; ++#ifdef HAVE_STRUCT_IP_MREQN ++ struct ip_mreqn imr; ++#else + struct in_addr mc_if; ++#endif + struct sockaddr_in sockname; + + s = socket(PF_INET, SOCK_DGRAM, 0); +@@ -155,8 +159,6 @@ OpenAndConfSSDPNotifySocket(struct lan_addr_s *iface) + return -1; + } + +- mc_if.s_addr = iface->addr.s_addr; +- + if (setsockopt(s, IPPROTO_IP, IP_MULTICAST_LOOP, (char *)&loopchar, sizeof(loopchar)) < 0) + { + DPRINTF(E_ERROR, L_SSDP, "setsockopt(udp_notify, IP_MULTICAST_LOOP): %s\n", strerror(errno)); +@@ -164,7 +166,14 @@ OpenAndConfSSDPNotifySocket(struct lan_addr_s *iface) + return -1; + } + +- if (setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF, (char *)&mc_if, sizeof(mc_if)) < 0) ++#ifdef HAVE_STRUCT_IP_MREQN ++ imr.imr_address = iface->addr; ++ imr.imr_ifindex = iface->ifindex; ++ if (setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF, &imr, sizeof(imr)) < 0) ++#else ++ mc_if = iface->addr; ++ if (setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF, &mc_if, sizeof(mc_if)) < 0) ++#endif + { + DPRINTF(E_ERROR, L_SSDP, "setsockopt(udp_notify, IP_MULTICAST_IF): %s\n", strerror(errno)); + close(s); diff -Nru minidlna-1.2.1+dfsg/debian/patches/series minidlna-1.2.1+dfsg/debian/patches/series --- minidlna-1.2.1+dfsg/debian/patches/series 2017-08-26 22:08:56.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/patches/series 2020-12-05 17:21:18.000000000 +0000 @@ -6,3 +6,7 @@ 07-fix-multi-artist-album-handling.patch 10-db_dir-should-not-affect-log_dir.patch 13-missing-ru-po.patch +14-fix-gcc10-ftbfs.patch +15-use-newer-ip_multicast_if-api.patch +0011-upnphttp-Disallow-negative-HTTP-chunk-lengths.patch +0012-upnphttp-Validate-SUBSCRIBE-callback-URL.patch diff -Nru minidlna-1.2.1+dfsg/debian/rules minidlna-1.2.1+dfsg/debian/rules --- minidlna-1.2.1+dfsg/debian/rules 2017-08-26 22:08:56.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/rules 2020-12-05 11:23:31.000000000 +0000 @@ -10,4 +10,4 @@ dh_installchangelogs NEWS override_dh_auto_configure: - dh_auto_configure -- --with-os-version=$(shell cut -d" " -f1 /etc/issue.net) + dh_auto_configure -- --with-os-version=$(shell cut -d" " -f1 /etc/issue.net) --with-log-path=/var/log/minidlna diff -Nru minidlna-1.2.1+dfsg/debian/source/lintian-overrides minidlna-1.2.1+dfsg/debian/source/lintian-overrides --- minidlna-1.2.1+dfsg/debian/source/lintian-overrides 2017-08-26 22:08:56.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/source/lintian-overrides 2020-12-05 10:57:45.000000000 +0000 @@ -1,2 +1,2 @@ # Upstream doesn't sign its source tarballs: -minidlna source: debian-watch-may-check-gpg-signature +minidlna source: debian-watch-does-not-check-gpg-signature diff -Nru minidlna-1.2.1+dfsg/debian/upstream/metadata minidlna-1.2.1+dfsg/debian/upstream/metadata --- minidlna-1.2.1+dfsg/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ minidlna-1.2.1+dfsg/debian/upstream/metadata 2020-12-05 10:57:45.000000000 +0000 @@ -0,0 +1,2 @@ +Archive: SourceForge +Repository: https://git.code.sf.net/p/minidlna/git/