Ticket #12399: 0001-Don-t-query-DNS-when-statically-configuring-an-inter.patch

File 0001-Don-t-query-DNS-when-statically-configuring-an-inter.patch, 1.2 KB (added by ambroff, 3 years ago)

Don't query DNS when statically configuring an interface

  • src/preferences/network/InterfaceAddressView.cpp

    From a839336549ac57fc98e7038a44b45c9944854805 Mon Sep 17 00:00:00 2001
    From: Kyle Ambroff <kyle@ambroff.com>
    Date: Mon, 27 Feb 2017 14:47:37 -0800
    Subject: [PATCH] Don't query DNS when statically configuring an interface
    
    Fixes #12399
    
    The Network preferences app was querying DNS to find a hostname
    associated with the IP address, netmask and gateway when statically
    configuring an interface. This is obviously unecessary and leads to
    unexpected blocking when DNS is not available.
    
    Adding B_NO_ADDRESS_RESOLUTION flag to disable the reverse lookup.
    ---
     src/preferences/network/InterfaceAddressView.cpp | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/src/preferences/network/InterfaceAddressView.cpp b/src/preferences/network/InterfaceAddressView.cpp
    index 520dd58..e40ebd0 100644
    a b InterfaceAddressView::_SetAddress(BNetworkAddress& address, const char* text)  
    344344    if (string.IsEmpty())
    345345        return;
    346346
    347     address.SetTo(string.String());
     347    address.SetTo(string.String(), static_cast<uint16>(0),
     348        B_NO_ADDRESS_RESOLUTION);
    348349}