[PATCH] Deprecate 'bind interfaces only' parameter

Tim Potter tpot at samba.org
Fri Dec 9 04:30:16 GMT 2005


Is there really any need for two parameters to manage which interfaces
Samba is to operate on?  The attached patch deprecates the 'bind
interfaces only' parameter which doesn't seem to do very much at all
really.

The only problem I can see is that setting 'bind interfaces only = no'
and having an interfaces line will be broken, but then it's broken now
anyway.  It will just be broken differently.

Comments?


Tim.
-------------- next part --------------
Index: smbd/server.c
===================================================================
--- smbd/server.c	(revision 12135)
+++ smbd/server.c	(working copy)
@@ -229,7 +229,7 @@
 		ports = smb_xstrdup(smb_ports);
 	}
 
-	if (lp_interfaces() && lp_bind_interfaces_only()) {
+	if (lp_interfaces()) {
 		/* We have been given an interfaces line, and been 
 		   told to only bind to those interfaces. Create a
 		   socket per interface and bind to only these.
Index: wrepld/server.c
===================================================================
--- wrepld/server.c	(revision 12135)
+++ wrepld/server.c	(working copy)
@@ -187,7 +187,7 @@
 
 	FD_ZERO(listen_set);
 
-	if(lp_interfaces() && lp_bind_interfaces_only()) {
+	if(lp_interfaces()) {
 		/* We have been given an interfaces line, and been 
 		   told to only bind to those interfaces. Create a
 		   socket per interface and bind to only these.
Index: param/loadparm.c
===================================================================
--- param/loadparm.c	(revision 12135)
+++ param/loadparm.c	(working copy)
@@ -837,7 +837,7 @@
 	{"netbios scope", P_USTRING, P_GLOBAL, &Globals.szNetbiosScope, handle_netbios_scope,  NULL, FLAG_ADVANCED}, 
 	{"server string", P_STRING, P_GLOBAL, &Globals.szServerString, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED }, 
 	{"interfaces", P_LIST, P_GLOBAL, &Globals.szInterfaces, NULL, NULL, FLAG_BASIC | FLAG_ADVANCED | FLAG_WIZARD}, 
-	{"bind interfaces only", P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, FLAG_ADVANCED | FLAG_WIZARD}, 
+	{"bind interfaces only", P_BOOL, P_GLOBAL, &Globals.bBindInterfacesOnly, NULL, NULL, FLAG_ADVANCED | FLAG_DEPRECATED}, 
 
 	{N_("Security Options"), P_SEP, P_SEPARATOR}, 
 
@@ -1858,7 +1858,6 @@
 FN_GLOBAL_BOOL(lp_browse_list, &Globals.bBrowseList)
 FN_GLOBAL_BOOL(lp_nis_home_map, &Globals.bNISHomeMap)
 static FN_GLOBAL_BOOL(lp_time_server, &Globals.bTimeServer)
-FN_GLOBAL_BOOL(lp_bind_interfaces_only, &Globals.bBindInterfacesOnly)
 FN_GLOBAL_BOOL(lp_pam_password_change, &Globals.bPamPasswordChange)
 FN_GLOBAL_BOOL(lp_unix_password_sync, &Globals.bUnixPasswdSync)
 FN_GLOBAL_BOOL(lp_passwd_chat_debug, &Globals.bPasswdChatDebug)
Index: nmbd/nmbd_packets.c
===================================================================
--- nmbd/nmbd_packets.c	(revision 12135)
+++ nmbd/nmbd_packets.c	(working copy)
@@ -718,10 +718,10 @@
 					to_ip)) == NULL)
 		return NULL;
 
-	if(lp_bind_interfaces_only()) {
+	if(lp_interfaces()) {
 		int i;
 
-		DEBUG(10,("queue_query_name: bind_interfaces_only is set, looking for suitable source IP\n"));
+		DEBUG(10,("queue_query_name: lp_interfaces is set, looking for suitable source IP\n"));
 		for(i = 0; i < iface_count(); i++) {
 			struct in_addr *ifip = iface_n_ip(i);
 
@@ -1791,7 +1791,7 @@
 					 * If we got a packet on the broadcast socket and interfaces
 					 * only is set then check it came from one of our local nets. 
 					 */
-					if(lp_bind_interfaces_only() && (sock_array[i] == ClientNMB) && 
+					if(lp_interfaces() && (sock_array[i] == ClientNMB) && 
 								(!is_local_net(packet->ip))) {
 						DEBUG(7,("discarding nmb packet sent to broadcast socket from %s:%d\n",
 							inet_ntoa(packet->ip),packet->port));	  
@@ -1818,7 +1818,7 @@
 					 * If we got a packet on the broadcast socket and interfaces
 					 * only is set then check it came from one of our local nets. 
 					 */
-					if(lp_bind_interfaces_only() && (sock_array[i] == ClientDGRAM) && 
+					if(lp_interfaces() && (sock_array[i] == ClientDGRAM) && 
 								(!is_local_net(packet->ip))) {
 						DEBUG(7,("discarding dgram packet sent to broadcast socket from %s:%d\n",
 						inet_ntoa(packet->ip),packet->port));	  


More information about the samba-technical mailing list