Skip to contentSkip to conversation

PATCH: Enable binding to local IPv4 IP address for CIFS file system.

PATCH Ben Greear 2 participants 2 messages Aug 1, 2006

lore
Share & tools
lore

Ben Greear

author
#0 lore raw

This patch provides the ability to bind to a local IP address when mounting CIFS file systems. This allows better specification of which interface a mount may use on a multi-homed machine, for instance.

The corresponding patch for mount.cifs has already been sent to the samba mailing list.

Please consider this for 2.6.19.

fs/cifs/cifsglob.h +1 -0
index 006eb33..1f34c3f 100644
@@ -118,6 +118,7 @@ struct TCP_Server_Info {
 		struct sockaddr_in sockAddr;
 		struct sockaddr_in6 sockAddr6;
 	} addr;
+	u32 ip4_local_ip; /* if != 0, will bind locally to this IP */
 	wait_queue_head_t response_q;
 	wait_queue_head_t request_q; /* if more than maxmpx to srvr must block*/
 	struct list_head pending_mid_q;
fs/cifs/connect.c +55 -12

154 lines not on this page · raw message

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
#1 lore raw

fs/cifs/cifsglob.h struct TCP_Server_Info { · line 121

Quoted 10 lines · Ben Greear
fs/cifs/cifsglob.h +1 -0
index 006eb33..1f34c3f 100644
@@ -118,6 +118,7 @@ struct TCP_Server_Info {
  		struct sockaddr_in sockAddr;
  		struct sockaddr_in6 sockAddr6;
  	} addr;
+	u32 ip4_local_ip; /* if != 0, will bind locally to this IP */

adding a ipv4 only, no ipv6 feature like this at this age seems quite backwards. If anything you should think of easy expansion to IPv6 at least.

-Andi