diff options
Diffstat (limited to 'fs/cifs/netmisc.c')
-rw-r--r-- | fs/cifs/netmisc.c | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c index 53e304d59544..b388c356fde0 100644 --- a/fs/cifs/netmisc.c +++ b/fs/cifs/netmisc.c | |||
@@ -135,7 +135,6 @@ static const struct smb_to_posix_error mapping_table_ERRHRD[] = { | |||
135 | int | 135 | int |
136 | cifs_inet_pton(int address_family, char *cp,void *dst) | 136 | cifs_inet_pton(int address_family, char *cp,void *dst) |
137 | { | 137 | { |
138 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
139 | int ret = 0; | 138 | int ret = 0; |
140 | 139 | ||
141 | /* calculate length by finding first slash or NULL */ | 140 | /* calculate length by finding first slash or NULL */ |
@@ -152,66 +151,6 @@ cifs_inet_pton(int address_family, char *cp,void *dst) | |||
152 | if (ret > 0) | 151 | if (ret > 0) |
153 | ret = 1; | 152 | ret = 1; |
154 | return ret; | 153 | return ret; |
155 | #else | ||
156 | int value; | ||
157 | int digit; | ||
158 | int i; | ||
159 | char temp; | ||
160 | char bytes[4]; | ||
161 | char *end = bytes; | ||
162 | static const int addr_class_max[4] = | ||
163 | { 0xffffffff, 0xffffff, 0xffff, 0xff }; | ||
164 | |||
165 | if(address_family != AF_INET) | ||
166 | return -EAFNOSUPPORT; | ||
167 | |||
168 | for (i = 0; i < 4; i++) { | ||
169 | bytes[i] = 0; | ||
170 | } | ||
171 | |||
172 | temp = *cp; | ||
173 | |||
174 | while (TRUE) { | ||
175 | if (!isdigit(temp)) | ||
176 | return 0; | ||
177 | |||
178 | value = 0; | ||
179 | digit = 0; | ||
180 | for (;;) { | ||
181 | if (isascii(temp) && isdigit(temp)) { | ||
182 | value = (value * 10) + temp - '0'; | ||
183 | temp = *++cp; | ||
184 | digit = 1; | ||
185 | } else | ||
186 | break; | ||
187 | } | ||
188 | |||
189 | if (temp == '.') { | ||
190 | if ((end > bytes + 2) || (value > 255)) | ||
191 | return 0; | ||
192 | *end++ = value; | ||
193 | temp = *++cp; | ||
194 | } else if (temp == ':') { | ||
195 | cFYI(1,("IPv6 addresses not supported for CIFS mounts yet")); | ||
196 | return -1; | ||
197 | } else | ||
198 | break; | ||
199 | } | ||
200 | |||
201 | /* check for last characters */ | ||
202 | if (temp != '\0' && (!isascii(temp) || !isspace(temp))) | ||
203 | if (temp != '\\') { | ||
204 | if (temp != '/') | ||
205 | return 0; | ||
206 | else | ||
207 | (*cp = '\\'); /* switch the slash the expected way */ | ||
208 | } | ||
209 | if (value > addr_class_max[end - bytes]) | ||
210 | return 0; | ||
211 | |||
212 | *((__be32 *)dst) = *((__be32 *) bytes) | htonl(value); | ||
213 | return 1; /* success */ | ||
214 | #endif /* EXPERIMENTAL */ | ||
215 | } | 154 | } |
216 | 155 | ||
217 | /***************************************************************************** | 156 | /***************************************************************************** |