Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=83f03fa5adbad0a829424241ad24ef9e4b4ba585
Commit:     83f03fa5adbad0a829424241ad24ef9e4b4ba585
Parent:     7ebba6d14f8d63cad583bf1cc0330b601d5a8171
Author:     Jerome Borsboom <[EMAIL PROTECTED]>
AuthorDate: Tue May 29 12:59:54 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Thu May 31 01:23:27 2007 -0700

    [NET]: parse ip:port strings correctly in in4_pton
    
    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 <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/core/utils.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/core/utils.c b/net/core/utils.c
index adecfd2..2030bb8 100644
--- a/net/core/utils.c
+++ b/net/core/utils.c
@@ -139,16 +139,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 git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to