mirror of
				https://github.com/2dust/v2rayN.git
				synced 2025-10-30 20:12:52 +00:00 
			
		
		
		
	Enables dhcp interface configuration
This commit is contained in:
		
							parent
							
								
									f78441c478
								
							
						
					
					
						commit
						007e407594
					
				
					 2 changed files with 12 additions and 5 deletions
				
			
		|  | @ -1,3 +1,5 @@ | ||||||
|  | using System.Text.Json.Serialization; | ||||||
|  | 
 | ||||||
| namespace ServiceLib.Models; | namespace ServiceLib.Models; | ||||||
| 
 | 
 | ||||||
| public class SingboxConfig | public class SingboxConfig | ||||||
|  | @ -226,7 +228,7 @@ public class Server4Sbox | ||||||
|     public string? type { get; set; } |     public string? type { get; set; } | ||||||
|     public string? server { get; set; } |     public string? server { get; set; } | ||||||
|     public string? server_resolver { get; set; } |     public string? server_resolver { get; set; } | ||||||
|     //public string? interface { get; set; } |     [JsonPropertyName("interface")] public string? Interface { get; set; } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| public class Experimental4Sbox | public class Experimental4Sbox | ||||||
|  |  | ||||||
|  | @ -1314,7 +1314,7 @@ public class CoreConfigSingboxService | ||||||
|         var tag = "local_local"; |         var tag = "local_local"; | ||||||
|         var localDnsAddress = string.IsNullOrEmpty(dNSItem?.DomainDNSAddress) ? Global.SingboxDomainDNSAddress.FirstOrDefault() : dNSItem?.DomainDNSAddress; |         var localDnsAddress = string.IsNullOrEmpty(dNSItem?.DomainDNSAddress) ? Global.SingboxDomainDNSAddress.FirstOrDefault() : dNSItem?.DomainDNSAddress; | ||||||
|         string? localDnsType = null; |         string? localDnsType = null; | ||||||
|         //string? dhcpDnsInterface = null; |         string? dhcpDnsInterface = null; | ||||||
|         if (localDnsAddress == "local") |         if (localDnsAddress == "local") | ||||||
|         { |         { | ||||||
|             localDnsType = "local"; |             localDnsType = "local"; | ||||||
|  | @ -1323,8 +1323,12 @@ public class CoreConfigSingboxService | ||||||
|         else if (localDnsAddress.StartsWith("dhcp") && localDnsAddress.Length > 7) |         else if (localDnsAddress.StartsWith("dhcp") && localDnsAddress.Length > 7) | ||||||
|         { |         { | ||||||
|             localDnsType = "dhcp"; |             localDnsType = "dhcp"; | ||||||
|             // // dhcp:// |             // dhcp:// | ||||||
|             // dhcpDnsInterface = localDnsAddress.Substring(7); |             dhcpDnsInterface = localDnsAddress.Substring(7); | ||||||
|  |             if (dhcpDnsInterface == "auto") | ||||||
|  |             { | ||||||
|  |                 dhcpDnsInterface = null; | ||||||
|  |             } | ||||||
|             localDnsAddress = null; |             localDnsAddress = null; | ||||||
|         } |         } | ||||||
|         else if (localDnsAddress.StartsWith("tcp") && localDnsAddress.Length > 6) |         else if (localDnsAddress.StartsWith("tcp") && localDnsAddress.Length > 6) | ||||||
|  | @ -1360,7 +1364,8 @@ public class CoreConfigSingboxService | ||||||
|         { |         { | ||||||
|             tag = tag, |             tag = tag, | ||||||
|             type = localDnsType, |             type = localDnsType, | ||||||
|             server = localDnsAddress |             server = localDnsAddress, | ||||||
|  |             Interface = dhcpDnsInterface | ||||||
|         }); |         }); | ||||||
|         dns4Sbox.rules.Add(new() |         dns4Sbox.rules.Add(new() | ||||||
|         { |         { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 DHR60
						DHR60