Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S939937AbXFHH6P (ORCPT ); Fri, 8 Jun 2007 03:58:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S938420AbXFHHZh (ORCPT ); Fri, 8 Jun 2007 03:25:37 -0400 Received: from 216-99-217-87.dsl.aracnet.com ([216.99.217.87]:55378 "EHLO sous-sol.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967120AbXFHHZb (ORCPT ); Fri, 8 Jun 2007 03:25:31 -0400 Message-Id: <20070608072228.752057000@sous-sol.org> References: <20070608072127.352723000@sous-sol.org> User-Agent: quilt/0.46-1 Date: Fri, 08 Jun 2007 00:22:09 -0700 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, David Miller , bunk@stusta.de, Jerome Borsboom , Greg Kroah-Hartman Subject: [patch 42/54] NET: parse ip:port strings correctly in in4_pton Content-Disposition: inline; filename=net-parse-ip-port-strings-correctly-in-in4_pton.patch Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2010 Lines: 54 -stable review patch. If anyone has any objections, please let us know. --------------------- From: Jerome Borsboom in4_pton converts a textual representation of an ip4 address into an integer representation. However, when the textual representation is of in the form ip:port, e.g. 192.168.1.1:5060, and 'delim' is set to -1, the function bails out with an error when reading the colon. It makes sense to allow the colon as a delimiting character without explicitly having to set it through the 'delim' variable as there can be no ambiguity in the point where the ip address is completely parsed. This function is indeed called from nf_conntrack_sip.c in this way to parse textual ip:port combinations which fails due to the reason stated above. Signed-off-by: Jerome Borsboom Signed-off-by: David S. Miller Signed-off-by: Chris Wright Signed-off-by: Greg Kroah-Hartman --- net/core/utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- linux-2.6.21.4.orig/net/core/utils.c +++ linux-2.6.21.4/net/core/utils.c @@ -137,16 +137,16 @@ int in4_pton(const char *src, int srclen while(1) { int c; c = xdigit2bin(srclen > 0 ? *s : '\0', delim); - if (!(c & (IN6PTON_DIGIT | IN6PTON_DOT | IN6PTON_DELIM))) { + if (!(c & (IN6PTON_DIGIT | IN6PTON_DOT | IN6PTON_DELIM | IN6PTON_COLON_MASK))) { goto out; } - if (c & (IN6PTON_DOT | IN6PTON_DELIM)) { + if (c & (IN6PTON_DOT | IN6PTON_DELIM | IN6PTON_COLON_MASK)) { if (w == 0) goto out; *d++ = w & 0xff; w = 0; i++; - if (c & IN6PTON_DELIM) { + if (c & (IN6PTON_DELIM | IN6PTON_COLON_MASK)) { if (i != 4) goto out; break; -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/