Commit Graph

74 Commits

Author SHA1 Message Date
yangfl 2ff8cb17da miniupnpd: Add option to match rules with regex
Some reports that a certain app is abusing UPnP for exploiting upload
bandwidth. This commit adds support to restrict UPnP rules to a regex.
By matching requester's description string against rule's regex, this
will make some obstacles for that app.
2022-10-21 21:26:39 +02:00
Thomas Bernard a4e12c01c4
miniupnpd: move READNU32/WRITENU32/etc. to rw_unaligned.h 2022-10-16 07:54:38 +02:00
Thomas Bernard fa190f294a
pcpserver.c: fix type LOG_WARN => LOG_WARNING
fixes #620
2022-08-25 23:52:23 +02:00
Thomas Bernard b8d66c5f7c
pcpserver.c: rewrite DeletePCPMap() to work with netfilter_nft
try to fix #611
2022-07-01 07:15:36 +02:00
Thomas Bernard 16366f5db4 add debug logs in DeletePCPMap 2022-06-19 19:41:32 +02:00
Thomas Bernard b734f94bdf pcpserver.c: improve DeletePCPMap() error message 2022-05-18 11:25:32 +02:00
Thomas Bernard f151cc1dd4
minor checks on PCPSendUnsolicitedAnnounce() 2020-06-04 00:56:16 +02:00
Thomas Bernard 351b28c5ad
Fix PCPSendUnsolicitedAnnounce() when IPv6 is not available
IPV6 can be enabled at compile time but unavailable at runtime
see https://miniupnp.tuxfamily.org/forum/viewtopic.php?t=2395
2019-12-18 01:18:56 +01:00
Thomas Bernard a1ceec3dba
miniupnpd: Allow to use two different network interfaces for IPv4 and IPv6 internet
-i / -I
ext_ifname= / ext_ifname6=

see :
df906367be/
thanks to "sfstudio"
2019-05-21 10:42:40 +02:00
Thomas Bernard cb8a02af7a
pcpserver.c: copyIPv6IfDifferent() check for NULL src argument 2018-12-18 23:04:14 +01:00
Thomas Bernard 95d707a71f
pcpserver.c: properly fill the opcode field of response
fixes #327
2018-09-07 17:24:43 +02:00
Thomas Bernard e11bbf0bc0
miniupnpd/pcp: Send PCP announcment at startup
fixes #254
2018-05-08 23:06:19 +02:00
Thomas Bernard dd2aa84204 miniupnpd: use monotonic clock for timeouts, etc.
fixes #288

also changed set_startup_time()
2018-03-13 11:43:07 +01:00
yangfl d492fa39ef fix typo 2018-01-09 09:33:31 +08:00
Thomas Bernard 7492fe42c2 pcpserver.c: send ANNOUNCE when IP changed
see #254
2017-11-27 23:04:51 +01:00
Thomas Bernard cc0fad78d7 miniupnpd: use epoch_origin for NAT-PMP as well
see #254
2017-11-27 23:02:34 +01:00
Thomas Bernard 6ce6a70973 PCP : reset epoch after address change
see #254
2017-11-02 17:27:24 +01:00
Thomas Bernard e252acef88 PCP: check pinhole before adding in CreatePCPMap_FW()
fixes #188
2016-01-18 20:16:06 +01:00
vvsvic a8ab2149f4 Remove some bugs in DeletePCPPeer and DeletePCPMap 2016-01-13 13:26:20 +03:00
Thomas Bernard be70a04c66 use LOG_INFO instead of LOG_ERR for PCP PEER and MAP success
fixes #158
2015-11-02 23:30:28 +01:00
Thomas Bernard 3b12b8fb4e copy ext_ip in response only if needed 2015-09-22 11:52:24 +02:00
Thomas Bernard 68b3cab718 add a warning syslog() in parsePCPOptions 2015-09-22 11:36:09 +02:00
Thomas Bernard c87809a608 remove redundant test about ports 2015-09-22 11:35:24 +02:00
Thomas Bernard 3d8986b646 Dont read/write PCP messages as C struct to remove dependency to the "pack" feature.
structs are left (commented out) in pcp_msg_struct.h for information
2015-09-22 10:22:06 +02:00
Thomas Bernard 769f4d4708 pcpserver.c: correctly return NOT_AUTHORIZED PCP error
When trying to remove PCP Map when nonce is bad

fixes #132
2015-07-09 12:46:51 +02:00
Thomas Bernard 8d08346c60 pcpserver.c: Don't overwrite lifetime.
fix #131
2015-07-09 12:28:05 +02:00
Thomas Bernard 6400a13a50 miniupnpd/pcpserver.c: fix for compilation with PCP_FLOWP defined 2015-06-22 11:51:23 +02:00
Thomas Bernard 067aa01856 miniupnpd/pcpserver.c: remove unused argument warning 2014-10-27 17:39:01 +01:00
Markus Stenberg 5aaac2c6f5 miniupnpd/pcpserver.c: ext_port field was not set in the (IPv6) firewall reply packet. Now setting it to int_port. 2014-06-02 19:39:06 +03:00
Markus Stenberg c038146cee Added ipv6_listening_ip option to override it from in6addr_any.
This way IPv6 services can be selectively enabled on one IP too.
2014-05-20 15:55:35 +03:00
Thomas Bernard 93d7bb6ae2 miniupnpd/asyncsendto.c: allow setting of source address (IPV6_PKTINFO) 2014-05-19 16:27:55 +02:00
Thomas Bernard d851ad4c25 miniupnpd: Retreive PCP packed IPV6 destination address 2014-05-19 15:27:34 +02:00
Markus Stenberg 83c103bc3f Internal address check is mandatory even if third party option is set. 2014-05-19 13:23:21 +03:00
Thomas Bernard 7154d30adc miniupnpd/pcpserver.c: prevent compiling with PCP_PEER on if not applicable 2014-05-15 12:29:10 +02:00
Markus Stenberg 924b6d1613 Checking lan only in non-thirdparty mode. 2014-05-15 12:02:46 +02:00
Markus Stenberg 28b3afbb8f Added TODO about IPv6 permission handling. 2014-05-15 12:02:12 +02:00
Markus Stenberg 3a457092ce Split Peer/Map logic to NAT- and FW specific parts. Updated TODO to include proxying.
+ fixes
2014-05-15 12:01:22 +02:00
Markus Stenberg be6db5995d miniupnpd: work in progress on PCP pinhole support 2014-05-15 11:58:17 +02:00
Markus Stenberg e907d7bba6 miniupnpd: Some initial effort at actually adding pinhole support to PCP code. 2014-05-15 11:45:33 +02:00
Markus Stenberg c000a00508 Fixed PEER supporting PCP to compile too. 2014-05-15 11:29:01 +02:00
Thomas Bernard ba97c9b238 miniupnpd/pcpserver.c: fix ProcessPCPRequest()
fix commit 620af3737c8beffe87e08b7e0c34ab1661251695
2014-05-15 10:57:10 +02:00
Markus Stenberg 3f9000db76 Added unified description production, and also enforcing that desc matches in MAP/PEER delete (=> following RFC6887). Yay. 2014-05-15 10:51:00 +02:00
Markus Stenberg 338a533a09 miniupnpd/pcpserver.c: Preliminary work for PCP fw control
Added preliminary is_fw flag, and added af to getifaddr_in6. Made
option parsing follow the RFC and also made it bit more paranoid
(there were some security problems with length checks not being done
at right place all the time; simplified flow, should be easier to
verify now that it does nothing untoward).
2014-05-06 15:12:42 +02:00
Markus Stenberg d058fd3f36 miniupnpd/pcpserver.c: Added checks for third-party allowed for it to be used.
If allowed, checking it against source address,
with inverse logic from that of non-thirdparty case.
2014-05-06 13:30:04 +02:00
Markus Stenberg 5e5a9d39eb Added missing check for int_ip. 2014-05-06 13:27:42 +02:00
Markus Stenberg 2f5c3ce959 miniupnpd/pcpserver.c: Some IPv6 related work on PCP. 2014-05-06 13:26:06 +02:00
Markus Stenberg c801138c63 Added PCP third party option and made it's use an option. 2014-05-06 13:10:09 +02:00
Thomas Bernard ca9b8217b4 miniupnpd/pcpserver.c: Fix CheckExternalAddress() for working with 0 IPv4 mapped address
fixes #69
2014-04-21 19:32:09 +02:00
Thomas Bernard 8be1cc55c2 miniupnpd/pcpserver.c: Add comments to CheckExternalAddress() 2014-04-21 19:31:32 +02:00
Daniel Becker b4e00165a0 miniupnpd/pcpserver.c: add PCP support for CHECK_PORTINUSE 2014-04-12 23:14:11 -07:00