Commit Graph

69 Commits

Author SHA1 Message Date
Shadowghost
a5bfeb28aa Apply review suggestions 2023-02-20 21:51:15 +01:00
Shadowghost
20fd05b050 Consistently write IP in upercase 2023-02-17 19:27:36 +01:00
Shadowghost
bedee7922f Fix interface address assignment and resolution in SSDP 2023-02-17 18:24:13 +01:00
Shadowghost
42498194d9 Replace ISocket and UdpSocket, fix DLNA and SSDP binding and discovery 2023-02-17 17:39:11 +01:00
Shadowghost
6e46075414 Apply review suggestions 2023-01-19 19:03:43 +01:00
Shadowghost
4aec41752f Apply review suggestions 2022-10-14 10:25:57 +02:00
Shadowghost
59a86568d9 Cleanup and fixes 2022-07-21 22:09:54 +02:00
Shadowghost
f6e41269d9 Enforce interface bindings on SSDP, add Loopback to LAN if no LAN defined 2022-07-21 09:26:18 +02:00
Shadowghost
05458a4a42 Fix some ssdp errors 2022-07-21 00:32:51 +02:00
Bond_009
1d018c5575 SocketFactory: Remove redundant code
ExclusiveAddressUse should be false by default afaik
2022-03-08 22:20:43 +01:00
Cody Robibero
10d52d16a8
Fix invalid cref (#7277) 2022-02-06 22:21:17 +01:00
KonH
e3fccd5ae6 Fix warning: Qualifier is redundant (#2149) 2021-10-03 11:01:40 +07:00
Fernando Fernández
3d0b1ccae6
Remove all unused usings 2021-09-06 21:15:30 +02:00
cvium
42a2cc1747 Remove some unnecessary allocations 2021-05-24 00:30:41 +02:00
BaronGreenback
2e98de9062
Code Clean up: Convert to null-coalescing operator ?? (#5845)
Co-authored-by: Cody Robibero <cody@robibe.ro>
Co-authored-by: Patrick Barron <18354464+barronpm@users.noreply.github.com>
2021-05-05 13:51:14 +02:00
Jim Cartlidge
53af1e3455 Updatig netcollection & re-inserting BOM 2020-10-04 09:56:33 +01:00
Jim Cartlidge
38b8110a3e Removing blank lines. 2020-09-14 15:55:25 +01:00
Jim Cartlidge
b44455ad0d Update based on PR1 changes. 2020-09-14 15:46:38 +01:00
Jim Cartlidge
9ef79d190b Large number of files 2020-09-12 16:41:37 +01:00
BaronGreenback
2272363197
Update SsdpCommunicationsServer.cs 2020-06-26 15:24:46 +01:00
BaronGreenback
27f6e1ddc8
Update SsdpCommunicationsServer.cs 2020-06-26 15:22:39 +01:00
BaronGreenback
f01baad05e Sending multicasts out of Sockets without setting the broadcast to true - causes the error "Bad value for ai_flags" on some systems (#3404)
The underlying cause looks to be https://github.com/dotnet/runtime/issues/28630.

Basically, it's an access denied bug.
It looks like multicasts need the same access rights as broadcasts on some systems.
2020-06-24 17:23:16 +01:00
BaronGreenback
c07d8abfd5 Removed debugging info 2020-06-24 17:11:02 +01:00
BaronGreenback
5b0c182908 Added logging and broadcast = true
Not intended for merge into the fork.
2020-06-24 14:31:17 +01:00
Cody Robibero
43221fc26b
Merge branch 'master' into SSDP 2020-06-20 15:33:13 -06:00
telans
7f307f9082
brace multiline if statements 2020-06-20 21:12:36 +12:00
telans
98db8f72e0
fix SA1503 for one line if statements 2020-06-20 20:35:29 +12:00
telans
8e3d874802
remove regions 2020-06-20 18:20:33 +12:00
telans
247f9c61e6
fix SA1513/SA1516 2020-06-16 16:11:30 +12:00
telans
3d9049ef08
fix SA1508 2020-06-15 10:45:55 +12:00
telans
acd4389653
fix SA1005 2020-06-15 10:41:00 +12:00
BaronGreenback
8a69300bf5 Changes styles as suggested by @barronpm
Added addtional comments & source type as per intellisense suggestion
change code as per sonacloud
2020-04-29 12:24:01 +01:00
BaronGreenback
ebd589aa86 Whilst fixing issues with SSDP on devices with multiple interfaces, i came across a design issue in the current code - namely interfaces without a gateway were ignored.
Fixing this required the removal of the code that attempted to detect virtual interfaces. Not wanting to remove functionality, but not able to keep the code in place, I implemented a work around solution (see 4 below).

Whilst in the area, I also fixed a few minor bugs i encountered (1, 5, 6 below) and stopped SSDP messages from going out on non-LAN interfaces (3)

All these changes are related.

Changes

1 IsInPrivateAddressSpace - improved subnet code checking
2 interfaces with no gateway were being excluded from SSDP blasts
3 filtered SSDP blasts from not LAN addresses as defined on the network page.
4 removed #986 mod - as this was part of the issue of #2986. Interfaces can be excluded from the LAN by putting the LAN address in brackets. eg. [10.1.1.1] will exclude an interface with ip address 10.1.1.1 from SSDP
5 fixed a problem where an invalid LAN address causing the SSDP to crash
6 corrected local link filter (FilterIPAddress) to filter on 169.254. addresses
2020-04-28 21:57:39 +01:00
BaronGreenback
a3140f83c6 Revert "Whilst fixing issues with SSDP on devices with multiple interfaces, i came across a design issue in the current code - namely interfaces without a gateway were ignored."
This reverts commit 2aaecb8e14.
2020-04-28 21:51:49 +01:00
BaronGreenback
2aaecb8e14 Whilst fixing issues with SSDP on devices with multiple interfaces, i came across a design issue in the current code - namely interfaces without a gateway were ignored.
Fixing this required the removal of the code that attempted to detect virtual interfaces. Not wanting to remove functionality, but not able to keep the code in place, I implemented a work around solution (see 4 below).

Whilst in the area, I also fixed a few minor bugs i encountered (1, 5, 6 below) and stopped SSDP messages from going out on non-LAN interfaces (3)

All these changes are related.

Changes

1 IsInPrivateAddressSpace - improved subnet code checking
2 interfaces with no gateway were being excluded from SSDP blasts
3 filtered SSDP blasts from not LAN addresses as defined on the network page.
4 removed #986 mod - as this was part of the issue of #2986. Interfaces can be excluded from the LAN by putting the LAN address in brackets. eg. [10.1.1.1] will exclude an interface with ip address 10.1.1.1 from SSDP
5 fixed a problem where an invalid LAN address causing the SSDP to crash
6 corrected local link filter (FilterIPAddress) to filter on 169.254. addresses
2020-04-28 21:45:46 +01:00
Bond_009
e9d1eabd53 Remove unused usings 2020-03-24 16:12:06 +01:00
Bond_009
ddd1a282ea Remove IpAddressInfo and IpEndPointInfo classes 2019-07-25 00:15:06 +02:00
Bond_009
2696ac5eac Lower the amount of running tasks 2019-03-25 21:33:48 +01:00
Xu Fasheng
0c49079c16 Update comments for DLNA IPv6 2019-02-23 09:56:55 +08:00
Xu Fasheng
cbd0e71c07 Send DLNA devices message to only the matched interface
This will be the right way for multiple interfaces, or the client will
receive all devices message with different IP addresses and could not
detect which one could access.

And provide one option DlnaOptions.SendOnlyMatchedHost to fallback to old
behaviour if this commit missed something.
2019-02-22 20:18:34 +08:00
Xu Fasheng
cf4e64f430 Add option to toggle if ignore virtual interfaces
Some VPN like ZerotierOne owns IP address but no gateway, and there is no
good idea in NetworkManager.GetIPsDefault() to filter such virtual interfaces,
so just provide one option to let user decide it.
2019-02-22 20:13:17 +08:00
Erwin de Haan
9d0a08571e Merge branch 'dev' into reformat 2019-01-13 21:59:37 +01:00
Erwin de Haan
65bd052f3e ReSharper conform to 'var' settings 2019-01-13 21:37:13 +01:00
Erwin de Haan
b062577d81 Find+Sed BOM removal *.cs: MediaBrowser.Providers-SocketHttpListener 2019-01-13 21:03:10 +01:00
Andrew Rabert
e8d93b3485 Merge pull request #566 from Bond-009/dlna
Avoid printing stacktrace when bind to port 1900 fails
2019-01-13 19:02:40 +00:00
Bond-009
81475e361b Add exception message to log.
Output will be something line: `Failed to bind to port 1900: Address already in use. DLNA will be unavailable`
2019-01-13 01:31:55 +01:00
Bond_009
783e74d9c9 Don't print stacktrace when failing to bind to 1900 2019-01-12 22:25:55 +01:00
Erwin de Haan
e2751d42e8 Merge branch 'dev' into code-cleanup 2019-01-11 12:50:36 +01:00
Erwin de Haan
ec1f5dc317 Mayor code cleanup
Add Argument*Exceptions now use proper nameof operators.

Added exception messages to quite a few Argument*Exceptions.

Fixed rethorwing to be proper syntax.

Added a ton of null checkes. (This is only a start, there are about 500 places that need proper null handling)

Added some TODOs to log certain exceptions.

Fix sln again.

Fixed all AssemblyInfo's and added proper copyright (where I could find them)

We live in *current year*.

Fixed the use of braces.

Fixed a ton of properties, and made a fair amount of functions static that should be and can be static.

Made more Methods that should be static static.

You can now use static to find bad functions!

Removed unused variable. And added one more proper XML comment.
2019-01-10 20:38:53 +01:00
hawken
ba1794f64b Remove tabs and trailing whitespace 2019-01-07 23:24:34 +00:00