Commit Graph

67 Commits

Author SHA1 Message Date
Bill Thornton
d886941927 Fix inverted logic for LAN IP detection 2020-07-30 17:18:44 -04:00
Bond_009
febb6bced6 Review usage of string.Substring (part 1)
Reduced allocations by replacing string.Substring with ReadOnlySpan<char>.Slice
2020-07-22 13:39:24 +02:00
BaronGreenback
f983ea95d1
Update Emby.Server.Implementations/Networking/NetworkManager.cs
Co-authored-by: Cody Robibero <cody@robibe.ro>
2020-07-20 17:18:50 +01:00
BaronGreenback
bde1a38a88 Two fixes 2020-07-20 16:59:04 +01:00
Cody Robibero
43221fc26b
Merge branch 'master' into SSDP 2020-06-20 15:33:13 -06:00
BaronGreenback
46006a1aff Re-ordered code for the match 2020-06-19 22:32:07 +01:00
BaronGreenback
02f6ced07a Merged 2020-06-19 22:07:25 +01:00
telans
9018f8d8be
Add full stop at end of comments (SA1629) 2020-06-16 10:37:52 +12:00
telans
acd4389653
fix SA1005 2020-06-15 10:41:00 +12:00
crobibero
44957c5a9a Use typed logger where possible 2020-06-05 18:15:56 -06:00
BaronGreenback
1d86084653
Update Emby.Server.Implementations/Networking/NetworkManager.cs
Co-authored-by: Cody Robibero <cody@robibe.ro>
2020-06-01 10:14:38 +01:00
BaronGreenback
adb789a802
Update Emby.Server.Implementations/Networking/NetworkManager.cs
Co-authored-by: Cody Robibero <cody@robibe.ro>
2020-06-01 09:58:16 +01:00
BaronGreenback
fbd02a493b
Update Emby.Server.Implementations/Networking/NetworkManager.cs
Co-authored-by: Cody Robibero <cody@robibe.ro>
2020-06-01 09:57:48 +01:00
BaronGreenback
455e464445
Update Emby.Server.Implementations/Networking/NetworkManager.cs
Co-authored-by: Cody Robibero <cody@robibe.ro>
2020-06-01 09:57:17 +01:00
Bond_009
4748105dce Enable TreatWarningsAsErrors for Jellyfin.Server.Implementations in Release mode 2020-05-29 11:28:19 +02:00
BaronGreenback
3a5333228f
Update Emby.Server.Implementations/Networking/NetworkManager.cs
Co-authored-by: Patrick Barron <18354464+barronpm@users.noreply.github.com>
2020-05-17 20:44:44 +01: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
6f45d95951 Minor improvements to network code 2019-11-28 17:46:06 +01:00
Bond_009
06596feaa7 Address comments 2019-11-22 16:15:31 +01:00
Bond-009
b477b3874e Fix some warnings 2019-11-22 16:15:31 +01:00
Bond_009
3f7836d9eb Update deps and add MultiThreading analyzer 2019-11-01 17:55:44 +01:00
Bond_009
2a58c643d2 Fix more warnings 2019-08-09 23:16:24 +02:00
dkanada
779f0c637f
Merge pull request #1580 from Bond-009/linklocal
Ignore Ipv6 link-local addresses
2019-08-07 02:18:22 -07:00
Bond_009
998017a76d Include library via NuGet instead of via source 2019-07-29 16:01:14 +02:00
Bond_009
5c9d041423 Ignore Ipv6 link-local addresses 2019-07-29 13:57:36 +02:00
Bond_009
ddd1a282ea Remove IpAddressInfo and IpEndPointInfo classes 2019-07-25 00:15:06 +02:00
Bond-009
decaffed86 Remove EnvironmentInfo
This moved the last bit of usefulness of EnvironmentInfo into a static
class.
2019-03-07 22:41:41 +01:00
Xu Fasheng
7429c07c05 Remove redundant parenthesis 2019-02-27 20:16:54 +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
f1ef0b0b4c Fix namespacing so it lines up properly with file names and paths (#715)
* Fix stupid namespacing so it lines up properly with file names and paths.
2019-02-09 10:10:33 +01:00
Bond_009
1385d89df6 Remove MoreLINQ 2019-02-02 12:27:06 +01:00
William Taylor
65cd3ed597 Replaced injections of ILogger with ILoggerFactory
This makes resolving dependencies from the container much easier as
you cannot resolve with primitives parameters in a way that is any
more readable.

The aim of this commit is to change as little as possible with the end
result, loggers that were newed up for the parent object were given the same
name. Objects that used the base or app loggers, were given a new logger with
an appropriate name.

Also removed some unused dependencies.
2019-01-20 21:05:12 +00:00
Erwin de Haan
e867446437 ReSharper format: conform inline 'out' parameters. 2019-01-13 21:46:33 +01:00
Erwin de Haan
65bd052f3e ReSharper conform to 'var' settings 2019-01-13 21:37:13 +01:00
Erwin de Haan
e566d9a231 Find+Sed BOM removal *.cs: BDInfo-Emby.XmlTv 2019-01-13 20:54:44 +01:00
Erwin de Haan
5b3d8a6d76 EditorConfig reformat: Emby.IsoMounting, Emby.Server.Implementations 2019-01-13 20:30:03 +01:00
Erwin de Haan
39ef1106d7 Visual Studio Reformat: Emby.Server.Implementations Part Liv-P 2019-01-13 20:22:00 +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
bd169e4fd4 remove trailing whitespace 2019-01-07 23:27:46 +00:00
hawken
ba1794f64b Remove tabs and trailing whitespace 2019-01-07 23:24:34 +00:00
Bond_009
32469b3f65 Remove obsolete functions 2019-01-02 17:58:44 +03:00
Bond_009
ea4c914123 Fix exception logging 2018-12-30 22:44:39 +01:00
Bond_009
0f8b3c6347 Use Microsoft.Extensions.Logging abstraction 2018-12-30 22:44:38 +01:00
Bond_009
6e5d2aadaa Remove custom ToArray extension 2018-12-28 16:48:26 +01:00