File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
nanoFramework.System.Net/NetworkHelper Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -85,19 +85,27 @@ public static void InternalSetupHelper(
8585 {
8686 networkInterface . EnableStaticIPv4Dns ( ipConfiguration . IPDns ) ;
8787 }
88- else
89- {
90- networkInterface . EnableAutomaticDns ( ) ;
91- }
9288 }
9389 else
9490 {
95- if ( ! networkInterface . IsDhcpEnabled )
91+ if ( networkInterface . IsDhcpEnabled )
9692 {
9793 networkInterface . EnableDhcp ( ) ;
9894 }
95+ else
96+ {
97+ // setup static IPv4 with network config
98+ networkInterface . EnableStaticIPv4 (
99+ networkInterface . IPv4Address ,
100+ networkInterface . IPv4SubnetMask ,
101+ networkInterface . IPv4GatewayAddress ) ;
99102
100- networkInterface . EnableAutomaticDns ( ) ;
103+ // check if static DNS is to be configured
104+ if ( networkInterface . IPv4DnsAddresses . Length > 0 )
105+ {
106+ networkInterface . EnableStaticIPv4Dns ( networkInterface . IPv4DnsAddresses ) ;
107+ }
108+ }
101109 }
102110 }
103111 }
You can’t perform that action at this time.
0 commit comments