From patchwork Tue Feb 15 18:54:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 559361 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 p1FItDKc004453 for ; Tue, 15 Feb 2011 18:55:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752462Ab1BOSzE (ORCPT ); Tue, 15 Feb 2011 13:55:04 -0500 Received: from mail-yw0-f46.google.com ([209.85.213.46]:60896 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755888Ab1BOSzD (ORCPT ); Tue, 15 Feb 2011 13:55:03 -0500 Received: by ywo7 with SMTP id 7so243061ywo.19 for ; Tue, 15 Feb 2011 10:55:02 -0800 (PST) Received: by 10.90.31.11 with SMTP id e11mr6570769age.184.1297796102241; Tue, 15 Feb 2011 10:55:02 -0800 (PST) Received: from salusa.poochiereds.net (cpe-071-070-153-003.nc.res.rr.com [71.70.153.3]) by mx.google.com with ESMTPS id w6sm5329614anf.6.2011.02.15.10.55.01 (version=SSLv3 cipher=OTHER); Tue, 15 Feb 2011 10:55:01 -0800 (PST) From: Jeff Layton To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, bj@sernet.de, dhowells@redhat.com Subject: [PATCH] cifs: fix handling of scopeid in cifs_convert_address Date: Tue, 15 Feb 2011 13:54:56 -0500 Message-Id: <1297796096-5162-1-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.4 MIME-Version: 1.0 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.6 (demeter1.kernel.org [140.211.167.41]); Tue, 15 Feb 2011 18:55:24 +0000 (UTC) diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c index 8d9189f..79f641e 100644 --- a/fs/cifs/netmisc.c +++ b/fs/cifs/netmisc.c @@ -170,7 +170,7 @@ cifs_convert_address(struct sockaddr *dst, const char *src, int len) { int rc, alen, slen; const char *pct; - char *endp, scope_id[13]; + char scope_id[13]; struct sockaddr_in *s4 = (struct sockaddr_in *) dst; struct sockaddr_in6 *s6 = (struct sockaddr_in6 *) dst; @@ -197,9 +197,9 @@ cifs_convert_address(struct sockaddr *dst, const char *src, int len) memcpy(scope_id, pct + 1, slen); scope_id[slen] = '\0'; - s6->sin6_scope_id = (u32) simple_strtoul(pct, &endp, 0); - if (endp != scope_id + slen) - return 0; + rc = strict_strtoul(scope_id, 0, + (unsigned long *)&s6->sin6_scope_id); + rc = (rc == 0) ? 1 : 0; } return rc;