Commit Graph

99 Commits

Author SHA1 Message Date
Thomas Bernard
0af141d9c5
miniupnpd: fix processing of v4 M-SEARCH received on v6 socket
So we don't answer with the v6 LOCATION to v4 clients anymore !

should fix #467
see #461
2020-06-05 22:39:59 +02:00
Thomas Bernard
bc645c108d
same fix as 827fc6f04 for SendSSDPGoodbye()
see #459
2020-06-02 09:08:59 +02:00
Thomas Bernard
827fc6f041
miniupnpd: prevent buffer overread of known_devices_types
should fix #459
2020-05-29 18:01:39 +02:00
Thomas Bernard
7800de9429
miniupnpd: fix for bridges
you now can setup :
listening_ip=igb1 bridge0 xxx0 xxx1 ...

miniupnpd will use igd1 address, but will not complain when receiving
packets from either igb1, bridge0, xxx0 or xxx1

fixes #379
see also #408
2020-04-29 00:03:54 +02:00
Thomas Bernard
a87011f933 fix checking of "~Man:" header"
bug introduced in 3571a41d1b
2019-10-06 00:17:52 +02:00
Thomas Bernard
1976452125 handle both IP_PKTINFO and IP_RECVIF defined.
fixes #391
2019-09-24 12:26:57 +02:00
Vladislav Grishenko
08b80d5abd miniupnpd: fix ssdp notify on unrelated interfaces
If several different interfaces share same ipv4 address on different
subnets (i.e. eth0 192.168.1.1/24 + eth1 192.168.1.1/16), miniupnpd
may pick any one of them, possibly wrong one w/o respecting exact
listening_ip interface.

syslog will contain something similar to:
    miniupnpd: sendto(udp_notify=6, 192.168.1.1): No such device
    miniupnpd: sendto(udp_notify=6, 192.168.1.1): No such device
    miniupnpd: try_sendto(sock=6, len=464, dest=239.255.255.250:1900): sendto: No such device
    miniupnpd: try_sendto(sock=6, len=464, dest=239.255.255.250:1900): sendto: No such device
    miniupnpd: try_sendto failed to send 11 packets

Fix that with specifying exact outgoing mcast interface for each
notify socket with help of IP_MULTICAST_IF/mreqn struct.
Since OpenAndConfSSDPNotifySocket() now takes lan_addr_s struct,
OpenAndConfSSDPNotifySocketIPv6() was similary changed for api
consistency.
2019-05-02 15:36:06 +05:00
Thomas Bernard
2ffc7afae9 minissdp.c: fix indentation 2019-05-02 12:09:28 +02:00
Steven Mestdagh
f6fc66ee41
avoid off-by-one buffer overread
similar to commit 9fcc0a72f0
2018-12-06 00:11:21 +01:00
Thomas Bernard
0366cd0ba0 replace strlen(s) > 0 by s[0] != '\0'
see #292
2018-04-22 21:21:58 +02:00
Thomas Bernard
1fe8d21cf2 fixes #272 2018-04-12 10:49:53 +02:00
Thomas Bernard
9516c9a007 miniupnpd: fix warnings 2018-03-13 11:53:33 +01:00
Thomas Bernard
7f17837253 miniupnpd/minissdp.c: Fix submission of services to minissdpd
Version was hardcoded to 1 in "ST:"
2018-02-03 18:14:31 +01:00
Thomas Bernard
718deea11e Update file headers. 2017 => 2018 etc. 2018-01-16 02:06:46 +01:00
yangfl
d492fa39ef fix typo 2018-01-09 09:33:31 +08:00
Thomas Bernard
9fcc0a72f0 minissdpc.c: Fix buffer overrun in SSDP packet parsing
fixes #267

there were several errors in ProcessSSDPData()
in the parsing of ST: MX: and MAN: headers
so a few bytes could be read after the end of the buffer.
2017-12-12 10:42:54 +01:00
Thomas Bernard
5923d5de6f => 2017 2017-05-27 10:25:53 +02:00
Thomas Bernard
11fcf5a008 Merge branch 'master' into randomize_url 2017-05-26 17:30:18 +02:00
Thomas Bernard
50d21a38d0 SSDP: use receiving interface index to check if from LAN 2017-05-25 00:44:29 +02:00
Thomas Bernard
9303816a5b check receiving interface index when receiving SSDP 2017-05-25 00:44:12 +02:00
Thomas Bernard
6ed6b4e607 minissdp.c: const int on = 1; for setsockopt() arg 2017-05-24 11:04:20 +02:00
Thomas Bernard
57a74f2739 Merge branch 'master' into randomize_url 2017-04-21 11:33:25 +02:00
Thomas Bernard
0cc906169a use LinkLocal address for HTTP when needed
should fix #229

should be tested...
2017-03-13 13:01:00 +01:00
Thomas Bernard
3571a41d1b Fix UDA-1.2.10 Man header empty or invalid 2016-12-23 12:12:49 +01:00
Thomas Bernard
144eeefd19 Merge branch 'master' into randomize_url
Conflicts:
	miniupnpd/genconfig.sh
	miniupnpd/testupnpdescgen.c
	miniupnpd/upnpdescgen.c
	miniupnpd/upnpglobalvars.c
	miniupnpd/upnpglobalvars.h
2016-11-11 18:01:35 +01:00
Thomas Bernard
36c4c0ded4 do not use multicast global scope 2016-02-19 14:20:45 +01:00
Thomas Bernard
984a6f144e set IPv6 Hop limit to 10 2016-02-19 14:20:31 +01:00
Thomas Bernard
9e31ceb630 add --disable-pppconn genconfig.sh option to disable WANPPPConnection
fixes #176
2015-12-13 15:57:49 +01:00
Thomas Bernard
e97be7f37f add comments to previous commit 2015-12-12 08:47:06 +01:00
Daniel Becker
1cc3d1a5fa advertise correct service and device versions when IGDv2 is enabled 2015-12-11 18:08:18 -08:00
Thomas Bernard
3bd1886d2a move SSDP_PACKET_MAX_LEN to config.h
also set it to 1024 by default. See #129
2015-10-24 13:11:31 +02:00
Thomas Bernard
fde90d221b fix typo in "urn" (url) 2015-09-14 23:35:14 +02:00
Thomas Bernard
a8f80040c9 Randomize URLs to avoid http://www.filet-o-firewall.com/ 2015-09-14 12:10:15 +02:00
Thomas Bernard
5873c5a6b4 miniupnpd: improve warning log 2015-08-26 10:04:23 +02:00
Thomas Bernard
f8f5f2eb97 miniupnpd: bind to device using SO_BINDTODEVICE 2015-08-26 09:46:05 +02:00
Thomas Bernard
0cf182e51e miniupnpd: remove int_if_name, use ip_mreqn if available 2015-08-25 20:33:47 +02:00
Timothy Redaelli
138ec9e972 miniupnpd: Bind to device
This is needed when you have two interfaces with the same IP address
(for example using tinc)
2015-08-21 16:05:26 +02:00
Chocobo1
24307d2951 Comparing array address with 0 is not useful, use strlen() instead 2015-06-24 16:24:01 +08:00
Chocobo1
61289d42fb Correctly terminate the string 2015-06-24 16:24:01 +08:00
Thomas Bernard
2a08805783 minissdp.c: Dont try to close sockets with fd=-1
fixes #112
2015-04-28 09:08:35 +02:00
Thomas Bernard
241ede9ddf miniupnpd: improve (some) logs 2015-01-20 14:13:18 +01:00
Thomas Bernard
f795af5f54 2014 => 2015 2015-01-20 14:12:10 +01:00
Thomas Bernard
8baf8d351a miniupnpd/minissdp.c: Remove warning (caused by double const) 2014-10-22 13:57:24 +02:00
Thomas Bernard
447bad32c9 miniupnpd/minissdp.c: Add documentation to SSDPNotify* functions 2014-10-22 12:11:34 +02:00
Thomas Bernard
aef2c0a3b4 miniupnpd/minissdp.c: fix 50e370abcd
while() => for() / reindent/etc
2014-10-22 12:10:30 +02:00
Thomas Bernard
ac816e91f9 Merge branch 'master' into mcast_ssdp 2014-10-22 11:47:46 +02:00
Thomas Bernard
9194b02071 miniupnpd/minissdp.c: comments about binding "notify" sockets
Explain why bind() is called in functions
OpenAndConfSSDPNotifySocket and OpenAndConfSSDPNotifySocketIPV6
2014-10-22 11:43:42 +02:00
Thomas Bernard
55c959247b miniupnpd/minissdp.c: remove warning if ipv6 is disabled 2014-10-06 14:44:23 +02:00
Thomas Bernard
1961868cd5 miniupnpd/minissdp.c: add a default delay before SSDP response
fixes #084
2014-08-01 12:30:55 +02:00
Thomas Bernard
50e370abcd miniupnpd/minissdp.c: Send SSDP announces to IPv6 link-local, site-local and global multicast addresses 2014-05-23 17:05:15 +02:00