diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-05 18:30:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-05 18:30:53 -0400 |
commit | b7405e16435f710edfae6ba32bef4ca20d3de145 (patch) | |
tree | e79fd7560d8c093cb975ed61b24d009a080872c5 /fs/cifs/netmisc.c | |
parent | ea62ccd00fd0b6720b033adfc9984f31130ce195 (diff) | |
parent | 0ec54aa8af5e6faa346aa55a1ad15ee6c25bb42d (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
[CIFS] Fix typo in cifs readme from previous commit
[CIFS] Make sec=none force an anonymous mount
[CIFS] Change semaphore to mutex for cifs lock_sem
[CIFS] Fix oops in reset_cifs_unix_caps on reconnect
[CIFS] UID/GID override on CIFS mounts to Samba
[CIFS] prefixpath mounts to servers supporting posix paths used wrong slash
[CIFS] Update cifs version to 1.49
[CIFS] Replace kmalloc/memset combination with kzalloc
[CIFS] Add IPv6 support
[CIFS] New CIFS POSIX mkdir performance improvement (part 2)
[CIFS] New CIFS POSIX mkdir performance improvement
[CIFS] Add write perm for usr to file on windows should remove r/o dos attr
[CIFS] Remove unnecessary parm to cifs_reopen_file
[CIFS] Switch cifsd to kthread_run from kernel_thread
[CIFS] Remove unnecessary checks
Diffstat (limited to 'fs/cifs/netmisc.c')
-rw-r--r-- | fs/cifs/netmisc.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c index 992e80edc720..53e304d59544 100644 --- a/fs/cifs/netmisc.c +++ b/fs/cifs/netmisc.c | |||
@@ -30,6 +30,9 @@ | |||
30 | #include <linux/fs.h> | 30 | #include <linux/fs.h> |
31 | #include <asm/div64.h> | 31 | #include <asm/div64.h> |
32 | #include <asm/byteorder.h> | 32 | #include <asm/byteorder.h> |
33 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
34 | #include <linux/inet.h> | ||
35 | #endif | ||
33 | #include "cifsfs.h" | 36 | #include "cifsfs.h" |
34 | #include "cifspdu.h" | 37 | #include "cifspdu.h" |
35 | #include "cifsglob.h" | 38 | #include "cifsglob.h" |
@@ -129,11 +132,27 @@ static const struct smb_to_posix_error mapping_table_ERRHRD[] = { | |||
129 | /* Convert string containing dotted ip address to binary form */ | 132 | /* Convert string containing dotted ip address to binary form */ |
130 | /* returns 0 if invalid address */ | 133 | /* returns 0 if invalid address */ |
131 | 134 | ||
132 | /* BB add address family, change rc to status flag and return union or for ipv6 */ | ||
133 | /* will need parent to call something like inet_pton to convert ipv6 address BB */ | ||
134 | int | 135 | int |
135 | cifs_inet_pton(int address_family, char *cp,void *dst) | 136 | cifs_inet_pton(int address_family, char *cp,void *dst) |
136 | { | 137 | { |
138 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
139 | int ret = 0; | ||
140 | |||
141 | /* calculate length by finding first slash or NULL */ | ||
142 | /* BB Should we convert '/' slash to '\' here since it seems already done | ||
143 | before this */ | ||
144 | if( address_family == AF_INET ){ | ||
145 | ret = in4_pton(cp, -1 /* len */, dst , '\\', NULL); | ||
146 | } else if( address_family == AF_INET6 ){ | ||
147 | ret = in6_pton(cp, -1 /* len */, dst , '\\', NULL); | ||
148 | } | ||
149 | #ifdef CONFIG_CIFS_DEBUG2 | ||
150 | cFYI(1,("address conversion returned %d for %s", ret, cp)); | ||
151 | #endif | ||
152 | if (ret > 0) | ||
153 | ret = 1; | ||
154 | return ret; | ||
155 | #else | ||
137 | int value; | 156 | int value; |
138 | int digit; | 157 | int digit; |
139 | int i; | 158 | int i; |
@@ -192,6 +211,7 @@ cifs_inet_pton(int address_family, char *cp,void *dst) | |||
192 | 211 | ||
193 | *((__be32 *)dst) = *((__be32 *) bytes) | htonl(value); | 212 | *((__be32 *)dst) = *((__be32 *) bytes) | htonl(value); |
194 | return 1; /* success */ | 213 | return 1; /* success */ |
214 | #endif /* EXPERIMENTAL */ | ||
195 | } | 215 | } |
196 | 216 | ||
197 | /***************************************************************************** | 217 | /***************************************************************************** |