[haiku-commits] haiku: hrev49477 - in src: servers/net kits/network

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 29 Jul 2015 22:56:32 +0200 (CEST)

hrev49477 adds 2 changesets to branch 'master'
old head: f9ab315e0243a142c9728e357dd82f048e7a4f0c
new head: f93dab03ec04d3129982bec6c0983ef72f5318d5
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=f93dab03ec04+%5Ef9ab315e0243

----------------------------------------------------------------------------

2df71589172c: DHCPClient: don't use AI_ADDRCONFIG

* The DHCP Client is the one configuring interfaces, so it makes no
sense to request address resolution for already configured interfaces
only.
* Fixes #12208

f93dab03ec04: getifaddrs: don't fail if there are no interfaces.

* This is not an error, just return an empty list.
* Same behavior as *BSD implementation.

[ Adrien Destugues <pulkomandy@xxxxxxxxx> ]

----------------------------------------------------------------------------

2 files changed, 4 insertions(+), 3 deletions(-)
src/kits/network/getifaddrs.cpp | 5 +++--
src/servers/net/DHCPClient.cpp | 2 +-

############################################################################

Commit: 2df71589172c3e758c8e0d8ef12d30583d110b18
URL: http://cgit.haiku-os.org/haiku/commit/?id=2df71589172c
Author: Adrien Destugues <pulkomandy@xxxxxxxxx>
Date: Wed Jul 29 20:52:25 2015 UTC

Ticket: https://dev.haiku-os.org/ticket/12208

DHCPClient: don't use AI_ADDRCONFIG

* The DHCP Client is the one configuring interfaces, so it makes no
sense to request address resolution for already configured interfaces
only.
* Fixes #12208

----------------------------------------------------------------------------

diff --git a/src/servers/net/DHCPClient.cpp b/src/servers/net/DHCPClient.cpp
index 35c5887..d5ffd0e 100644
--- a/src/servers/net/DHCPClient.cpp
+++ b/src/servers/net/DHCPClient.cpp
@@ -427,7 +427,7 @@ DHCPClient::DHCPClient(BMessenger target, const char*
device)
fResolverConfiguration(kMsgConfigureResolver),
fRunner(NULL),
fAssignedAddress(0),
- fServer(AF_INET, NULL, DHCP_SERVER_PORT),
+ fServer(AF_INET, NULL, DHCP_SERVER_PORT,
B_UNCONFIGURED_ADDRESS_FAMILIES),
fLeaseTime(0)
{
fTransactionID = (uint32)system_time() ^ rand();

############################################################################

Revision: hrev49477
Commit: f93dab03ec04d3129982bec6c0983ef72f5318d5
URL: http://cgit.haiku-os.org/haiku/commit/?id=f93dab03ec04
Author: Adrien Destugues <pulkomandy@xxxxxxxxx>
Date: Wed Jul 29 20:53:31 2015 UTC

getifaddrs: don't fail if there are no interfaces.

* This is not an error, just return an empty list.
* Same behavior as *BSD implementation.

----------------------------------------------------------------------------

diff --git a/src/kits/network/getifaddrs.cpp b/src/kits/network/getifaddrs.cpp
index 1b8d2e5..585a347 100644
--- a/src/kits/network/getifaddrs.cpp
+++ b/src/kits/network/getifaddrs.cpp
@@ -78,8 +78,9 @@ getifaddrs(struct ifaddrs** _ifaddrs)

size_t count = (size_t)config.ifc_value;
if (count == 0) {
- errno = B_BAD_VALUE;
- return -1;
+ // No interfaces found
+ *_ifaddrs = NULL;
+ return 0;
}

// Allocate a buffer for ifreqs for all interfaces


Other related posts: