From owner-svn-src-all@FreeBSD.ORG Thu Nov 12 14:22:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBC4E106566C; Thu, 12 Nov 2009 14:22:12 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0D768FC15; Thu, 12 Nov 2009 14:22:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nACEMCa9032696; Thu, 12 Nov 2009 14:22:12 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nACEMCAA032694; Thu, 12 Nov 2009 14:22:12 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911121422.nACEMCAA032694@svn.freebsd.org> From: Attilio Rao Date: Thu, 12 Nov 2009 14:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199223 - head/sys/contrib/rdma/krping X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2009 14:22:13 -0000 Author: attilio Date: Thu Nov 12 14:22:12 2009 New Revision: 199223 URL: http://svn.freebsd.org/changeset/base/199223 Log: Remove the explicit definition of inet_aton() as it was introduced as a general function in r199208. Reported by: np Sponsored by: Sandvine Incorporated MFC: 1 week Modified: head/sys/contrib/rdma/krping/krping.c Modified: head/sys/contrib/rdma/krping/krping.c ============================================================================== --- head/sys/contrib/rdma/krping/krping.c Thu Nov 12 13:09:36 2009 (r199222) +++ head/sys/contrib/rdma/krping/krping.c Thu Nov 12 14:22:12 2009 (r199223) @@ -112,109 +112,6 @@ struct krping_cb_list krping_cbs; #define RPING_BUFSIZE 128*1024 #define RPING_SQ_DEPTH 32 - -/* lifted from netinet/libalias/alias_proxy.c */ -static int inet_aton(const char *cp, struct in_addr *addr); -static int -inet_aton(cp, addr) - const char *cp; - struct in_addr *addr; -{ - u_long parts[4]; - in_addr_t val; - const char *c; - char *endptr; - int gotend, n; - - c = (const char *)cp; - n = 0; - /* - * Run through the string, grabbing numbers until - * the end of the string, or some error - */ - gotend = 0; - while (!gotend) { - unsigned long l; - - l = strtoul(c, &endptr, 0); - - if (l == ULONG_MAX || (l == 0 && endptr == c)) - return (0); - - val = (in_addr_t)l; - /* - * If the whole string is invalid, endptr will equal - * c.. this way we can make sure someone hasn't - * gone '.12' or something which would get past - * the next check. - */ - if (endptr == c) - return (0); - parts[n] = val; - c = endptr; - - /* Check the next character past the previous number's end */ - switch (*c) { - case '.' : - /* Make sure we only do 3 dots .. */ - if (n == 3) /* Whoops. Quit. */ - return (0); - n++; - c++; - break; - - case '\0': - gotend = 1; - break; - - default: - if (isspace((unsigned char)*c)) { - gotend = 1; - break; - } else - return (0); /* Invalid character, so fail */ - } - - } - - /* - * Concoct the address according to - * the number of parts specified. - */ - - switch (n) { - case 0: /* a -- 32 bits */ - /* - * Nothing is necessary here. Overflow checking was - * already done in strtoul(). - */ - break; - case 1: /* a.b -- 8.24 bits */ - if (val > 0xffffff || parts[0] > 0xff) - return (0); - val |= parts[0] << 24; - break; - - case 2: /* a.b.c -- 8.8.16 bits */ - if (val > 0xffff || parts[0] > 0xff || parts[1] > 0xff) - return (0); - val |= (parts[0] << 24) | (parts[1] << 16); - break; - - case 3: /* a.b.c.d -- 8.8.8.8 bits */ - if (val > 0xff || parts[0] > 0xff || parts[1] > 0xff || - parts[2] > 0xff) - return (0); - val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); - break; - } - - if (addr != NULL) - addr->s_addr = htonl(val); - return (1); -} - - static void krping_wait(struct krping_cb *cb, int state) { int rc;