mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-10-26 21:16:56 +00:00
Refactor local DNS cache partitioning
This commit is contained in:
@@ -106,6 +106,7 @@ type NetworkInterface struct {
|
||||
|
||||
Type int32
|
||||
DNSServer StringIterator
|
||||
Gateway StringIterator
|
||||
Metered bool
|
||||
}
|
||||
|
||||
|
||||
@@ -139,8 +139,12 @@ func (w *platformInterfaceWrapper) NetworkInterfaces() ([]adapter.NetworkInterfa
|
||||
Addresses: common.Map(iteratorToArray[string](netInterface.Addresses), netip.MustParsePrefix),
|
||||
Flags: linkFlags(uint32(netInterface.Flags)),
|
||||
},
|
||||
Type: C.InterfaceType(netInterface.Type),
|
||||
DNSServers: iteratorToArray[string](netInterface.DNSServer),
|
||||
Type: C.InterfaceType(netInterface.Type),
|
||||
DNSServers: iteratorToArray[string](netInterface.DNSServer),
|
||||
Gateways: common.Filter(common.Map(iteratorToArray[string](netInterface.Gateway), func(it string) netip.Addr {
|
||||
gateway, _ := netip.ParseAddr(it)
|
||||
return gateway.Unmap().WithZone("")
|
||||
}), netip.Addr.IsValid),
|
||||
Expensive: netInterface.Metered || isDefault && w.isExpensive,
|
||||
Constrained: isDefault && w.isConstrained,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user