* Added "services" to the network settings, and refactored the settings class a bit

to be easier extendable with more classes.
* Fixed a bug in the settings that caused updated settings to be appended to the
  existing ones (missing BMessage::MakeEmpty()).
* Started services system, doesn't do anything useful yet (inetd replacement).
* Fixed the bug that caused the loopback default netmask to be incorrectly chosen;
  removed the temporary fix Bruno introduced before. The same bug has been in
  ifconfig where I copied the code from (but wrote it there, too) :-).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19609 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-12-22 20:53:08 +00:00
parent d2980e876d
commit fc398fa2ab
7 changed files with 420 additions and 50 deletions
+2 -2
View File
@@ -526,7 +526,7 @@ configure_interface(int socket, const char* name, char* const* args,
if (!hasMask && hasAddress && kFamilies[familyIndex].family == AF_INET
&& ioctl(socket, SIOCGIFNETMASK, &request, sizeof(struct ifreq)) == 0
&& request.ifr_mask.sa_family == AF_UNSPEC) {
// generate standard netmask if it doesn't have one yet
// generate standard netmask if it doesn't have one yet
sockaddr_in *netmask = (sockaddr_in *)&mask;
netmask->sin_len = sizeof(sockaddr_in);
netmask->sin_family = AF_INET;
@@ -537,7 +537,7 @@ configure_interface(int socket, const char* name, char* const* args,
|| (ntohl(net) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) {
// class A, or loopback
netmask->sin_addr.s_addr = IN_CLASSA_NET;
} if (IN_CLASSB(net)) {
} else if (IN_CLASSB(net)) {
// class B
netmask->sin_addr.s_addr = IN_CLASSB_NET;
} else {