From patchwork Fri Oct 8 19:15:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 242131 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o98JF9vE015364 for ; Fri, 8 Oct 2010 19:15:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759367Ab0JHTPI (ORCPT ); Fri, 8 Oct 2010 15:15:08 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.120]:53721 "EHLO cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754242Ab0JHTPI (ORCPT ); Fri, 8 Oct 2010 15:15:08 -0400 X-Authority-Analysis: v=1.1 cv=tl/FS04gSkLncqxOIKBEYmN/gODDJX05BQMXZ5l6AuI= c=1 sm=0 a=O1JzyUSBN_wA:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=hGzw-44bAAAA:8 a=pRApKNl7JDfqj5NCBZsA:9 a=mKKlkcKOSiXaRIYkuwkA:7 a=lYKYRopGtnCOurCcvepOuGK8wNoA:4 a=dowx1zmaLagA:10 a=6aRupTBgytFeZ2G5:21 a=nokLO7rqYS-U-kAj:21 a=ld/erqUjW76FpBUqCqkKeA==:117 X-Cloudmark-Score: 0 X-Originating-IP: 71.70.153.3 Received: from [71.70.153.3] ([71.70.153.3:53519] helo=mail.poochiereds.net) by cdptpa-oedge03.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id A8/D6-19342-ABD6FAC4; Fri, 08 Oct 2010 19:15:07 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id 880705817F; Fri, 8 Oct 2010 15:15:06 -0400 (EDT) From: Jeff Layton To: linux-cifs@vger.kernel.org Subject: [PATCH] mount.cifs: reinstate ip= as an override for address resolution Date: Fri, 8 Oct 2010 15:15:05 -0400 Message-Id: <1286565306-32035-1-git-send-email-jlayton@samba.org> X-Mailer: git-send-email 1.7.2.3 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 08 Oct 2010 19:15:25 +0000 (UTC) diff --git a/mount.cifs.c b/mount.cifs.c index ed27bba..df92d79 100644 --- a/mount.cifs.c +++ b/mount.cifs.c @@ -958,10 +958,12 @@ parse_options(const char *data, struct parsed_mount_info *parsed_info) "target ip address argument missing\n"); } else if (strnlen(value, MAX_ADDRESS_LEN) <= MAX_ADDRESS_LEN) { + strcpy(parsed_info->addrlist, value); if (parsed_info->verboseflag) fprintf(stderr, "ip address %s override specified\n", value); + goto nocopy; } else { fprintf(stderr, "ip address too long\n"); return EX_USAGE; @@ -1556,7 +1558,9 @@ assemble_mountinfo(struct parsed_mount_info *parsed_info, if (rc) goto assemble_exit; - rc = resolve_host(parsed_info->host, parsed_info->addrlist); + if (parsed_info->addrlist[0] == '\0') + rc = resolve_host(parsed_info->host, parsed_info->addrlist); + switch (rc) { case EX_USAGE: fprintf(stderr, "mount error: could not resolve address for "