Check interface state (up/down) on initialization step #10

Merged
fyrchik merged 1 commit from dstepanov-yadro/multinet:fix/interface_state_check into master 2024-11-02 14:21:56 +00:00
Showing only changes of commit f65c788d73 - Show all commits

View file

@ -209,7 +209,7 @@ func processSubnet(subnet string, sources []iface) (Subnet, error) {
// Hostnames for address are currently not supported. // Hostnames for address are currently not supported.
func (d *dialer) DialContext(ctx context.Context, network, address string) (net.Conn, error) { func (d *dialer) DialContext(ctx context.Context, network, address string) (net.Conn, error) {
addr, err := netip.ParseAddrPort(address) addr, err := netip.ParseAddrPort(address)
if err != nil { //try resolve as hostname if err != nil { // try resolve as hostname
return d.dialContextHostname(ctx, network, address) return d.dialContextHostname(ctx, network, address)
} }
return d.dialAddr(ctx, network, address, addr) return d.dialAddr(ctx, network, address, addr)