Commit graph

323 commits

Author SHA1 Message Date
Markus Prettner
c152f610ce
Fix negated IP addresses without subnet mask not being parsed correctly (#13854) 2025-04-08 19:21:57 -06:00
Cody Robibero
8a6d1402d2
Merge pull request #13493 from gnattu/fix-subnet-check-master 2025-03-15 08:35:55 -06:00
Niels van Velzen
d18066f0f2 Remove GetMacAddresses from NetworkManager 2025-02-22 10:27:42 +01:00
gnattu
9aec576c76
Typo
Co-authored-by: Cody Robibero <cody@robibe.ro>
2025-02-05 08:04:29 +08:00
gnattu
533ceeaaf2 Fix subnet contains check
We are still using `Subnet.Contains` a lot but that does not handle IPv4 mapped to IPv6 addresses at all. It was partially fixed by #12094 in local network checking, but it may not always happen on LAN.

Also make all local network checking to use IsInLocalNetwork method instead of just performing `Subnet.Contains` which is not accurate.

Filter out all link-local addresses for external interface matching.
2025-02-04 16:52:17 +08:00
Bond-009
bcdffa74a8
Remove useless checks and dead code (#13405)
* Remove useless checks and dead code

* Enable adaptive bitrate streaming again

* Disable adaptive bitrate streaming by default
2025-01-28 11:29:22 +01:00
Bond-009
b318f33599
Remove the ability to auto port forward (#13222) 2025-01-25 09:34:06 -07:00
Bond_009
47f798827b Remove useless checks and dead code 2025-01-22 17:31:52 +01:00
gnattu
e7145acd56 Backport pull request #11766 from jellyfin/release-10.9.z
Filter invalid IPs on external interface matching

Original-merge: 2eece01acc

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
2024-05-25 11:46:13 -04:00
Patrick Barron
ca71ec6a09 Fix nullability for INetworkManager.GetBindAddress 2023-11-30 11:52:48 -05:00
Bond_009
3c3f0a765e Use new IPNetwork.TryParse function 2023-11-16 00:50:17 +01:00
Bond_009
635d67d458 Revert "Use System.Net.IPNetwork"
This reverts commit 117d05d288da1d412159a29c0cb8d5c8259e48ae.
2023-11-14 21:16:33 +01:00
Bond_009
b62b0ec2b5 Fix warnings 2023-11-14 21:14:21 +01:00
Bond_009
99e0d46ad9 Use System.Net.IPNetwork 2023-11-14 21:13:51 +01:00
Patrick Barron
e463dbda47 Move network configuration to MediaBrowser.Common 2023-11-12 10:24:35 -05:00
Patrick Barron
9595636d61 Move network utilities to MediaBrowser.Common 2023-11-12 10:24:34 -05:00
Patrick Barron
223b156270 Move network constants to MediaBrowser.Common 2023-11-12 10:24:34 -05:00
Shadowghost
e56275fb46 Extract networking constants 2023-07-03 22:04:59 +02:00
Shadowghost
3f65851520 Apply review suggestions 2023-07-03 10:03:39 +02:00
Shadowghost
9b0e44019a Apply review suggestions 2023-07-02 12:40:49 +02:00
Shadowghost
a381cd3c76 Apply review suggestions 2023-05-25 17:10:53 +02:00
Shadowghost
c042f20224 Merge branch 'master' into network-rewrite 2023-05-11 15:41:39 +02:00
Cody Robibero
e1a30a4aef
Merge pull request #8598 from Neuheit/ipv4fallback 2023-05-11 07:12:34 -06:00
Shadowghost
a5bfeb28aa Apply review suggestions 2023-02-20 21:51:15 +01:00
Shadowghost
a5f16136eb Apply review suggestions 2023-02-20 16:58:22 +01:00
Bond_009
24a7e210c3 Optimize tryparse
* Don't check for null before
* Don't try different formats when not needed (NumberFormat.Integer is the fast path)
2023-02-19 16:52:29 +01:00
Shadowghost
20fd05b050 Consistently write IP in upercase 2023-02-17 19:27:36 +01:00
Shadowghost
42498194d9 Replace ISocket and UdpSocket, fix DLNA and SSDP binding and discovery 2023-02-17 17:39:11 +01:00
Shadowghost
4eba16c672 Apply review suggestions 2023-02-15 22:34:44 +01:00
Shadowghost
1cc7572445 Apply review suggestions 2023-02-15 11:31:47 +01:00
Bond-009
36b7157589
Fix #9300 (#9312) 2023-02-14 12:08:52 -07:00
Shadowghost
414eb45899 Merge branch 'master' into network-rewrite 2023-01-24 23:48:47 +01:00
Patrick Barron
5d1b5d257f Remove CustomHeaderNames 2023-01-20 18:28:18 -05:00
Shadowghost
3f6354cdb8 Fix .NET 7 compatibility 2022-12-07 17:41:32 +01:00
Bond_009
52194f56b5 Replace != null with is not null 2022-12-05 15:01:13 +01:00
Bond_009
c7d50d640e Replace == null with is null 2022-12-05 15:00:20 +01:00
Neuheit
c9a387943f Add IPv4 fallback from IPv6 failure.
Co-authored-by: BaronGreenback <jimcartlidge@yahoo.co.uk>
2022-10-20 16:17:56 -04:00
Shadowghost
f6d6f0367b Properly handle IPs with subnetmasks 2022-10-17 15:51:09 +02:00
Shadowghost
26d79a5ce3 Properly name some bind address functions, cleanup logging 2022-10-16 10:22:11 +02:00
Shadowghost
87d0158a4a Fix autodiscovery 2022-10-15 17:27:37 +02:00
Shadowghost
4aec41752f Apply review suggestions 2022-10-14 10:25:57 +02:00
Shadowghost
7b90fcd053 Merge branch 'master' into network-rewrite 2022-10-07 09:16:02 +02:00
Bond_009
a9a5fcde81 Use ArgumentNullException.ThrowIfNull helper method
Did a simple search/replace on the whole repo (except the RSSDP project)
This reduces LOC and should improve performance (methods containing a throw statement don't get inlined)

```
if \((\w+) == null\)
\s+\{
\s+throw new ArgumentNullException\((.*)\);
\s+\}
```

```
ArgumentNullException.ThrowIfNull($1);
```
2022-10-06 20:21:23 +02:00
Shadowghost
4fc52a840c Merge branch 'master' into network-rewrite 2022-10-01 19:59:00 +02:00
Bond-009
33611614ed
Merge pull request #7433 from Bond-009/ssdphttpclient 2022-08-22 17:52:19 +02:00
Shadowghost
59a86568d9 Cleanup and fixes 2022-07-21 22:09:54 +02:00
Shadowghost
2d3a16ad0f Simplify code 2022-07-20 21:19:35 +02:00
Shadowghost
2281b8c997 Move away from using Collection, simplify code, add proper ordering 2022-07-20 14:29:30 +02:00
Shadowghost
a492082f4e Apply review suggestions and fix build 2022-07-20 11:47:48 +02:00
Shadowghost
64ffd5fd95 Move subnet parser to NetworkExtensions 2022-07-20 09:45:57 +02:00