Commit Graph

82 Commits

Author SHA1 Message Date
zzz
f7d134066d UPnP: Catch AssertionError when closing SSDP multicast socket
Reported on Windows 10
ref: http://zzz.i2p/topics/3500
2022-12-30 05:33:10 -05:00
zzz
86996dde28 UPnP: Don't bind HTTP listen sockets to all addresses at startup
The lib was binding to all addresses, and then our
UPnP.updateInterfaces() was closing most of them on first run.
Fix the lib to only bind to the non-public and non-deprecated ones,
using the same getLocalAddresses() method as in our code.
2022-05-27 11:18:48 -04:00
zzz
81255e19ae Transport: Fix thrashing of UPnP IPv6 listen sockets
Strip % suffixes from addresses before comparing
Fix HTTPMUSocket.getLocalAddress() to return the correct bound address
Throw exception on multicast socket bind failures, don't attempt
further operations on failed sockets
Add toString() to sockets for debugging
Log tweaks
2022-05-11 11:54:25 -04:00
zzz
7d1656c20f UPnP: Fix construction of absolute URLs
where the service relative URL is an absolute path
and the location absolute URL is below the top level.
Fixes communication with "Freebox" UPnP routers.
ref: http://zzz.i2p/topics/3157
2021-08-07 08:39:05 -04:00
zzz
d93e16e52e UPnP: Bind to IPv6 addresses for search responses
Older miniupnpd 2.0 will send a SSDP search response with an IPv6 location to a IPv4 address,
but newer ones 2.2 won't. So we need to also bind to an IPv6 address for the SSDP search
to receive the router's IPv6 location. Then we can bind to our public IPv6 address
for a port forward and it will work when miniupnpd is configured for "secure".

Also, don't bind a POST request to a mismatched v4/v6 address.
2021-06-11 09:29:16 -04:00
zzz
b88c8a4f6a UPnP: Fix IPv6 address check (ticket #2811) 2021-05-23 07:38:28 -04:00
zzz
03c657b466 javadoc fix 2021-03-19 13:02:35 -04:00
zzz
c1c2f4bb2e UPnP: Reduce some log levels
of logggung that was added during IPv6 development
2021-03-08 09:14:19 -05:00
zzz
eb535762c4 UPnP: IPv6 part 2
Add support for storing multiple location URLs in DeviceData
Add methods to prefer IPv6 for location URLs
Prefer IPv6 for POST target to WANIPv6FirewallControl service
Add method to bind local address for POST, needed for security checks when forwarding IPv6
Remove IPv6 checks from XML URL parser
Remove unused call in QueryRequest
2021-02-28 08:08:07 -05:00
zzz
fa3ca565ca UPnP: Move IPv6 checks from Parser to ControlPoint
... as they were being bypassed for known devices.
This fixes erratic UPnP results for devices sending multiple
SSDP search responses, one for IPv4 and one for IPv6.
Temporary fix until we add support for multiple location URLs to DeviceData.
2021-02-27 12:35:42 -05:00
idk
fdb4ec7d7c Switch from 'host name' to 'hostname' 2021-02-01 23:12:49 -05:00
zzz
af4c41ef08 UPnP: Race-proof the fix 2021-01-30 08:46:29 -05:00
zzz
33397433ac UPnP: Fix NPE (android gitlab ticket #1) 2021-01-30 08:35:33 -05:00
zzz
f3e821a65d UPnP fixes part 7:
Don't set I2P user agent, spoof MiniUPnPc
Don't convert string-to-bytes-to-string
Don't fallback to alternate code after failure
Don't use HttpURLConnection if proxy enabled
Add location sanity checks
Force Connection: close
Don't attempt to set Host header, HttpURLConnection ignores it
Disable following redirects
2020-05-27 12:49:15 +00:00
zzz
6aa81f7ec6 UPnP fixes part 6:
Fix malformed HTTP requests
Check HTTP response code in Parser
Check content type in Parser
Debug log in Parser
Show device URL in CLI
Don't retry after parser exception
Close resources in finally block
2020-05-22 18:22:56 +00:00
zzz
1af32bfe79 UPnP fixes part 4:
Update SSDP listening sockets on interface changes
2020-05-17 14:56:30 +00:00
zzz
e6dcfaee15 Transport: Move I2PHMac to ssu package
Remove Mac interface
2019-08-29 12:07:30 +00:00
zzz
232b7f30d5 Build: Fix javadoc errors with Oracle JDK
Tested with 12.0.2
2019-08-19 16:33:19 +00:00
zzz
6adc665fd3 Build: Move SSU HMAC implementation from core to router 2019-07-12 18:40:46 +00:00
zzz
b9726a0af8 UPnP: Remove finalize() in HTTPSocket (ticket #2490) 2019-05-02 14:08:25 +00:00
zzz
365f5a8c7b UPnP redundant casts 2019-03-10 12:58:23 +00:00
a67ea4b2f2 Cleanups: Close resources via try-finally
We can't use try-with-resources until we bump the minimum-supported Android
version for the client library to API 19.
2017-12-09 01:02:17 +00:00
zzz
8a89b3da29 Fix calls to Class.newInstance() deprecated in Java 9 2017-02-15 17:01:02 +00:00
zzz
9dab3b0dfe javadoc fixes part 12 (ticket #1894) 2017-01-27 02:27:53 +00:00
zzz
bd1354f95b javadoc fixes part 10 (ticket #1894) 2017-01-27 01:49:19 +00:00
zzz
fb74f41692 javadoc fixes part 9 (ticket #1894) 2017-01-27 01:41:06 +00:00
zzz
5db89d8743 javadoc fixes part 8 (ticket #1894) 2017-01-27 01:36:26 +00:00
zzz
16a551f7ce UPnP: Prevent NPE on socket creation fail (ticket #1681) 2016-11-13 16:30:51 +00:00
zzz
3ac8e5f54f UPnP: Prevent exception on bad HTTP header (ticket #1480) 2016-11-13 15:11:59 +00:00
79bb3f6cc4 Added @Deprecated annotations to router classes/methods 2016-02-06 20:39:58 +00:00
zzz
fe69d3b8f7 UPnP: Fix "content not allowed in trailing section" (tickets #481, #1653)
patch from 'kay" in #1653, dev agreement received
2015-09-04 21:05:38 +00:00
zzz
dd265bbd54 Updates after review:
Remove meeh.i2p as update host (ticket #1515)
Re-add 193.xxx https reseed
Fix SocketManagerFactory property handling
Restore UPnP locale fix lost in the merge
i2ptunnel finals
I2NP unique id fixes
duplicate done() in ReseedChecker
bigger langbox in CSS
reformatting
Javadocs
2015-04-11 19:34:34 +00:00
dev
d1ac24c65d findbugs: Covariant equals() method defined, Object.equals(Object) inherited 2015-04-04 19:49:37 +00:00
zzz
79dc01f7e4 Javadoc: missing package.html files in router.jar (ticket #1109) 2015-03-22 16:35:21 +00:00
zzz
8dde7b70db UPnP:
- New fix Device.getAbsoluteURL() once again after merge
 - Don't load local files in Service.getSCPDNode()
2015-03-17 21:29:03 +00:00
zzz
64faeef6c4 restore previous javadoc fixes after merge 2015-03-17 19:11:21 +00:00
zzz
c79e4aeaea propagate from branch 'i2p.i2p' (head 97716ce246bcbee153cf1a28253bac2385ddf7be)
to branch 'i2p.i2p.zzz.upnp' (head e508f71db90f382080b98d11efbdb4d88c1bc406)
2015-03-17 18:49:37 +00:00
zzz
8b6a86e391 merge of 'c5e201203713f0fefcdef642ca50597f8936c79c'
and 'fbd68f812db1e891f96e212b3a5938beec0233b5'
2015-03-17 18:21:12 +00:00
zzz
92daf4a8df Cyberlink for Java v3.0 + (2015-02-15) from github:
Unmodified cybergarage-upnp from github rev 9499b03 2015-02-05
https://github.com/cybergarage/cybergarage-upnp/commits/master
which is the same as rev 3ed1af9 2014-07-28 except for
the addition of README.md which we aren't using.
This is post-version 3.0.

Omitted files:
  router/java/src/org/cybergarage/xml/parser/XercesParser.java
  router/java/src/org/cybergarage/xml/parser/XmlPullParser.java
  router/java/src/org/cybergarage/xml/parser/kXML2Parser.java
chmod all files back to 644.

Diverging from 2.1 checkin rev 59eae97dbb470d8c4a1e4dba3a9763e134bb0c53
in prep for merging.

License unchanged.
Compile tested only.
2015-03-17 14:36:05 +00:00
zzz
59373f9bdf UPnP:
- Rescan for devices periodically and when reachability changes (tickets #661, #959)
  - Don't put "I2P" in registered protocol name
  - Add uptime to UPnP info
  - HTML escaping
  - Remove static log on Android
  - Javadocs and cleanups
2015-01-28 15:04:59 +00:00
zzz
d87178fec3 UPnP: Comment out unused parsers 2014-10-08 17:47:19 +00:00
zzz
0e48557b48 * SSU: Fix 100% CPU after socket failure
* UPnP: Catch reported error on FreeBSD
2014-09-22 13:22:35 +00:00
0f7a3dba87 Catch AIOOB in upnp code (triggered in I2P Android on shutdown) 2014-08-30 02:38:27 +00:00
zzz
9655e79d26 UPnP: Disable external entities in XML parser 2014-08-06 18:13:54 +00:00
c97d07e10a org.cybergarage.*: more type arguments 2013-11-21 06:08:41 +00:00
567c328331 org.cybergarage.*: type arguments, unused imports 2013-11-21 05:58:54 +00:00
3aa982529e org.xlattice.crypto.*: type arguments 2013-11-21 05:56:14 +00:00
zzz
3fce0e8e45 xlattice findbugs 2013-11-10 22:19:45 +00:00
zzz
ca0bb1ab76 Plucks from trunk for 0.9.7.1:
Streaming RTO changes:
 apps/streaming/java/src/net/i2p/client/streaming/ConnectionOptions.java
 apps/streaming/java/src/net/i2p/client/streaming/TCBShare.java
 apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketOptionsImpl.java

new reseed:
 applied changes from dbfea0ca35dbf9df85b5703db6f97a9579beb364
             through 325a9ed6f0f47eeabb33710073edf973671c63c9

disable RI verifies:
 applied changes from 4ef48b93946923e3371ab62719a474d869520697
             through a77990850b3534101571c88db4704676645914df

i2prouter bashism fix:
 applied changes from b5a0148f96728466561ece9be0e50ac9ad3f1468
             through e301d0499f4c688ed3a5febe30bf8098c7f2cdf9

i2psnark increase max piece size, mime type updates:
 apps/i2psnark/java/src/org/klomp/snark/Storage.java
 apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java
 apps/i2psnark/mime.properties

UPnP fix:
 applied changes from 3d4a5cd3d933f75fdff7696f560c569f4674bd73
             through 75e5f5d4e0f0dd44140908bb6e73830e3448bdde
2013-08-08 12:07:16 +00:00
420ccad91b javadoc fixes for the upstream cybergarage UPnP library. Upstream ticket #3598391 has been filed for this issue. 2012-12-24 19:44:25 +00:00