From owner-svn-src-all@FreeBSD.ORG Thu Nov 12 03:55:41 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 69FC2106566B; Thu, 12 Nov 2009 03:55:41 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pz0-f185.google.com (mail-pz0-f185.google.com [209.85.222.185]) by mx1.freebsd.org (Postfix) with ESMTP id 2919F8FC12; Thu, 12 Nov 2009 03:55:40 +0000 (UTC) Received: by pzk15 with SMTP id 15so1298198pzk.3 for ; Wed, 11 Nov 2009 19:55:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=sxYmk77lcq70ap745/N7YwJ8csgXi3P90Ud4R/dxOKc=; b=Q5Gg0xk1lB5AIYCJuB7dXAtv2fHrzLuJN6a6hMVPkliZQqfGWLDs+toN3Qn9w+Zkvs FI+tijzIJFC4VtsvNpxfr5qukdzoeawbljgon0h7XjXnB1wEB2sqQzmPXhCUGvC//8Qm p4bJYZCUZuviDRSz4ipyQlk8uzyUbldboBySw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=qkhfs/2Qc0gLyj1XOFOe3CJOOoCYXTu0330TniNyiA5DBr8IliwzMc9nSFR0HXMTa+ K5sCdD/aizcQASVZa7W89wJQnSFWZ2fq0f40+EYxf3i0d2+WKCB/5onGeaa8vrlAL+LZ GcnN63bjn/R6QNl9BiKDQrzkwrQ8QBLPDUqsg= MIME-Version: 1.0 Received: by 10.142.120.1 with SMTP id s1mr248473wfc.245.1257998140621; Wed, 11 Nov 2009 19:55:40 -0800 (PST) In-Reply-To: <200911120046.nAC0kS2V012731@svn.freebsd.org> References: <200911120046.nAC0kS2V012731@svn.freebsd.org> Date: Wed, 11 Nov 2009 19:55:40 -0800 Message-ID: From: Navdeep Parhar To: Attilio Rao Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199208 - in head/sys: conf libkern netinet netinet/libalias 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 03:55:41 -0000 This seems to break kernel builds. Throwing away the private inet_aton implementation inside krping.c will probably fix it. /usr/src/sys/modules/rdma/krping/../../../contrib/rdma/krping/krping.c:117: error: static declaration of 'inet_aton' follows non-static declaration @/netinet/in.h:716: error: previous declaration of 'inet_aton' was here *** Error code 1 Regards, Navdeep On Wed, Nov 11, 2009 at 4:46 PM, Attilio Rao wrote: > Author: attilio > Date: Thu Nov 12 00:46:28 2009 > New Revision: 199208 > URL: http://svn.freebsd.org/changeset/base/199208 > > Log: > =A0Move inet_aton() (specular to inet_ntoa(), already present in libkern) > =A0into libkern in order to made it usable by other modules than alias_pr= oxy. > > =A0Obtained from: =A0 =A0 =A0 =A0Sandvine Incorporated > =A0Sponsored by: Sandvine Incorporated > =A0MFC: =A0 =A0 =A0 =A0 =A01 week > > Added: > =A0head/sys/libkern/inet_aton.c =A0 (contents, props changed) > Modified: > =A0head/sys/conf/files > =A0head/sys/netinet/in.h > =A0head/sys/netinet/libalias/alias_proxy.c > > Modified: head/sys/conf/files > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/conf/files Thu Nov 12 00:36:22 2009 =A0 =A0 =A0 =A0(r199207) > +++ head/sys/conf/files Thu Nov 12 00:46:28 2009 =A0 =A0 =A0 =A0(r199208) > @@ -2193,6 +2193,7 @@ libkern/iconv_converter_if.m =A0 =A0 =A0optional li > =A0libkern/iconv_xlat.c =A0 =A0 =A0 =A0 =A0 optional libiconv > =A0libkern/iconv_xlat16.c =A0 =A0 =A0 =A0 optional libiconv > =A0libkern/index.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0standar= d > +libkern/inet_aton.c =A0 =A0 =A0 =A0 =A0 =A0standard > =A0libkern/inet_ntoa.c =A0 =A0 =A0 =A0 =A0 =A0standard > =A0libkern/mcount.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 optional profiling-routin= e > =A0libkern/memcmp.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 standard > > Added: head/sys/libkern/inet_aton.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null =A0 00:00:00 1970 =A0 (empty, because file is newly added) > +++ head/sys/libkern/inet_aton.c =A0 =A0 =A0 =A0Thu Nov 12 00:46:28 2009 = =A0 =A0 =A0 =A0(r199208) > @@ -0,0 +1,136 @@ > +/*- > + * Copyright (c) 2001 Charles Mott > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * =A0 =A0notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * =A0 =A0notice, this list of conditions and the following disclaimer i= n the > + * =A0 =A0documentation and/or other materials provided with the distrib= ution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AN= D > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PU= RPOSE > + * ARE DISCLAIMED. =A0IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LI= ABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUE= NTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO= DS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, S= TRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY= WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O= F > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > + > +#include > + > +int > +inet_aton(const char *cp, struct in_addr *addr) > +{ > + =A0 =A0 =A0 u_long parts[4]; > + =A0 =A0 =A0 in_addr_t val; > + =A0 =A0 =A0 const char *c; > + =A0 =A0 =A0 char *endptr; > + =A0 =A0 =A0 int gotend, n; > + > + =A0 =A0 =A0 c =3D (const char *)cp; > + =A0 =A0 =A0 n =3D 0; > + > + =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0* Run through the string, grabbing numbers until > + =A0 =A0 =A0 =A0* the end of the string, or some error > + =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 gotend =3D 0; > + =A0 =A0 =A0 while (!gotend) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 unsigned long l; > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 l =3D strtoul(c, &endptr, 0); > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (l =3D=3D ULONG_MAX || (l =3D=3D 0 && en= dptr =3D=3D c)) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 val =3D (in_addr_t)l; > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* If the whole string is invalid, endptr= will equal > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* c.. this way we can make sure someone = hasn't > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* gone '.12' or something which would ge= t past > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* the next check. > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (endptr =3D=3D c) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 parts[n] =3D val; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 c =3D endptr; > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Check the next character past the previo= us number's end */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 switch (*c) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case '.' : > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Make sure we only do 3 d= ots .. */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (n =3D=3D 3) =A0 =A0 /* = Whoops. Quit. */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 n++; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 c++; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case '\0': > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gotend =3D 1; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 default: > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (isspace((unsigned char)= *c)) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gotend =3D = 1; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else { > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Invalid = character, then fail. */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + > + =A0 =A0 =A0 } > + > + =A0 =A0 =A0 /* Concoct the address according to the number of parts spe= cified. */ > + =A0 =A0 =A0 switch (n) { > + =A0 =A0 =A0 case 0: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* = a -- 32 bits */ > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* Nothing is necessary here. =A0Overflow= checking was > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* already done in strtoul(). > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 case 1: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* = a.b -- 8.24 bits */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (val > 0xffffff || parts[0] > 0xff) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 val |=3D parts[0] << 24; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + > + =A0 =A0 =A0 case 2: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* = a.b.c -- 8.8.16 bits */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (val > 0xffff || parts[0] > 0xff || part= s[1] > 0xff) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 val |=3D (parts[0] << 24) | (parts[1] << 16= ); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + > + =A0 =A0 =A0 case 3: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* = a.b.c.d -- 8.8.8.8 bits */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (val > 0xff || parts[0] > 0xff || parts[= 1] > 0xff || > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 parts[2] > 0xff) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 val |=3D (parts[0] << 24) | (parts[1] << 16= ) | (parts[2] << 8); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > + =A0 =A0 =A0 } > + > + =A0 =A0 =A0 if (addr !=3D NULL) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 addr->s_addr =3D htonl(val); > + =A0 =A0 =A0 return (1); > +} > + > > Modified: head/sys/netinet/in.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/netinet/in.h =A0 =A0 =A0 Thu Nov 12 00:36:22 2009 =A0 =A0 = =A0 =A0(r199207) > +++ head/sys/netinet/in.h =A0 =A0 =A0 Thu Nov 12 00:46:28 2009 =A0 =A0 = =A0 =A0(r199208) > @@ -713,6 +713,7 @@ int =A0in_broadcast(struct in_addr, struct > =A0int =A0 =A0 in_canforward(struct in_addr); > =A0int =A0 =A0 in_localaddr(struct in_addr); > =A0int =A0 =A0 in_localip(struct in_addr); > +int =A0 =A0 inet_aton(const char *, struct in_addr *); /* in libkern */ > =A0char =A0 *inet_ntoa(struct in_addr); /* in libkern */ > =A0char =A0 *inet_ntoa_r(struct in_addr ina, char *buf); /* in libkern */ > =A0void =A0 =A0in_ifdetach(struct ifnet *); > > Modified: head/sys/netinet/libalias/alias_proxy.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/netinet/libalias/alias_proxy.c =A0 =A0 Thu Nov 12 00:36:22 2= 009 =A0 =A0 =A0 =A0(r199207) > +++ head/sys/netinet/libalias/alias_proxy.c =A0 =A0 Thu Nov 12 00:46:28 2= 009 =A0 =A0 =A0 =A0(r199208) > @@ -137,9 +137,6 @@ struct proxy_entry { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0destinatio= n of a proxied IP packet > =A0*/ > > -#ifdef _KERNEL =A0 =A0 =A0 =A0 /* XXX: can it be moved to libkern? */ > -static int inet_aton(const char *cp, struct in_addr *addr); > -#endif > =A0static int =A0 =A0 IpMask(int, struct in_addr *); > =A0static int =A0 =A0 IpAddr(char *, struct in_addr *); > =A0static int =A0 =A0 IpPort(char *, int, int *); > @@ -149,107 +146,6 @@ static int =A0 =A0 =A0 =A0RuleNumberDelete(struct l= ibal > =A0static void =A0 =A0ProxyEncodeTcpStream(struct alias_link *, struct ip= *, int); > =A0static void =A0 =A0ProxyEncodeIpHeader(struct ip *, int); > > -#ifdef _KERNEL > -static int > -inet_aton(cp, addr) > - =A0 =A0 =A0 =A0const char *cp; > - =A0 =A0 =A0 =A0struct in_addr *addr; > -{ > - =A0 =A0 =A0 u_long parts[4]; > - =A0 =A0 =A0 in_addr_t val; > - =A0 =A0 =A0 const char *c; > - =A0 =A0 =A0 char *endptr; > - =A0 =A0 =A0 int gotend, n; > - > - =A0 =A0 =A0 c =3D (const char *)cp; > - =A0 =A0 =A0 n =3D 0; > - =A0 =A0 =A0 /* > - =A0 =A0 =A0 =A0* Run through the string, grabbing numbers until > - =A0 =A0 =A0 =A0* the end of the string, or some error > - =A0 =A0 =A0 =A0*/ > - =A0 =A0 =A0 gotend =3D 0; > - =A0 =A0 =A0 while (!gotend) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 unsigned long l; > - > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 l =3D strtoul(c, &endptr, 0); > - > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (l =3D=3D ULONG_MAX || (l =3D=3D 0 && en= dptr =3D=3D c)) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); > - > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 val =3D (in_addr_t)l; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* If the whole string is invalid, endptr= will equal > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* c.. this way we can make sure someone = hasn't > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* gone '.12' or something which would ge= t past > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* the next check. > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (endptr =3D=3D c) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 parts[n] =3D val; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 c =3D endptr; > - > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Check the next character past the previo= us number's end */ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 switch (*c) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 case '.' : > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Make sure we only do 3 d= ots .. */ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (n =3D=3D 3) =A0 =A0 /* = Whoops. Quit. */ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 n++; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 c++; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > - > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 case '\0': > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gotend =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > - > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 default: > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (isspace((unsigned char)= *c)) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 gotend =3D = 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0);= =A0 =A0 /* Invalid character, so fail */ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > - > - =A0 =A0 =A0 } > - > - =A0 =A0 =A0 /* > - =A0 =A0 =A0 =A0* Concoct the address according to > - =A0 =A0 =A0 =A0* the number of parts specified. > - =A0 =A0 =A0 =A0*/ > - > - =A0 =A0 =A0 switch (n) { > - =A0 =A0 =A0 case 0: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* = a -- 32 bits */ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* Nothing is necessary here. =A0Overflow= checking was > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* already done in strtoul(). > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > - =A0 =A0 =A0 case 1: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* = a.b -- 8.24 bits */ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (val > 0xffffff || parts[0] > 0xff) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 val |=3D parts[0] << 24; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > - > - =A0 =A0 =A0 case 2: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* = a.b.c -- 8.8.16 bits */ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (val > 0xffff || parts[0] > 0xff || part= s[1] > 0xff) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 val |=3D (parts[0] << 24) | (parts[1] << 16= ); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > - > - =A0 =A0 =A0 case 3: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* = a.b.c.d -- 8.8.8.8 bits */ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (val > 0xff || parts[0] > 0xff || parts[= 1] > 0xff || > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 parts[2] > 0xff) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 val |=3D (parts[0] << 24) | (parts[1] << 16= ) | (parts[2] << 8); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; > - =A0 =A0 =A0 } > - > - =A0 =A0 =A0 if (addr !=3D NULL) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 addr->s_addr =3D htonl(val); > - =A0 =A0 =A0 return (1); > -} > -#endif > - > =A0static int > =A0IpMask(int nbits, struct in_addr *mask) > =A0{ > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" >