svn commit: r213403 - head/lib/libc/net

2010-10-04 Thread Hajimu UMEMOTO
Author: ume
Date: Mon Oct  4 15:28:01 2010
New Revision: 213403
URL: http://svn.freebsd.org/changeset/base/213403

Log:
  Clear errno for each method dispatch.
  
  Spotted by:   Kostik Belousov 
  MFC after:2 weeks

Modified:
  head/lib/libc/net/nsdispatch.c

Modified: head/lib/libc/net/nsdispatch.c
==
--- head/lib/libc/net/nsdispatch.c  Mon Oct  4 14:32:14 2010
(r213402)
+++ head/lib/libc/net/nsdispatch.c  Mon Oct  4 15:28:01 2010
(r213403)
@@ -707,11 +707,13 @@ _nsdispatch(void *retval, const ns_dtab 
va_end(ap);
} else {
cache_flag = 0;
+   errno = 0;
va_start(ap, defaults);
result = method(retval, mdata, ap);
va_end(ap);
}
 #else /* NS_CACHING */
+   errno = 0;
va_start(ap, defaults);
result = method(retval, mdata, ap);
va_end(ap);
___
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-unsubscr...@freebsd.org"


Re: svn commit: r211276 - head/lib/libc/net

2010-10-04 Thread Hajimu UMEMOTO
Hi,

>>>>> On Sun, 3 Oct 2010 21:49:26 +0300
>>>>> Kostik Belousov  said:

kostikbel> I suspect there is some subtle issue with the commit present.
kostikbel> When getprotobyname_r() is unable to find the protocol, it seems
kostikbel> that established behaviour is to return 0 and set *protoent to NULL.

The behavior you mentioned is questionable to me.  Though I cannot
find the manpage of getprotobyname_r(3), there is following
description in the manpage of gethostbyname_r(3) on CentOS:

Glibc2 also has reentrant versions gethostbyname_r() and
gethostbyname2_r().  These return 0 on success and non-zero on
error.

When getprotobyname_r(3) is unable to find the protocol, it should be
treated as error, IMHO.  My intention is that when getprotobyname_r(3)
ends up with error but errno is zero, the return code should be
non-zero (-1).

kostikbel> The getprotobyname_r() in HEAD and stable/8, when the protocol
kostikbel> cannot be found, return whatever value was present in errno at the 
time
kostikbel> of the call.

In anyway, errno should be cleared.  I've just committed to clear
errno for each method dispatch.

kostikbel> When run with the argument "tcp1" on Linux, I get
kostikbel>  Res 0 errno 0 Success pres (nil)
kostikbel> On the recent FreeBSD I get
kostikbel>  Res 25 errno 25 Inappropriate ioctl for device pres 0x0
kostikbel> (ENOTTY is from stdio).

Now, it shows:

Res -1 errno 22 Unknown error: 0 pres 0x0

(When strerror(3) is called with 0 for its argument, it set errno to
EINVAL.)

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
u...@mahoroba.org  u...@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/
___
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-unsubscr...@freebsd.org"


svn commit: r213453 - head/lib/libc/net

2010-10-05 Thread Hajimu UMEMOTO
Author: ume
Date: Tue Oct  5 15:40:59 2010
New Revision: 213453
URL: http://svn.freebsd.org/changeset/base/213453

Log:
  When no protocol entry is found, getproto*_r(3) should
  return zero.
  
  Spotted by:   Kostik Belousov 
  MFC after:2 weeks

Modified:
  head/lib/libc/net/getproto.c
  head/lib/libc/net/getprotoent.c
  head/lib/libc/net/getprotoname.c

Modified: head/lib/libc/net/getproto.c
==
--- head/lib/libc/net/getproto.cTue Oct  5 15:31:56 2010
(r213452)
+++ head/lib/libc/net/getproto.cTue Oct  5 15:40:59 2010
(r213453)
@@ -123,7 +123,7 @@ getprotobynumber_r(int proto, struct pro
 
if (rv != NS_SUCCESS) {
errno = ret_errno;
-   return ((ret_errno != 0) ? ret_errno : -1);
+   return (ret_errno);
}
return (0);
 }

Modified: head/lib/libc/net/getprotoent.c
==
--- head/lib/libc/net/getprotoent.c Tue Oct  5 15:31:56 2010
(r213452)
+++ head/lib/libc/net/getprotoent.c Tue Oct  5 15:40:59 2010
(r213453)
@@ -494,7 +494,7 @@ getprotoent_r(struct protoent *pptr, cha
 
if (rv != NS_SUCCESS) {
errno = ret_errno;
-   return ((ret_errno != 0) ? ret_errno : -1);
+   return (ret_errno);
}
return (0);
 }

Modified: head/lib/libc/net/getprotoname.c
==
--- head/lib/libc/net/getprotoname.cTue Oct  5 15:31:56 2010
(r213452)
+++ head/lib/libc/net/getprotoname.cTue Oct  5 15:40:59 2010
(r213453)
@@ -131,7 +131,7 @@ getprotobyname_r(const char *name, struc
 
if (rv != NS_SUCCESS) {
errno = ret_errno;
-   return ((ret_errno != 0) ? ret_errno : -1);
+   return (ret_errno);
}
return (0);
 }
___
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-unsubscr...@freebsd.org"


Re: svn commit: r211276 - head/lib/libc/net

2010-10-05 Thread Hajimu UMEMOTO
Hi,

>>>>> On Mon, 4 Oct 2010 20:40:44 +0300
>>>>> Kostik Belousov  said:

kostikbel> Yes, I saw that commit. And there is a software in wild that does 
expect
kostikbel> return value 0 and NULL returned pointer when protocol was not found,
kostikbel> as opposed to some processing error. The interpretation of non-zero
kostikbel> error code is "We did something wrong, or system configuration is 
wrong,
kostikbel> etc". While zero error code and NULL pointer is perceived as "Wrong
kostikbel> protocol name supplied".

Okay, I found the description in Ubuntu's manpage.  So, I've committed
to return zero when no protocol entry is found.

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
u...@mahoroba.org  u...@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/
___
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-unsubscr...@freebsd.org"


svn commit: r214547 - stable/8/lib/libc/net

2010-10-30 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Oct 30 10:28:33 2010
New Revision: 214547
URL: http://svn.freebsd.org/changeset/base/214547

Log:
  MFC r213403: Clear errno for each method dispatch.

Modified:
  stable/8/lib/libc/net/nsdispatch.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/locale/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)
  stable/8/lib/libc/sys/   (props changed)

Modified: stable/8/lib/libc/net/nsdispatch.c
==
--- stable/8/lib/libc/net/nsdispatch.c  Sat Oct 30 04:53:50 2010
(r214546)
+++ stable/8/lib/libc/net/nsdispatch.c  Sat Oct 30 10:28:33 2010
(r214547)
@@ -707,11 +707,13 @@ _nsdispatch(void *retval, const ns_dtab 
va_end(ap);
} else {
cache_flag = 0;
+   errno = 0;
va_start(ap, defaults);
result = method(retval, mdata, ap);
va_end(ap);
}
 #else /* NS_CACHING */
+   errno = 0;
va_start(ap, defaults);
result = method(retval, mdata, ap);
va_end(ap);
___
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-unsubscr...@freebsd.org"


svn commit: r214548 - stable/8/lib/libc/net

2010-10-30 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Oct 30 10:30:49 2010
New Revision: 214548
URL: http://svn.freebsd.org/changeset/base/214548

Log:
  MFC r213453: When no protocol entry is found, getproto*_r(3)
  should return zero.

Modified:
  stable/8/lib/libc/net/getproto.c
  stable/8/lib/libc/net/getprotoent.c
  stable/8/lib/libc/net/getprotoname.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/locale/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)
  stable/8/lib/libc/sys/   (props changed)

Modified: stable/8/lib/libc/net/getproto.c
==
--- stable/8/lib/libc/net/getproto.cSat Oct 30 10:28:33 2010
(r214547)
+++ stable/8/lib/libc/net/getproto.cSat Oct 30 10:30:49 2010
(r214548)
@@ -123,7 +123,7 @@ getprotobynumber_r(int proto, struct pro
 
if (rv != NS_SUCCESS) {
errno = ret_errno;
-   return ((ret_errno != 0) ? ret_errno : -1);
+   return (ret_errno);
}
return (0);
 }

Modified: stable/8/lib/libc/net/getprotoent.c
==
--- stable/8/lib/libc/net/getprotoent.c Sat Oct 30 10:28:33 2010
(r214547)
+++ stable/8/lib/libc/net/getprotoent.c Sat Oct 30 10:30:49 2010
(r214548)
@@ -494,7 +494,7 @@ getprotoent_r(struct protoent *pptr, cha
 
if (rv != NS_SUCCESS) {
errno = ret_errno;
-   return ((ret_errno != 0) ? ret_errno : -1);
+   return (ret_errno);
}
return (0);
 }

Modified: stable/8/lib/libc/net/getprotoname.c
==
--- stable/8/lib/libc/net/getprotoname.cSat Oct 30 10:28:33 2010
(r214547)
+++ stable/8/lib/libc/net/getprotoname.cSat Oct 30 10:30:49 2010
(r214548)
@@ -131,7 +131,7 @@ getprotobyname_r(const char *name, struc
 
if (rv != NS_SUCCESS) {
errno = ret_errno;
-   return ((ret_errno != 0) ? ret_errno : -1);
+   return (ret_errno);
}
return (0);
 }
___
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-unsubscr...@freebsd.org"


svn commit: r214549 - stable/7/lib/libc/net

2010-10-30 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Oct 30 10:37:11 2010
New Revision: 214549
URL: http://svn.freebsd.org/changeset/base/214549

Log:
  MFC r213403: Clear errno for each method dispatch.

Modified:
  stable/7/lib/libc/net/nsdispatch.c
Directory Properties:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/stdtime/   (props changed)

Modified: stable/7/lib/libc/net/nsdispatch.c
==
--- stable/7/lib/libc/net/nsdispatch.c  Sat Oct 30 10:30:49 2010
(r214548)
+++ stable/7/lib/libc/net/nsdispatch.c  Sat Oct 30 10:37:11 2010
(r214549)
@@ -673,11 +673,13 @@ _nsdispatch(void *retval, const ns_dtab 
va_end(ap);
} else {
cache_flag = 0;
+   errno = 0;
va_start(ap, defaults);
result = method(retval, mdata, ap);
va_end(ap);
}
 #else /* NS_CACHING */
+   errno = 0;
va_start(ap, defaults);
result = method(retval, mdata, ap);
va_end(ap);
___
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-unsubscr...@freebsd.org"


svn commit: r214550 - stable/7/lib/libc/net

2010-10-30 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Oct 30 10:38:23 2010
New Revision: 214550
URL: http://svn.freebsd.org/changeset/base/214550

Log:
  MFC r213453: When no protocol entry is found, getproto*_r(3)
  should return zero.

Modified:
  stable/7/lib/libc/net/getproto.c
  stable/7/lib/libc/net/getprotoent.c
  stable/7/lib/libc/net/getprotoname.c
Directory Properties:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/stdtime/   (props changed)

Modified: stable/7/lib/libc/net/getproto.c
==
--- stable/7/lib/libc/net/getproto.cSat Oct 30 10:37:11 2010
(r214549)
+++ stable/7/lib/libc/net/getproto.cSat Oct 30 10:38:23 2010
(r214550)
@@ -123,7 +123,7 @@ getprotobynumber_r(int proto, struct pro
 
if (rv != NS_SUCCESS) {
errno = ret_errno;
-   return ((ret_errno != 0) ? ret_errno : -1);
+   return (ret_errno);
}
return (0);
 }

Modified: stable/7/lib/libc/net/getprotoent.c
==
--- stable/7/lib/libc/net/getprotoent.c Sat Oct 30 10:37:11 2010
(r214549)
+++ stable/7/lib/libc/net/getprotoent.c Sat Oct 30 10:38:23 2010
(r214550)
@@ -494,7 +494,7 @@ getprotoent_r(struct protoent *pptr, cha
 
if (rv != NS_SUCCESS) {
errno = ret_errno;
-   return ((ret_errno != 0) ? ret_errno : -1);
+   return (ret_errno);
}
return (0);
 }

Modified: stable/7/lib/libc/net/getprotoname.c
==
--- stable/7/lib/libc/net/getprotoname.cSat Oct 30 10:37:11 2010
(r214549)
+++ stable/7/lib/libc/net/getprotoname.cSat Oct 30 10:38:23 2010
(r214550)
@@ -131,7 +131,7 @@ getprotobyname_r(const char *name, struc
 
if (rv != NS_SUCCESS) {
errno = ret_errno;
-   return ((ret_errno != 0) ? ret_errno : -1);
+   return (ret_errno);
}
return (0);
 }
___
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-unsubscr...@freebsd.org"


svn commit: r228284 - in head/kerberos5: . lib/libhdb

2011-12-05 Thread Hajimu UMEMOTO
Author: ume
Date: Mon Dec  5 16:38:52 2011
New Revision: 228284
URL: http://svn.freebsd.org/changeset/base/228284

Log:
  - Make heimdal buildable with WITH_OPENLDAP defined, again.
  - Our heimdal uses the deprecated OpenLDAP functions.

Modified:
  head/kerberos5/Makefile.inc
  head/kerberos5/lib/libhdb/Makefile

Modified: head/kerberos5/Makefile.inc
==
--- head/kerberos5/Makefile.inc Mon Dec  5 16:08:18 2011(r228283)
+++ head/kerberos5/Makefile.inc Mon Dec  5 16:38:52 2011(r228284)
@@ -10,7 +10,7 @@ CFLAGS+=  -DHAVE_CONFIG_H -I${.CURDIR}/..
 OPENLDAPBASE?= /usr/local
 LDAPLDADD= -lldap -llber
 LDAPDPADD= ${LDAPLDADD:C;^-l(.*)$;${OPENLDAPBASE}/lib/lib\1.a;}
-LDAPCFLAGS=-I${OPENLDAPBASE}/include -DOPENLDAP=1
+LDAPCFLAGS=-I${OPENLDAPBASE}/include -DOPENLDAP=1 -DLDAP_DEPRECATED=1
 LDAPLDFLAGS=   -L${OPENLDAPBASE}/lib -Wl,-rpath,${OPENLDAPBASE}/lib
 .endif
 

Modified: head/kerberos5/lib/libhdb/Makefile
==
--- head/kerberos5/lib/libhdb/Makefile  Mon Dec  5 16:08:18 2011
(r228283)
+++ head/kerberos5/lib/libhdb/Makefile  Mon Dec  5 16:38:52 2011
(r228284)
@@ -1,9 +1,9 @@
 # $FreeBSD$
 
 LIB=   hdb
-LDFLAGS=   -Wl,--no-undefined
-LDADD= -lasn1 -lcom_err -lkrb5 -lroken
-DPADD= ${LIBASN1} ${LIBCOM_ERR} ${LIBKRB5} ${LIBROKEN}
+LDFLAGS=   -Wl,--no-undefined ${LDAPLDFLAGS}
+LDADD= -lasn1 -lcom_err -lkrb5 -lroken ${LDAPLDADD}
+DPADD= ${LIBASN1} ${LIBCOM_ERR} ${LIBKRB5} ${LIBROKEN} ${LDAPDPADD}
 
 INCS=  hdb-private.h \
hdb-protos.h \
___
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-unsubscr...@freebsd.org"


svn commit: r228308 - head/kerberos5

2011-12-06 Thread Hajimu UMEMOTO
Author: ume
Date: Tue Dec  6 12:03:01 2011
New Revision: 228308
URL: http://svn.freebsd.org/changeset/base/228308

Log:
  Don't support OpenLDAP during lib32 build.

Modified:
  head/kerberos5/Makefile.inc

Modified: head/kerberos5/Makefile.inc
==
--- head/kerberos5/Makefile.inc Tue Dec  6 11:28:17 2011(r228307)
+++ head/kerberos5/Makefile.inc Tue Dec  6 12:03:01 2011(r228308)
@@ -6,7 +6,7 @@ KRB5DIR=${.CURDIR}/../../../crypto/heim
 
 CFLAGS+=   -DHAVE_CONFIG_H -I${.CURDIR}/../../include
 
-.if defined(WITH_OPENLDAP)
+.if defined(WITH_OPENLDAP) && !defined(COMPAT_32BIT)
 OPENLDAPBASE?= /usr/local
 LDAPLDADD= -lldap -llber
 LDAPDPADD= ${LDAPLDADD:C;^-l(.*)$;${OPENLDAPBASE}/lib/lib\1.a;}
___
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-unsubscr...@freebsd.org"


Re: svn commit: r214984 - stable/8/lib/libproc

2010-11-08 Thread Hajimu UMEMOTO
Hi,

>>>>> On Mon, 8 Nov 2010 13:31:44 + (UTC)
>>>>> Rui Paulo  said:

rpaulo> Author: rpaulo
rpaulo> Date: Mon Nov  8 13:31:44 2010
rpaulo> New Revision: 214984
rpaulo> URL: http://svn.freebsd.org/changeset/base/214984

rpaulo> Log:
rpaulo>   Don't use basename_r().

rpaulo> Modified:
rpaulo>   stable/8/lib/libproc/proc_sym.c

Shouldn't MFCing basename_r() be better rather than stopping use of
it?

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
u...@mahoroba.org  u...@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/
___
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-unsubscr...@freebsd.org"


Re: svn commit: r214984 - stable/8/lib/libproc

2010-11-08 Thread Hajimu UMEMOTO
Hi,

>>>>> On Mon, 8 Nov 2010 15:06:12 +
>>>>> Rui Paulo  said:

rpaulo> It's on my plans, but basename_r is not POSIX and there was a private 
discussion about it a couple of weeks ago. The conclusion is that we should 
adopt the Android semantics of basename_r().

I found the thread, and understood it.  However, I still wonderling if
breaking thread-safeness in proc_sym.c is okay, though it may not be
necessary.

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
u...@mahoroba.org  u...@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/
___
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-unsubscr...@freebsd.org"


Re: svn commit: r214984 - stable/8/lib/libproc

2010-11-08 Thread Hajimu UMEMOTO
Hi,

>>>>> On Mon, 8 Nov 2010 15:37:10 +
>>>>> Rui Paulo  said:

rpaulo> We can live with it for now while I work on a new basename_r().

Okay, thanks.

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
u...@mahoroba.org  u...@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/
___
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-unsubscr...@freebsd.org"


svn commit: r196475 - in head: contrib/traceroute usr.sbin/traceroute6

2009-08-23 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Aug 23 17:00:16 2009
New Revision: 196475
URL: http://svn.freebsd.org/changeset/base/196475

Log:
  - Add AS lookup functionality to traceroute6(8) as well.
  - Support for IPv6 transport for AS lookup.
  - Introduce $RA_SERVER to set whois server.
  - Support for 4 byte ASN.
  - ANSIfy function declaration in as.c.
  
  Tested by:IHANet folks.

Modified:
  head/contrib/traceroute/as.c
  head/contrib/traceroute/as.h
  head/contrib/traceroute/traceroute.c
  head/usr.sbin/traceroute6/Makefile
  head/usr.sbin/traceroute6/traceroute6.8
  head/usr.sbin/traceroute6/traceroute6.c

Modified: head/contrib/traceroute/as.c
==
--- head/contrib/traceroute/as.cSun Aug 23 16:29:47 2009
(r196474)
+++ head/contrib/traceroute/as.cSun Aug 23 17:00:16 2009
(r196475)
@@ -63,55 +63,42 @@ struct aslookup {
 };
 
 void *
-as_setup(server)
-   char *server;
+as_setup(char *server)
 {
struct aslookup *asn;
-   struct hostent *he = NULL;
-   struct servent *se;
-   struct sockaddr_in in;
+   struct addrinfo hints, *res0, *res;
FILE *f;
-   int s;
+   int s, error;
 
if (server == NULL)
+   server = getenv("RA_SERVER");
+   if (server == NULL)
server = DEFAULT_AS_SERVER;
 
-   (void)memset(&in, 0, sizeof(in));
-   in.sin_family = AF_INET;
-   in.sin_len = sizeof(in);
-   if ((se = getservbyname("whois", "tcp")) == NULL) {
+   memset(&hints, 0, sizeof(hints));
+   hints.ai_family = PF_UNSPEC;
+   hints.ai_socktype = SOCK_STREAM;
+   error = getaddrinfo(server, "whois", &hints, &res0);
+   if (error == EAI_SERVICE) {
warnx("warning: whois/tcp service not found");
-   in.sin_port = ntohs(43);
-   } else
-   in.sin_port = se->s_port;
-
-   if (inet_aton(server, &in.sin_addr) == 0 && 
-   ((he = gethostbyname(server)) == NULL ||
-   he->h_addr == NULL)) {
-   warnx("%s: %s", server, hstrerror(h_errno));
-   return (NULL);
+   error = getaddrinfo(server, "43", &hints, &res0);
}
-
-   if ((s = socket(PF_INET, SOCK_STREAM, 0)) == -1) {
-   warn("socket");
+   if (error != 0) {
+   warnx("%s: %s", server, gai_strerror(error));
return (NULL);
}
 
-   do {
-   if (he != NULL) {
-   memcpy(&in.sin_addr, he->h_addr, he->h_length);
-   he->h_addr_list++;
-   }
-   if (connect(s, (struct sockaddr *)&in, sizeof(in)) == 0)
+   for (res = res0; res; res = res->ai_next) {
+   s = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
+   if (s < 0)
+   continue;
+   if (connect(s, res->ai_addr, res->ai_addrlen) >= 0)
break;
-   if (he == NULL || he->h_addr == NULL) {
-   close(s);
-   s = -1;
-   break;
-   }
-   } while (1);
-
-   if (s == -1) {
+   close(s);
+   s = -1;
+   }
+   freeaddrinfo(res0);
+   if (s < 0) {
warn("connect");
return (NULL);
}
@@ -137,23 +124,23 @@ as_setup(server)
return (asn);
 }
 
-int
-as_lookup(_asn, addr)
-   void *_asn;
-   struct in_addr *addr;
+unsigned int
+as_lookup(void *_asn, char *addr, sa_family_t family)
 {
struct aslookup *asn = _asn;
char buf[1024];
-   int as, rc, dlen;
+   unsigned int as;
+   int rc, dlen, plen;
 
-   as = rc = dlen = 0;
-   (void)fprintf(asn->as_f, "!r%s/32,l\n", inet_ntoa(*addr));
+   as = 0;
+   rc = dlen = 0;
+   plen = (family == AF_INET6) ? 128 : 32;
+   (void)fprintf(asn->as_f, "!r%s/%d,l\n", addr, plen);
(void)fflush(asn->as_f);
 
 #ifdef AS_DEBUG_FILE
if (asn->as_debug) {
-   (void)fprintf(asn->as_debug, ">> !r%s/32,l\n",
-inet_ntoa(*addr));
+   (void)fprintf(asn->as_debug, ">> !r%s/%d,l\n", addr, plen);
(void)fflush(asn->as_debug);
}
 #endif /* AS_DEBUG_FILE */
@@ -182,7 +169,7 @@ as_lookup(_asn, addr)
}
 #endif /* AS_DEBUG_FILE */
break;
-   case 'C':   
+   case 'C':
case 'D':
case 'E':
case 'F':
@@ -209,7 +196,7 @@ as_lookup(_asn, addr)
 
/* origin line is the interesting bit */
if (as == 0 && strncasecmp(buf, "origin:", 7) == 0) {
-   sscanf(buf + 7, " AS%d", &as);
+   sscanf(buf + 7, " AS%u", &as);
 #ifdef AS_DEBUG_FILE
   

svn commit: r196651 - head/share/timedef

2009-08-30 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Aug 30 10:47:00 2009
New Revision: 196651
URL: http://svn.freebsd.org/changeset/base/196651

Log:
  AM/PM date format for ja_JP.eucJP and ja_JP.SJIS were
  localized by r193869.  However, ja_JP.UTF-8 wasn't.
  So, reflect it to ja_JP.UTF-8 as well.

Modified:
  head/share/timedef/ja_JP.UTF-8.src

Modified: head/share/timedef/ja_JP.UTF-8.src
==
--- head/share/timedef/ja_JP.UTF-8.src  Sun Aug 30 05:12:37 2009
(r196650)
+++ head/share/timedef/ja_JP.UTF-8.src  Sun Aug 30 10:47:00 2009
(r196651)
@@ -68,13 +68,11 @@
 #
 # am
 #
-#午前
-AM
+午前
 #
 # pm
 #
-#午後
-PM
+午後
 #
 # date_fmt
 #
___
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-unsubscr...@freebsd.org"


svn commit: r196652 - head/usr.bin/w

2009-08-30 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Aug 30 11:17:42 2009
New Revision: 196652
URL: http://svn.freebsd.org/changeset/base/196652

Log:
  Fix the problem that the entry broke into two lines with multi-byte
  AM/PM format.
  
  Reported by:  takawata

Modified:
  head/usr.bin/w/extern.h
  head/usr.bin/w/pr_time.c
  head/usr.bin/w/w.c

Modified: head/usr.bin/w/extern.h
==
--- head/usr.bin/w/extern.h Sun Aug 30 10:47:00 2009(r196651)
+++ head/usr.bin/w/extern.h Sun Aug 30 11:17:42 2009(r196652)
@@ -38,6 +38,6 @@
 extern int use_ampm;
 
 struct kinfo_proc;
-void   pr_attime(time_t *, time_t *);
+intpr_attime(time_t *, time_t *);
 intpr_idle(time_t);
 intproc_compare(struct kinfo_proc *, struct kinfo_proc *);

Modified: head/usr.bin/w/pr_time.c
==
--- head/usr.bin/w/pr_time.cSun Aug 30 10:47:00 2009(r196651)
+++ head/usr.bin/w/pr_time.cSun Aug 30 11:17:42 2009(r196652)
@@ -52,13 +52,14 @@ static const char sccsid[] = "@(#)pr_tim
  * pr_attime --
  * Print the time since the user logged in.
  */
-void
+int
 pr_attime(time_t *started, time_t *now)
 {
-   static char buf[256];
+   static wchar_t buf[256];
struct tm tp, tm;
time_t diff;
-   char fmt[20];
+   wchar_t *fmt;
+   int len, width, offset = 0;
 
tp = *localtime(started);
tm = *localtime(now);
@@ -66,7 +67,7 @@ pr_attime(time_t *started, time_t *now)
 
/* If more than a week, use day-month-year. */
if (diff > 86400 * 7)
-   (void)strcpy(fmt, "%d%b%y");
+   fmt = L"%d%b%y";
 
/* If not today, use day-hour-am/pm. */
else if (tm.tm_mday != tp.tm_mday ||
@@ -74,16 +75,26 @@ pr_attime(time_t *started, time_t *now)
 tm.tm_year != tp.tm_year) {
/* The line below does not take DST into consideration */
/* else if (*now / 86400 != *started / 86400) { */
-   (void)strcpy(fmt, use_ampm ? "%a%I%p" : "%a%H");
+   fmt = use_ampm ? L"%a%I%p" : L"%a%H";
}
 
/* Default is hh:mm{am,pm}. */
else {
-   (void)strcpy(fmt, use_ampm ? "%l:%M%p" : "%k:%M");
+   fmt = use_ampm ? L"%l:%M%p" : L"%k:%M";
}
 
-   (void)strftime(buf, sizeof(buf), fmt, &tp);
-   (void)wprintf(L"%-7.7s", buf);
+   (void)wcsftime(buf, sizeof(buf), fmt, &tp);
+   len = wcslen(buf);
+   width = wcswidth(buf, len);
+   if (len == width)
+   (void)wprintf(L"%-7.7ls", buf);
+   else if (width < 7)
+   (void)wprintf(L"%ls%.*s", buf, 7 - width, "  ");
+   else {
+   (void)wprintf(L"%ls", buf);
+   offset = width - 7;
+   }
+   return (offset);
 }
 
 /*

Modified: head/usr.bin/w/w.c
==
--- head/usr.bin/w/w.c  Sun Aug 30 10:47:00 2009(r196651)
+++ head/usr.bin/w/w.c  Sun Aug 30 11:17:42 2009(r196652)
@@ -137,7 +137,7 @@ main(int argc, char *argv[])
struct stat *stp;
FILE *ut;
time_t touched;
-   int ch, i, nentries, nusers, wcmd, longidle, dropgid;
+   int ch, i, nentries, nusers, wcmd, longidle, longattime, dropgid;
const char *memf, *nlistf, *p;
char *x_suffix;
char buf[MAXHOSTNAMELEN], errbuf[_POSIX2_LINE_MAX];
@@ -406,9 +406,10 @@ main(int argc, char *argv[])
ep->utmp.ut_line : ep->utmp.ut_line + 3,
W_DISPHOSTSIZE, W_DISPHOSTSIZE, *p ? p : "-");
t = _time_to_time32(ep->utmp.ut_time);
-   pr_attime(&t, &now);
+   longattime = pr_attime(&t, &now);
longidle = pr_idle(ep->idle);
-   (void)printf("%.*s\n", argwidth - longidle, ep->args);
+   (void)printf("%.*s\n", argwidth - longidle - longattime,
+   ep->args);
}
(void)kvm_close(kd);
exit(0);
___
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-unsubscr...@freebsd.org"


svn commit: r196918 - in stable/7: sbin/ifconfig share/man/man4 sys/net sys/netinet sys/netinet6 sys/sys

2009-09-07 Thread Hajimu UMEMOTO
Author: ume
Date: Mon Sep  7 10:15:50 2009
New Revision: 196918
URL: http://svn.freebsd.org/changeset/base/196918

Log:
  MFC r193664, r193796, r193815:
  Fix and add a workaround on an issue of EtherIP packet with reversed
  version field sent via gif(4)+if_bridge(4).  The EtherIP
  implementation found on FreeBSD 6.1, 6.2, 6.3, 7.0, 7.1, and 7.2 had
  an interoperability issue because it sent the incorrect EtherIP
  packets and discarded the correct ones.
  
  Approved by:  hrs

Added:
  stable/7/sbin/ifconfig/ifgif.c
 - copied unchanged from r193664, head/sbin/ifconfig/ifgif.c
Modified:
  stable/7/sbin/ifconfig/   (props changed)
  stable/7/sbin/ifconfig/Makefile
  stable/7/share/man/man4/   (props changed)
  stable/7/share/man/man4/gif.4
  stable/7/share/man/man4/if_bridge.4
  stable/7/sys/net/   (props changed)
  stable/7/sys/net/if_gif.c
  stable/7/sys/net/if_gif.h
  stable/7/sys/netinet/in_gif.c
  stable/7/sys/netinet6/in6_gif.c
  stable/7/sys/sys/priv.h

Modified: stable/7/sbin/ifconfig/Makefile
==
--- stable/7/sbin/ifconfig/Makefile Mon Sep  7 09:51:23 2009
(r196917)
+++ stable/7/sbin/ifconfig/Makefile Mon Sep  7 10:15:50 2009
(r196918)
@@ -25,6 +25,7 @@ SRCS+=ifmedia.c   # SIOC[GS]IFMEDIA supp
 SRCS+= ifvlan.c# SIOC[GS]ETVLAN support
 SRCS+= ifieee80211.c   # SIOC[GS]IEEE80211 support
 SRCS+= ifgre.c # GRE keys etc
+SRCS+= ifgif.c # GIF reversed header workaround
 
 SRCS+= ifcarp.c# SIOC[GS]VH support
 SRCS+= ifgroup.c   # ...

Copied: stable/7/sbin/ifconfig/ifgif.c (from r193664, 
head/sbin/ifconfig/ifgif.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/7/sbin/ifconfig/ifgif.c  Mon Sep  7 10:15:50 2009
(r196918, copy of r193664, head/sbin/ifconfig/ifgif.c)
@@ -0,0 +1,132 @@
+/*-
+ * Copyright (c) 2009 Hiroki Sato.  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
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef lint
+static const char rcsid[] =
+  "$FreeBSD$";
+#endif
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "ifconfig.h"
+
+static voidgif_status(int);
+
+static struct {
+   const char  *label;
+   u_int   mask;
+} gif_opts[] = {
+   { "ACCEPT_REV_ETHIP_VER",   GIF_ACCEPT_REVETHIP },
+   { "SEND_REV_ETHIP_VER", GIF_SEND_REVETHIP   },
+};
+
+static void
+gif_status(int s)
+{
+   int opts;
+   int nopts = 0;
+   int i;
+
+   ifr.ifr_data = (caddr_t)&opts;
+   if (ioctl(s, GIFGOPTS, &ifr) == -1)
+   return;
+
+   printf("\toptions=%d<", opts);
+   for (i=0; i < sizeof(gif_opts)/sizeof(gif_opts[0]); i++) {
+   if (opts & gif_opts[i].mask) {
+   if (nopts++)
+   printf(",");
+   printf("%s", gif_opts[i].label);
+   }
+   }
+   printf(">\n");
+}
+
+static void
+setgifopts(const char *val,
+   int d, int s, const struct afswtch *afp)
+{
+   int opts;
+
+   ifr.ifr_data = (caddr_t)&opts;
+   if (ioctl(s, GIFGOPTS, &ifr) == -1) {
+   warn("ioctl(GIFGOPTS)");
+   return;
+   }
+
+   if (d < 0)
+   opts &= ~(-d);
+   else
+   opts |= d;
+
+   if (ioctl(s, GIFSOPTS, &ifr) == -1) {
+   warn("ioctl(GIFSOPTS)");
+   ret

svn commit: r196929 - head/sbin/ifconfig

2009-09-07 Thread Hajimu UMEMOTO
Author: ume
Date: Mon Sep  7 15:22:54 2009
New Revision: 196929
URL: http://svn.freebsd.org/changeset/base/196929

Log:
  Suppress an options line when no bit is on.
  
  Reviewed by:  hrs
  MFC after:3 days

Modified:
  head/sbin/ifconfig/ifgif.c

Modified: head/sbin/ifconfig/ifgif.c
==
--- head/sbin/ifconfig/ifgif.c  Mon Sep  7 14:44:04 2009(r196928)
+++ head/sbin/ifconfig/ifgif.c  Mon Sep  7 15:22:54 2009(r196929)
@@ -71,6 +71,8 @@ gif_status(int s)
ifr.ifr_data = (caddr_t)&opts;
if (ioctl(s, GIFGOPTS, &ifr) == -1)
return;
+   if (opts == 0)
+   return;
 
printf("\toptions=%d<", opts);
for (i=0; i < sizeof(gif_opts)/sizeof(gif_opts[0]); i++) {
___
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-unsubscr...@freebsd.org"


svn commit: r197157 - stable/8/sbin/ifconfig

2009-09-13 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Sep 13 11:31:25 2009
New Revision: 197157
URL: http://svn.freebsd.org/changeset/base/197157

Log:
  MFC r196929: Suppress an options line when no bit is on.
  
  Approved by:  re (kib)

Modified:
  stable/8/sbin/ifconfig/   (props changed)
  stable/8/sbin/ifconfig/ifgif.c

Modified: stable/8/sbin/ifconfig/ifgif.c
==
--- stable/8/sbin/ifconfig/ifgif.c  Sun Sep 13 11:20:17 2009
(r197156)
+++ stable/8/sbin/ifconfig/ifgif.c  Sun Sep 13 11:31:25 2009
(r197157)
@@ -71,6 +71,8 @@ gif_status(int s)
ifr.ifr_data = (caddr_t)&opts;
if (ioctl(s, GIFGOPTS, &ifr) == -1)
return;
+   if (opts == 0)
+   return;
 
printf("\toptions=%d<", opts);
for (i=0; i < sizeof(gif_opts)/sizeof(gif_opts[0]); i++) {
___
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-unsubscr...@freebsd.org"


svn commit: r197158 - in stable/8: contrib/traceroute usr.sbin/traceroute6

2009-09-13 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Sep 13 11:34:33 2009
New Revision: 197158
URL: http://svn.freebsd.org/changeset/base/197158

Log:
  MFC r196475:
   - Add AS lookup functionality to traceroute6(8) as well.
   - Support for IPv6 transport for AS lookup.
   - Introduce $RA_SERVER to set whois server.
   - Support for 4 byte ASN.
   - ANSIfy function declaration in as.c.
  
  Approved by:  re (kib)

Modified:
  stable/8/contrib/traceroute/   (props changed)
  stable/8/contrib/traceroute/as.c
  stable/8/contrib/traceroute/as.h
  stable/8/contrib/traceroute/traceroute.c
  stable/8/usr.sbin/traceroute6/   (props changed)
  stable/8/usr.sbin/traceroute6/Makefile
  stable/8/usr.sbin/traceroute6/traceroute6.8
  stable/8/usr.sbin/traceroute6/traceroute6.c

Modified: stable/8/contrib/traceroute/as.c
==
--- stable/8/contrib/traceroute/as.cSun Sep 13 11:31:25 2009
(r197157)
+++ stable/8/contrib/traceroute/as.cSun Sep 13 11:34:33 2009
(r197158)
@@ -63,55 +63,42 @@ struct aslookup {
 };
 
 void *
-as_setup(server)
-   char *server;
+as_setup(char *server)
 {
struct aslookup *asn;
-   struct hostent *he = NULL;
-   struct servent *se;
-   struct sockaddr_in in;
+   struct addrinfo hints, *res0, *res;
FILE *f;
-   int s;
+   int s, error;
 
if (server == NULL)
+   server = getenv("RA_SERVER");
+   if (server == NULL)
server = DEFAULT_AS_SERVER;
 
-   (void)memset(&in, 0, sizeof(in));
-   in.sin_family = AF_INET;
-   in.sin_len = sizeof(in);
-   if ((se = getservbyname("whois", "tcp")) == NULL) {
+   memset(&hints, 0, sizeof(hints));
+   hints.ai_family = PF_UNSPEC;
+   hints.ai_socktype = SOCK_STREAM;
+   error = getaddrinfo(server, "whois", &hints, &res0);
+   if (error == EAI_SERVICE) {
warnx("warning: whois/tcp service not found");
-   in.sin_port = ntohs(43);
-   } else
-   in.sin_port = se->s_port;
-
-   if (inet_aton(server, &in.sin_addr) == 0 && 
-   ((he = gethostbyname(server)) == NULL ||
-   he->h_addr == NULL)) {
-   warnx("%s: %s", server, hstrerror(h_errno));
-   return (NULL);
+   error = getaddrinfo(server, "43", &hints, &res0);
}
-
-   if ((s = socket(PF_INET, SOCK_STREAM, 0)) == -1) {
-   warn("socket");
+   if (error != 0) {
+   warnx("%s: %s", server, gai_strerror(error));
return (NULL);
}
 
-   do {
-   if (he != NULL) {
-   memcpy(&in.sin_addr, he->h_addr, he->h_length);
-   he->h_addr_list++;
-   }
-   if (connect(s, (struct sockaddr *)&in, sizeof(in)) == 0)
+   for (res = res0; res; res = res->ai_next) {
+   s = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
+   if (s < 0)
+   continue;
+   if (connect(s, res->ai_addr, res->ai_addrlen) >= 0)
break;
-   if (he == NULL || he->h_addr == NULL) {
-   close(s);
-   s = -1;
-   break;
-   }
-   } while (1);
-
-   if (s == -1) {
+   close(s);
+   s = -1;
+   }
+   freeaddrinfo(res0);
+   if (s < 0) {
warn("connect");
return (NULL);
}
@@ -137,23 +124,23 @@ as_setup(server)
return (asn);
 }
 
-int
-as_lookup(_asn, addr)
-   void *_asn;
-   struct in_addr *addr;
+unsigned int
+as_lookup(void *_asn, char *addr, sa_family_t family)
 {
struct aslookup *asn = _asn;
char buf[1024];
-   int as, rc, dlen;
+   unsigned int as;
+   int rc, dlen, plen;
 
-   as = rc = dlen = 0;
-   (void)fprintf(asn->as_f, "!r%s/32,l\n", inet_ntoa(*addr));
+   as = 0;
+   rc = dlen = 0;
+   plen = (family == AF_INET6) ? 128 : 32;
+   (void)fprintf(asn->as_f, "!r%s/%d,l\n", addr, plen);
(void)fflush(asn->as_f);
 
 #ifdef AS_DEBUG_FILE
if (asn->as_debug) {
-   (void)fprintf(asn->as_debug, ">> !r%s/32,l\n",
-inet_ntoa(*addr));
+   (void)fprintf(asn->as_debug, ">> !r%s/%d,l\n", addr, plen);
(void)fflush(asn->as_debug);
}
 #endif /* AS_DEBUG_FILE */
@@ -182,7 +169,7 @@ as_lookup(_asn, addr)
}
 #endif /* AS_DEBUG_FILE */
break;
-   case 'C':   
+   case 'C':
case 'D':
case 'E':
case 'F':
@@ -209,7 +196,7 @@ as_lookup(_asn, addr)
 
/* origin line is the interesting bit */
if (as == 0 && strncasecmp(buf, "origin:", 7) 

svn commit: r197159 - stable/7/sbin/ifconfig

2009-09-13 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Sep 13 11:45:31 2009
New Revision: 197159
URL: http://svn.freebsd.org/changeset/base/197159

Log:
  MFC r196929: Suppress an options line when no bit is on.

Modified:
  stable/7/sbin/ifconfig/   (props changed)
  stable/7/sbin/ifconfig/ifgif.c

Modified: stable/7/sbin/ifconfig/ifgif.c
==
--- stable/7/sbin/ifconfig/ifgif.c  Sun Sep 13 11:34:33 2009
(r197158)
+++ stable/7/sbin/ifconfig/ifgif.c  Sun Sep 13 11:45:31 2009
(r197159)
@@ -71,6 +71,8 @@ gif_status(int s)
ifr.ifr_data = (caddr_t)&opts;
if (ioctl(s, GIFGOPTS, &ifr) == -1)
return;
+   if (opts == 0)
+   return;
 
printf("\toptions=%d<", opts);
for (i=0; i < sizeof(gif_opts)/sizeof(gif_opts[0]); i++) {
___
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-unsubscr...@freebsd.org"


svn commit: r197162 - in stable/7: contrib/traceroute usr.sbin/traceroute6

2009-09-13 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Sep 13 11:52:17 2009
New Revision: 197162
URL: http://svn.freebsd.org/changeset/base/197162

Log:
  MFC r196475:
   - Add AS lookup functionality to traceroute6(8) as well.
   - Support for IPv6 transport for AS lookup.
   - Introduce $RA_SERVER to set whois server.
   - Support for 4 byte ASN.
   - ANSIfy function declaration in as.c.

Modified:
  stable/7/contrib/traceroute/   (props changed)
  stable/7/contrib/traceroute/as.c
  stable/7/contrib/traceroute/as.h
  stable/7/contrib/traceroute/traceroute.c
  stable/7/usr.sbin/traceroute6/   (props changed)
  stable/7/usr.sbin/traceroute6/Makefile
  stable/7/usr.sbin/traceroute6/traceroute6.8
  stable/7/usr.sbin/traceroute6/traceroute6.c

Modified: stable/7/contrib/traceroute/as.c
==
--- stable/7/contrib/traceroute/as.cSun Sep 13 11:52:15 2009
(r197161)
+++ stable/7/contrib/traceroute/as.cSun Sep 13 11:52:17 2009
(r197162)
@@ -63,55 +63,42 @@ struct aslookup {
 };
 
 void *
-as_setup(server)
-   char *server;
+as_setup(char *server)
 {
struct aslookup *asn;
-   struct hostent *he = NULL;
-   struct servent *se;
-   struct sockaddr_in in;
+   struct addrinfo hints, *res0, *res;
FILE *f;
-   int s;
+   int s, error;
 
if (server == NULL)
+   server = getenv("RA_SERVER");
+   if (server == NULL)
server = DEFAULT_AS_SERVER;
 
-   (void)memset(&in, 0, sizeof(in));
-   in.sin_family = AF_INET;
-   in.sin_len = sizeof(in);
-   if ((se = getservbyname("whois", "tcp")) == NULL) {
+   memset(&hints, 0, sizeof(hints));
+   hints.ai_family = PF_UNSPEC;
+   hints.ai_socktype = SOCK_STREAM;
+   error = getaddrinfo(server, "whois", &hints, &res0);
+   if (error == EAI_SERVICE) {
warnx("warning: whois/tcp service not found");
-   in.sin_port = ntohs(43);
-   } else
-   in.sin_port = se->s_port;
-
-   if (inet_aton(server, &in.sin_addr) == 0 && 
-   ((he = gethostbyname(server)) == NULL ||
-   he->h_addr == NULL)) {
-   warnx("%s: %s", server, hstrerror(h_errno));
-   return (NULL);
+   error = getaddrinfo(server, "43", &hints, &res0);
}
-
-   if ((s = socket(PF_INET, SOCK_STREAM, 0)) == -1) {
-   warn("socket");
+   if (error != 0) {
+   warnx("%s: %s", server, gai_strerror(error));
return (NULL);
}
 
-   do {
-   if (he != NULL) {
-   memcpy(&in.sin_addr, he->h_addr, he->h_length);
-   he->h_addr_list++;
-   }
-   if (connect(s, (struct sockaddr *)&in, sizeof(in)) == 0)
+   for (res = res0; res; res = res->ai_next) {
+   s = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
+   if (s < 0)
+   continue;
+   if (connect(s, res->ai_addr, res->ai_addrlen) >= 0)
break;
-   if (he == NULL || he->h_addr == NULL) {
-   close(s);
-   s = -1;
-   break;
-   }
-   } while (1);
-
-   if (s == -1) {
+   close(s);
+   s = -1;
+   }
+   freeaddrinfo(res0);
+   if (s < 0) {
warn("connect");
return (NULL);
}
@@ -137,23 +124,23 @@ as_setup(server)
return (asn);
 }
 
-int
-as_lookup(_asn, addr)
-   void *_asn;
-   struct in_addr *addr;
+unsigned int
+as_lookup(void *_asn, char *addr, sa_family_t family)
 {
struct aslookup *asn = _asn;
char buf[1024];
-   int as, rc, dlen;
+   unsigned int as;
+   int rc, dlen, plen;
 
-   as = rc = dlen = 0;
-   (void)fprintf(asn->as_f, "!r%s/32,l\n", inet_ntoa(*addr));
+   as = 0;
+   rc = dlen = 0;
+   plen = (family == AF_INET6) ? 128 : 32;
+   (void)fprintf(asn->as_f, "!r%s/%d,l\n", addr, plen);
(void)fflush(asn->as_f);
 
 #ifdef AS_DEBUG_FILE
if (asn->as_debug) {
-   (void)fprintf(asn->as_debug, ">> !r%s/32,l\n",
-inet_ntoa(*addr));
+   (void)fprintf(asn->as_debug, ">> !r%s/%d,l\n", addr, plen);
(void)fflush(asn->as_debug);
}
 #endif /* AS_DEBUG_FILE */
@@ -182,7 +169,7 @@ as_lookup(_asn, addr)
}
 #endif /* AS_DEBUG_FILE */
break;
-   case 'C':   
+   case 'C':
case 'D':
case 'E':
case 'F':
@@ -209,7 +196,7 @@ as_lookup(_asn, addr)
 
/* origin line is the interesting bit */
if (as == 0 && strncasecmp(buf, "origin:", 7) == 0) {
-   

svn commit: r197168 - stable/8/share/timedef

2009-09-13 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Sep 13 17:00:21 2009
New Revision: 197168
URL: http://svn.freebsd.org/changeset/base/197168

Log:
  MFC r196651: AM/PM date format for ja_JP.eucJP and ja_JP.SJIS were
  localized by r193869.  However, ja_JP.UTF-8 wasn't.  So, reflect it
  to ja_JP.UTF-8 as well.
  
  Approved by:  re (kib)

Modified:
  stable/8/share/timedef/   (props changed)
  stable/8/share/timedef/ja_JP.UTF-8.src

Modified: stable/8/share/timedef/ja_JP.UTF-8.src
==
--- stable/8/share/timedef/ja_JP.UTF-8.src  Sun Sep 13 16:05:20 2009
(r197167)
+++ stable/8/share/timedef/ja_JP.UTF-8.src  Sun Sep 13 17:00:21 2009
(r197168)
@@ -68,13 +68,11 @@
 #
 # am
 #
-#午前
-AM
+午前
 #
 # pm
 #
-#午後
-PM
+午後
 #
 # date_fmt
 #
___
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-unsubscr...@freebsd.org"


svn commit: r197169 - stable/8/usr.bin/w

2009-09-13 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Sep 13 17:01:34 2009
New Revision: 197169
URL: http://svn.freebsd.org/changeset/base/197169

Log:
  MFC r196652: Fix the problem that the entry broke into two lines
  with multi-byte AM/PM date format.
  
  Approved by:  re (kib)

Modified:
  stable/8/usr.bin/w/   (props changed)
  stable/8/usr.bin/w/extern.h
  stable/8/usr.bin/w/pr_time.c
  stable/8/usr.bin/w/w.c

Modified: stable/8/usr.bin/w/extern.h
==
--- stable/8/usr.bin/w/extern.h Sun Sep 13 17:00:21 2009(r197168)
+++ stable/8/usr.bin/w/extern.h Sun Sep 13 17:01:34 2009(r197169)
@@ -38,6 +38,6 @@
 extern int use_ampm;
 
 struct kinfo_proc;
-void   pr_attime(time_t *, time_t *);
+intpr_attime(time_t *, time_t *);
 intpr_idle(time_t);
 intproc_compare(struct kinfo_proc *, struct kinfo_proc *);

Modified: stable/8/usr.bin/w/pr_time.c
==
--- stable/8/usr.bin/w/pr_time.cSun Sep 13 17:00:21 2009
(r197168)
+++ stable/8/usr.bin/w/pr_time.cSun Sep 13 17:01:34 2009
(r197169)
@@ -52,13 +52,14 @@ static const char sccsid[] = "@(#)pr_tim
  * pr_attime --
  * Print the time since the user logged in.
  */
-void
+int
 pr_attime(time_t *started, time_t *now)
 {
-   static char buf[256];
+   static wchar_t buf[256];
struct tm tp, tm;
time_t diff;
-   char fmt[20];
+   wchar_t *fmt;
+   int len, width, offset = 0;
 
tp = *localtime(started);
tm = *localtime(now);
@@ -66,7 +67,7 @@ pr_attime(time_t *started, time_t *now)
 
/* If more than a week, use day-month-year. */
if (diff > 86400 * 7)
-   (void)strcpy(fmt, "%d%b%y");
+   fmt = L"%d%b%y";
 
/* If not today, use day-hour-am/pm. */
else if (tm.tm_mday != tp.tm_mday ||
@@ -74,16 +75,26 @@ pr_attime(time_t *started, time_t *now)
 tm.tm_year != tp.tm_year) {
/* The line below does not take DST into consideration */
/* else if (*now / 86400 != *started / 86400) { */
-   (void)strcpy(fmt, use_ampm ? "%a%I%p" : "%a%H");
+   fmt = use_ampm ? L"%a%I%p" : L"%a%H";
}
 
/* Default is hh:mm{am,pm}. */
else {
-   (void)strcpy(fmt, use_ampm ? "%l:%M%p" : "%k:%M");
+   fmt = use_ampm ? L"%l:%M%p" : L"%k:%M";
}
 
-   (void)strftime(buf, sizeof(buf), fmt, &tp);
-   (void)wprintf(L"%-7.7s", buf);
+   (void)wcsftime(buf, sizeof(buf), fmt, &tp);
+   len = wcslen(buf);
+   width = wcswidth(buf, len);
+   if (len == width)
+   (void)wprintf(L"%-7.7ls", buf);
+   else if (width < 7)
+   (void)wprintf(L"%ls%.*s", buf, 7 - width, "  ");
+   else {
+   (void)wprintf(L"%ls", buf);
+   offset = width - 7;
+   }
+   return (offset);
 }
 
 /*

Modified: stable/8/usr.bin/w/w.c
==
--- stable/8/usr.bin/w/w.c  Sun Sep 13 17:00:21 2009(r197168)
+++ stable/8/usr.bin/w/w.c  Sun Sep 13 17:01:34 2009(r197169)
@@ -137,7 +137,7 @@ main(int argc, char *argv[])
struct stat *stp;
FILE *ut;
time_t touched;
-   int ch, i, nentries, nusers, wcmd, longidle, dropgid;
+   int ch, i, nentries, nusers, wcmd, longidle, longattime, dropgid;
const char *memf, *nlistf, *p;
char *x_suffix;
char buf[MAXHOSTNAMELEN], errbuf[_POSIX2_LINE_MAX];
@@ -406,9 +406,10 @@ main(int argc, char *argv[])
ep->utmp.ut_line : ep->utmp.ut_line + 3,
W_DISPHOSTSIZE, W_DISPHOSTSIZE, *p ? p : "-");
t = _time_to_time32(ep->utmp.ut_time);
-   pr_attime(&t, &now);
+   longattime = pr_attime(&t, &now);
longidle = pr_idle(ep->idle);
-   (void)printf("%.*s\n", argwidth - longidle, ep->args);
+   (void)printf("%.*s\n", argwidth - longidle - longattime,
+   ep->args);
}
(void)kvm_close(kd);
exit(0);
___
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-unsubscr...@freebsd.org"


svn commit: r197170 - stable/7/share/timedef

2009-09-13 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Sep 13 17:05:56 2009
New Revision: 197170
URL: http://svn.freebsd.org/changeset/base/197170

Log:
  MFC r196651: AM/PM date format for ja_JP.eucJP and ja_JP.SJIS were
  localized by r193869.  However, ja_JP.UTF-8 wasn't.  So, reflect it
  to ja_JP.UTF-8 as well.

Modified:
  stable/7/share/timedef/   (props changed)
  stable/7/share/timedef/ja_JP.UTF-8.src

Modified: stable/7/share/timedef/ja_JP.UTF-8.src
==
--- stable/7/share/timedef/ja_JP.UTF-8.src  Sun Sep 13 17:01:34 2009
(r197169)
+++ stable/7/share/timedef/ja_JP.UTF-8.src  Sun Sep 13 17:05:56 2009
(r197170)
@@ -68,13 +68,11 @@
 #
 # am
 #
-#午前
-AM
+午前
 #
 # pm
 #
-#午後
-PM
+午後
 #
 # date_fmt
 #
___
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-unsubscr...@freebsd.org"


svn commit: r197171 - stable/7/usr.bin/w

2009-09-13 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Sep 13 17:08:58 2009
New Revision: 197171
URL: http://svn.freebsd.org/changeset/base/197171

Log:
  MFC r196652: Fix the problem that the entry broke into two lines
  with multi-byte AM/PM date format.

Modified:
  stable/7/usr.bin/w/   (props changed)
  stable/7/usr.bin/w/extern.h
  stable/7/usr.bin/w/pr_time.c
  stable/7/usr.bin/w/w.c

Modified: stable/7/usr.bin/w/extern.h
==
--- stable/7/usr.bin/w/extern.h Sun Sep 13 17:05:56 2009(r197170)
+++ stable/7/usr.bin/w/extern.h Sun Sep 13 17:08:58 2009(r197171)
@@ -38,6 +38,6 @@
 extern int use_ampm;
 
 struct kinfo_proc;
-void   pr_attime(time_t *, time_t *);
+intpr_attime(time_t *, time_t *);
 intpr_idle(time_t);
 intproc_compare(struct kinfo_proc *, struct kinfo_proc *);

Modified: stable/7/usr.bin/w/pr_time.c
==
--- stable/7/usr.bin/w/pr_time.cSun Sep 13 17:05:56 2009
(r197170)
+++ stable/7/usr.bin/w/pr_time.cSun Sep 13 17:08:58 2009
(r197171)
@@ -52,13 +52,14 @@ static const char sccsid[] = "@(#)pr_tim
  * pr_attime --
  * Print the time since the user logged in.
  */
-void
+int
 pr_attime(time_t *started, time_t *now)
 {
-   static char buf[256];
+   static wchar_t buf[256];
struct tm tp, tm;
time_t diff;
-   char fmt[20];
+   wchar_t *fmt;
+   int len, width, offset = 0;
 
tp = *localtime(started);
tm = *localtime(now);
@@ -66,7 +67,7 @@ pr_attime(time_t *started, time_t *now)
 
/* If more than a week, use day-month-year. */
if (diff > 86400 * 7)
-   (void)strcpy(fmt, "%d%b%y");
+   fmt = L"%d%b%y";
 
/* If not today, use day-hour-am/pm. */
else if (tm.tm_mday != tp.tm_mday ||
@@ -74,16 +75,26 @@ pr_attime(time_t *started, time_t *now)
 tm.tm_year != tp.tm_year) {
/* The line below does not take DST into consideration */
/* else if (*now / 86400 != *started / 86400) { */
-   (void)strcpy(fmt, use_ampm ? "%a%I%p" : "%a%H");
+   fmt = use_ampm ? L"%a%I%p" : L"%a%H";
}
 
/* Default is hh:mm{am,pm}. */
else {
-   (void)strcpy(fmt, use_ampm ? "%l:%M%p" : "%k:%M");
+   fmt = use_ampm ? L"%l:%M%p" : L"%k:%M";
}
 
-   (void)strftime(buf, sizeof(buf), fmt, &tp);
-   (void)wprintf(L"%-7.7s", buf);
+   (void)wcsftime(buf, sizeof(buf), fmt, &tp);
+   len = wcslen(buf);
+   width = wcswidth(buf, len);
+   if (len == width)
+   (void)wprintf(L"%-7.7ls", buf);
+   else if (width < 7)
+   (void)wprintf(L"%ls%.*s", buf, 7 - width, "  ");
+   else {
+   (void)wprintf(L"%ls", buf);
+   offset = width - 7;
+   }
+   return (offset);
 }
 
 /*

Modified: stable/7/usr.bin/w/w.c
==
--- stable/7/usr.bin/w/w.c  Sun Sep 13 17:05:56 2009(r197170)
+++ stable/7/usr.bin/w/w.c  Sun Sep 13 17:08:58 2009(r197171)
@@ -137,7 +137,7 @@ main(int argc, char *argv[])
struct stat *stp;
FILE *ut;
time_t touched;
-   int ch, i, nentries, nusers, wcmd, longidle, dropgid;
+   int ch, i, nentries, nusers, wcmd, longidle, longattime, dropgid;
const char *memf, *nlistf, *p;
char *x_suffix;
char buf[MAXHOSTNAMELEN], errbuf[_POSIX2_LINE_MAX];
@@ -406,9 +406,10 @@ main(int argc, char *argv[])
ep->utmp.ut_line : ep->utmp.ut_line + 3,
W_DISPHOSTSIZE, W_DISPHOSTSIZE, *p ? p : "-");
t = _time_to_time32(ep->utmp.ut_time);
-   pr_attime(&t, &now);
+   longattime = pr_attime(&t, &now);
longidle = pr_idle(ep->idle);
-   (void)printf("%.*s\n", argwidth - longidle, ep->args);
+   (void)printf("%.*s\n", argwidth - longidle - longattime,
+   ep->args);
}
(void)kvm_close(kd);
exit(0);
___
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-unsubscr...@freebsd.org"


svn commit: r197646 - head/etc/rc.d

2009-09-30 Thread Hajimu UMEMOTO
Author: ume
Date: Wed Sep 30 14:58:10 2009
New Revision: 197646
URL: http://svn.freebsd.org/changeset/base/197646

Log:
  Don't do an IPv6 operation when the kernel doesn't have
  an IPv6 support.
  
  Reported by:  Alexander Best 
  Confirmed by: Paul B. Mahol ,
Alexander Best 

Modified:
  head/etc/rc.d/netoptions
  head/etc/rc.d/routing

Modified: head/etc/rc.d/netoptions
==
--- head/etc/rc.d/netoptionsWed Sep 30 14:42:06 2009(r197645)
+++ head/etc/rc.d/netoptionsWed Sep 30 14:58:10 2009(r197646)
@@ -9,6 +9,7 @@
 # KEYWORD: nojail
 
 . /etc/rc.subr
+. /etc/network.subr
 
 name="netoptions"
 start_cmd="netoptions_start"
@@ -66,11 +67,13 @@ netoptions_start()
;;
esac
 
-   if checkyesno ipv6_ipv4mapping; then
-   ${SYSCTL_W} net.inet6.ip6.v6only=0 >/dev/null
-   else
-   echo -n " no-ipv4-mapped-ipv6"
-   ${SYSCTL_W} net.inet6.ip6.v6only=1 >/dev/null
+   if afexists inet6; then
+   if checkyesno ipv6_ipv4mapping; then
+   ${SYSCTL_W} net.inet6.ip6.v6only=0 >/dev/null
+   else
+   echo -n " no-ipv4-mapped-ipv6"
+   ${SYSCTL_W} net.inet6.ip6.v6only=1 >/dev/null
+   fi
fi
 
[ -n "${_netoptions_initdone}" ] && echo '.'

Modified: head/etc/rc.d/routing
==
--- head/etc/rc.d/routing   Wed Sep 30 14:42:06 2009(r197645)
+++ head/etc/rc.d/routing   Wed Sep 30 14:58:10 2009(r197646)
@@ -51,7 +51,9 @@ static_start()
;;
*)
do_static inet add
-   do_static inet6 add
+   if afexists inet6; then
+   do_static inet6 add
+   fi
do_static atm add
;;
esac
@@ -74,7 +76,9 @@ static_stop()
;;
*)
do_static inet delete
-   do_static inet6 delete
+   if afexists inet6; then
+   do_static inet6 delete
+   fi
do_static atm delete
;;
esac
___
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-unsubscr...@freebsd.org"


svn commit: r198189 - head/bin/csh

2009-10-17 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Oct 17 15:53:15 2009
New Revision: 198189
URL: http://svn.freebsd.org/changeset/base/198189

Log:
  Check error of dlfunc(3).
  
  MFC after:3 days

Modified:
  head/bin/csh/iconv_stub.c

Modified: head/bin/csh/iconv_stub.c
==
--- head/bin/csh/iconv_stub.c   Sat Oct 17 13:42:23 2009(r198188)
+++ head/bin/csh/iconv_stub.c   Sat Oct 17 15:53:15 2009(r198189)
@@ -61,9 +61,20 @@ dl_iconv_open(const char *tocode, const 
if (iconvlib == NULL)
return (iconv_t)-1;
iconv_open = (iconv_open_t *)dlfunc(iconvlib, ICONV_OPEN);
+   if (iconv_open == NULL)
+   goto dlfunc_err;
dl_iconv = (dl_iconv_t *)dlfunc(iconvlib, ICONV_ENGINE);
+   if (dl_iconv == NULL)
+   goto dlfunc_err;
dl_iconv_close = (dl_iconv_close_t *)dlfunc(iconvlib,
ICONV_CLOSE);
+   if (dl_iconv_close == NULL)
+   goto dlfunc_err;
}
return iconv_open(tocode, fromcode);
+
+dlfunc_err:
+   dlclose(iconvlib);
+   iconvlib = NULL;
+   return (iconv_t)-1;
 }
___
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-unsubscr...@freebsd.org"


svn commit: r198276 - stable/8/bin/csh

2009-10-20 Thread Hajimu UMEMOTO
Author: ume
Date: Tue Oct 20 11:52:39 2009
New Revision: 198276
URL: http://svn.freebsd.org/changeset/base/198276

Log:
  MFC r198189: Check error of dlfunc(3).
  
  Approved by:  re (kib)

Modified:
  stable/8/bin/csh/   (props changed)
  stable/8/bin/csh/iconv_stub.c

Modified: stable/8/bin/csh/iconv_stub.c
==
--- stable/8/bin/csh/iconv_stub.c   Tue Oct 20 10:40:01 2009
(r198275)
+++ stable/8/bin/csh/iconv_stub.c   Tue Oct 20 11:52:39 2009
(r198276)
@@ -61,9 +61,20 @@ dl_iconv_open(const char *tocode, const 
if (iconvlib == NULL)
return (iconv_t)-1;
iconv_open = (iconv_open_t *)dlfunc(iconvlib, ICONV_OPEN);
+   if (iconv_open == NULL)
+   goto dlfunc_err;
dl_iconv = (dl_iconv_t *)dlfunc(iconvlib, ICONV_ENGINE);
+   if (dl_iconv == NULL)
+   goto dlfunc_err;
dl_iconv_close = (dl_iconv_close_t *)dlfunc(iconvlib,
ICONV_CLOSE);
+   if (dl_iconv_close == NULL)
+   goto dlfunc_err;
}
return iconv_open(tocode, fromcode);
+
+dlfunc_err:
+   dlclose(iconvlib);
+   iconvlib = NULL;
+   return (iconv_t)-1;
 }
___
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-unsubscr...@freebsd.org"


svn commit: r198285 - stable/7/bin/csh

2009-10-20 Thread Hajimu UMEMOTO
Author: ume
Date: Tue Oct 20 13:47:05 2009
New Revision: 198285
URL: http://svn.freebsd.org/changeset/base/198285

Log:
  MFC r198189: Check error of dlfunc(3).

Modified:
  stable/7/bin/csh/   (props changed)
  stable/7/bin/csh/iconv_stub.c

Modified: stable/7/bin/csh/iconv_stub.c
==
--- stable/7/bin/csh/iconv_stub.c   Tue Oct 20 13:34:41 2009
(r198284)
+++ stable/7/bin/csh/iconv_stub.c   Tue Oct 20 13:47:05 2009
(r198285)
@@ -61,9 +61,20 @@ dl_iconv_open(const char *tocode, const 
if (iconvlib == NULL)
return (iconv_t)-1;
iconv_open = (iconv_open_t *)dlfunc(iconvlib, ICONV_OPEN);
+   if (iconv_open == NULL)
+   goto dlfunc_err;
dl_iconv = (dl_iconv_t *)dlfunc(iconvlib, ICONV_ENGINE);
+   if (dl_iconv == NULL)
+   goto dlfunc_err;
dl_iconv_close = (dl_iconv_close_t *)dlfunc(iconvlib,
ICONV_CLOSE);
+   if (dl_iconv_close == NULL)
+   goto dlfunc_err;
}
return iconv_open(tocode, fromcode);
+
+dlfunc_err:
+   dlclose(iconvlib);
+   iconvlib = NULL;
+   return (iconv_t)-1;
 }
___
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-unsubscr...@freebsd.org"


svn commit: r198286 - stable/6/bin/csh

2009-10-20 Thread Hajimu UMEMOTO
Author: ume
Date: Tue Oct 20 13:49:34 2009
New Revision: 198286
URL: http://svn.freebsd.org/changeset/base/198286

Log:
  MFC r198189: Check error of dlfunc(3).

Modified:
  stable/6/bin/csh/   (props changed)
  stable/6/bin/csh/iconv_stub.c

Modified: stable/6/bin/csh/iconv_stub.c
==
--- stable/6/bin/csh/iconv_stub.c   Tue Oct 20 13:47:05 2009
(r198285)
+++ stable/6/bin/csh/iconv_stub.c   Tue Oct 20 13:49:34 2009
(r198286)
@@ -61,9 +61,20 @@ dl_iconv_open(const char *tocode, const 
if (iconvlib == NULL)
return (iconv_t)-1;
iconv_open = (iconv_open_t *)dlfunc(iconvlib, ICONV_OPEN);
+   if (iconv_open == NULL)
+   goto dlfunc_err;
dl_iconv = (dl_iconv_t *)dlfunc(iconvlib, ICONV_ENGINE);
+   if (dl_iconv == NULL)
+   goto dlfunc_err;
dl_iconv_close = (dl_iconv_close_t *)dlfunc(iconvlib,
ICONV_CLOSE);
+   if (dl_iconv_close == NULL)
+   goto dlfunc_err;
}
return iconv_open(tocode, fromcode);
+
+dlfunc_err:
+   dlclose(iconvlib);
+   iconvlib = NULL;
+   return (iconv_t)-1;
 }
___
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-unsubscr...@freebsd.org"


svn commit: r199080 - head/lib/libc/nls

2009-11-09 Thread Hajimu UMEMOTO
Author: ume
Date: Mon Nov  9 12:28:59 2009
New Revision: 199080
URL: http://svn.freebsd.org/changeset/base/199080

Log:
  Add ja_JP.UTF-8 catalog.
  
  Reviewed by:  hrs, nork, takawata
  MFC after:1 week

Added:
  head/lib/libc/nls/ja_JP.UTF-8.msg   (contents, props changed)
Modified:
  head/lib/libc/nls/Makefile.inc

Modified: head/lib/libc/nls/Makefile.inc
==
--- head/lib/libc/nls/Makefile.inc  Mon Nov  9 11:39:51 2009
(r199079)
+++ head/lib/libc/nls/Makefile.inc  Mon Nov  9 12:28:59 2009
(r199080)
@@ -23,6 +23,7 @@ NLS+= fr_FR.ISO8859-1
 NLS+=  gl_ES.ISO8859-1
 NLS+=  hu_HU.ISO8859-2
 NLS+=  it_IT.ISO8859-15
+NLS+=  ja_JP.UTF-8
 NLS+=  ko_KR.UTF-8
 NLS+=  ko_KR.eucKR
 NLS+=  mn_MN.UTF-8

Added: head/lib/libc/nls/ja_JP.UTF-8.msg
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/nls/ja_JP.UTF-8.msg   Mon Nov  9 12:28:59 2009
(r199080)
@@ -0,0 +1,249 @@
+$ $FreeBSD$
+$
+$ Message catalog for C locale (template)
+$
+$ strerror() support catalog
+$
+$set 1
+$ EPERM
+1 許可されていない操作です
+$ ENOENT
+2 そのようなファイルまたはディレクトリはありません
+$ ESRCH
+3 そのようなプロセスはありません
+$ EINTR
+4 システムコールが中断されました
+$ EIO
+5 入出力エラーです
+$ ENXIO
+6 デバイスが準備されていません
+$ E2BIG
+7 引数のリストが長すぎます
+$ ENOEXEC
+8 無効な実行形式です
+$ EBADF
+9 無効なファイル記述子です
+$ ECHILD
+10 子プロセスがありません
+$ EDEADLK
+11 リソースデッドロックを回避しました
+$ ENOMEM
+12 メモリの割り当てができません
+$ EACCES
+13 パーミッションが拒絶されました
+$ EFAULT
+14 無効なアドレスです
+$ ENOTBLK
+15 ブロックデバイスが要求されています
+$ EBUSY
+16 デバイスがビジー状態です
+$ EEXIST
+17 ファイルが存在します
+$ EXDEV
+18 デバイスをまたぐリンクです
+$ ENODEV
+19 デバイスが対応してない操作です
+$ ENOTDIR
+20 ディレクトリではありません
+$ EISDIR
+21 ディレクトリです
+$ EINVAL
+22 無効な引数です
+$ ENFILE
+23 システム内でオープンされているファイルが多すぎます
+$ EMFILE
+24 オープンしているファイルが多すぎます
+$ ENOTTY
+25 デバイスが対応していない ioctl です
+$ ETXTBSY
+26 テキストファイルがビジー状態です
+$ EFBIG
+27 ファイルが大きすぎます
+$ ENOSPC
+28 デバイスの空き領域不足です
+$ ESPIPE
+29 無効なシークです
+$ EROFS
+30 読み込み専用ファイルシステムです
+$ EMLINK
+31 リンク数が多すぎます
+$ EPIPE
+32 パイプが破壊されてました
+$ EDOM
+33 数値引数が範囲外です
+$ ERANGE
+34 結果が大き過ぎます
+$ EAGAIN, EWOULDBLOCK
+35 リソースが一時的に利用できません
+$ EINPROGRESS
+36 操作が現在進行中です
+$ EALREADY
+37 操作は既に進行中です
+$ ENOTSOCK
+38 ソケットでないものについてソケット操作を行いました
+$ EDESTADDRREQ
+39 宛先アドレスが要求されています
+$ EMSGSIZE
+40 メッセージが長すぎます
+$ EPROTOTYPE
+41 ソケットが対応していないプロトコルタイプです
+$ ENOPROTOOPT
+42 利用できないプロトコルです
+$ EPROTONOSUPPORT
+43 対応していないプロトコルです
+$ ESOCKTNOSUPPORT
+44 対応していないソケットタイプです
+$ EOPNOTSUPP
+45 対応していない操作です
+$ EPFNOSUPPORT
+46 対応していないプロトコルファミリです
+$ EAFNOSUPPORT
+47 プロトコルファミリが対応していないアドレスファミリが指定されました
+$ EADDRINUSE
+48 アドレスが既に使用中です
+$ EADDRNOTAVAIL
+49 要求されたアドレスを割り当てできません
+$ ENETDOWN
+50 ネットワークがダウンしています
+$ ENETUNREACH
+51 ネットワークに到達できません
+$ ENETRESET
+52 リセットによりネットワークの接続が失われました
+$ ECONNABORTED
+53 ソフトウェアによって接続が切断されました
+$ ECONNRESET
+54 接続が通信相手によってリセットされました
+$ ENOBUFS
+55 バッファの容量不足です
+$ EISCONN
+56 ソケットは既に接続されています
+$ ENOTCONN
+57 ソケットは接続されていません
+$ ESHUTDOWN
+58 ソケットのシャットダウンの後で送信ができません
+$ ETOOMANYREFS
+59 処理限界を超える多重参照です
+$ ETIMEDOUT
+60 操作がタイムアウトしました
+$ ECONNREFUSED
+61 接続が拒絶されました
+$ ELOOP
+62 処理限界を超えるシンボリックリンクレベルです
+$ ENAMETOOLONG
+63 ファイル名が長すぎます
+$ EHOSTDOWN
+64 ホストがダウンしています
+$ EHOSTUNREACH
+65 ホストへの経路がありません
+$ ENOTEMPTY
+66 ディレクトリが空ではありません
+$ EPROCLIM
+67 プロセスが多すぎます
+$ EUSERS
+68 ユーザが多すぎます
+$ EDQUOT
+69 ディスククォータが超過しました
+$ ESTALE
+70 失効した NFS ファイルハンドルです
+$ EREMOTE
+71 パス中のリモートのレベルが多すぎます
+$ EBADRPC
+72 無効な RPC 構造体です
+$ ERPCMISMATCH
+73 RPC バージョンが間違っています
+$ EPROGUNAVAIL
+74 RPC プログラムが利用できません
+$ EPROGMISMATCH
+75 プログラムのバージョンが合っていません
+$ EPROCUNAVAIL
+76 プログラムでは利用できない procedure です
+$ ENOLCK
+77 ロックが利用できません
+$ ENOSYS
+78 関数が実装されていません
+$ EFTYPE
+79 ファイルの型または形式が不適切です
+$ EAUTH
+80 認証エラーです
+$ ENEEDAUTH
+81 認証物が必要です
+$ EIDRM
+82 識別子は削除されました
+$ ENOMSG
+83 要求された型のメッセージがありません
+$ EOVERFLOW
+84 データ型に格納するには大きすぎる値です
+$ ECANCELED
+85 処理がキャンセルされました
+$ EILSEQ
+86 不正なバイト列です
+$ ENOATTR
+87 そのような属性はありません
+$ EDOOFUS
+88 プログラミングエラーです
+$
+$ strsignal() support catalog
+$
+$set 2
+$ SIGHUP
+1 ハングアップ
+$ SIGINT
+2 割り込み
+$ SIGQUIT
+3 中断
+$ SIGILL
+4 不正命令
+$ SIGTRAP
+5 トレース/BPT トラップ
+$ SIGABRT
+6 アボートトラップ
+$ SIGEMT
+7 EMT トラップ
+$ SIGFPE
+8 浮動小数点例外
+$ SIGKILL
+9 Kill された
+$ SIGBUS
+10 バスエラー
+$ SIGSEGV
+11 セグメンテーション違反
+$ SIGSYS
+12 存在しないシステムコール
+$ SIGPIPE
+13 パイプ破壊
+$ SIGALRM
+14 アラームクロック
+$ SIGTERM
+15 終了
+$ SIGURG
+16 緊急入出力状況
+$ SIGSTOP
+17 一時停止 (シグナル)
+$ SIGTSTP
+18 一時停止
+$ SIGCONT
+19 継続
+$ SIGCHLD
+20 子プロセスの終了
+$ SIGTTIN
+21 一時停止 (tty 入力)
+$ SIGTTOU
+22 一時停止 (tty 出力)
+$ SIGIO
+23 入出力可能
+$ SIGXCPU
+24 CPU 時間の制限超過
+$ SIGXFSZ
+25 ファイルサイズの制限超過
+$ SIGVTALRM
+26 仮想タイマの期限超過
+$ SIGPROF
+27 プロファイルタイマの期限超過
+$ SIGWINCH
+28 ウィンドウサイズの変化
+$ SIGINFO
+29 情報要求
+$ SIGUSR1
+30 ユーザ定義シグナル 1
+$ SIGUSR2
+31 ユーザ定義シグナル 2
___
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-unsubscr...@freebsd.org"


svn commit: r199081 - head/lib/libc/nls

2009-11-09 Thread Hajimu UMEMOTO
Author: ume
Date: Mon Nov  9 12:33:47 2009
New Revision: 199081
URL: http://svn.freebsd.org/changeset/base/199081

Log:
  Add ja_JP.eucJP catalog.
  
  Reviewed by:  hrs, nork, takawata
  MFC after:1 week

Added:
  head/lib/libc/nls/ja_JP.eucJP.msg   (contents, props changed)
Modified:
  head/lib/libc/nls/Makefile.inc

Modified: head/lib/libc/nls/Makefile.inc
==
--- head/lib/libc/nls/Makefile.inc  Mon Nov  9 12:28:59 2009
(r199080)
+++ head/lib/libc/nls/Makefile.inc  Mon Nov  9 12:33:47 2009
(r199081)
@@ -24,6 +24,7 @@ NLS+= gl_ES.ISO8859-1
 NLS+=  hu_HU.ISO8859-2
 NLS+=  it_IT.ISO8859-15
 NLS+=  ja_JP.UTF-8
+NLS+=  ja_JP.eucJP
 NLS+=  ko_KR.UTF-8
 NLS+=  ko_KR.eucKR
 NLS+=  mn_MN.UTF-8

Added: head/lib/libc/nls/ja_JP.eucJP.msg
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/nls/ja_JP.eucJP.msg   Mon Nov  9 12:33:47 2009
(r199081)
@@ -0,0 +1,249 @@
+$ $FreeBSD$
+$
+$ Message catalog for C locale (template)
+$
+$ strerror() support catalog
+$
+$set 1
+$ EPERM
+1 ���ĤƤ��ʤ��Ǥ�
+$ ENOENT
+2 ���Τ褦�ʥե��ޤ��ϥǥ��쥯�ȥ��Ϥޤ���
+$ ESRCH
+3 ���Τ褦�ʥץϤޤ���
+$ EINTR
+4 �ƥॳ���뤬���Ǥޤ���
+$ EIO
+5 �ϥ��顼�Ǥ�
+$ ENXIO
+6 �ǥХ���Ƥ��ޤ���
+$ E2BIG
+7 �Υꥹ�Ȥ�Ĺ�ޤ�
+$ ENOEXEC
+8 ̵���ʼ¹ԷǤ�
+$ EBADF
+9 ̵���ʥե뵭�һҤǤ�
+$ ECHILD
+10 �ҥץ��ޤ���
+$ EDEADLK
+11 �꥽�ǥåɥ��å��򤷤ޤ���
+$ ENOMEM
+12 ���γ��Ƥ��Ǥ��ޤ���
+$ EACCES
+13 �ѡ��ߥå󤬵��䤵���ޤ���
+$ EFAULT
+14 ̵���ʥ��ɥ쥹�Ǥ�
+$ ENOTBLK
+15 �֥��å��ǥХ��׵ᤵ���Ƥ��ޤ�
+$ EBUSY
+16 �ǥХ��ӥ��֤Ǥ�
+$ EEXIST
+17 �ե뤬¸�ߤ��ޤ�
+$ EXDEV
+18 �ǥХ��ޤ��󥯤Ǥ�
+$ ENODEV
+19 �ǥХ��бƤʤ��Ǥ�
+$ ENOTDIR
+20 �ǥ��쥯�ȥ��ǤϤޤ���
+$ EISDIR
+21 �ǥ��쥯�ȥ��Ǥ�
+$ EINVAL
+22 ̵���ʰǤ�
+$ ENFILE
+23 �ƥǥץ󤵤��Ƥե뤬¿�ޤ�
+$ EMFILE
+24 �ץ󤷤Ƥե뤬¿�ޤ�
+$ ENOTTY
+25 �ǥХ��бƤ��ʤ� ioctl �Ǥ�
+$ ETXTBSY
+26 �ƥȥե뤬�ӥ��֤Ǥ�
+$ EFBIG
+27 �ե뤬�礭�ޤ�
+$ ENOSPC
+28 �ǥХζΰ���­�Ǥ�
+$ ESPIPE
+29 ̵���ʥ��Ǥ�
+$ EROFS
+30 �ɤ߹��ѥե륷���ƥ��Ǥ�
+$ EMLINK
+31 ���󥯿���¿�ޤ�
+$ EPIPE
+32 �ѥ��פ��˲���Ƥޤ���
+$ EDOM
+33 ���Ͱ��ϰϳ��Ǥ�
+$ ERANGE
+34 ���̤��礭�᤮�ޤ�
+$ EAGAIN, EWOULDBLOCK
+35 �꥽��Ū�ѤǤ��ޤ���
+$ EINPROGRESS
+36 ������߿ʹǤ�
+$ EALREADY
+37 �ϴ��˿ʹǤ�
+$ ENOTSOCK
+38 �åȤǤʤΤˤĤ��ƥåԤ��ޤ���
+$ EDESTADDRREQ
+39 ���襢�ɥ쥹���׵ᤵ���Ƥ��ޤ�
+$ EMSGSIZE
+40 ���å���Ĺ�ޤ�
+$ EPROTOTYPE
+41 �åȤ��бƤ��ʤ��ץ��ȥ��륿���פǤ�
+$ ENOPROTOOPT
+42 ���ѤǤ��ʤ��ץ��ȥǤ�
+$ EPROTONOSUPPORT
+43 �бƤ��ʤ��ץ��ȥǤ�
+$ ESOCKTNOSUPPORT
+44 �бƤ��ʤ��åȥפǤ�
+$ EOPNOTSUPP
+45 �бƤ��ʤ��Ǥ�
+$ EPFNOSUPPORT
+46 �бƤ��ʤ��ץ��ȥե��ߥ��Ǥ�
+$ EAFNOSUPPORT
+47 �ץ��ȥե��ߥ꤬�бƤ��ʤɥ쥹�ե��ߥ꤬���ꤵ���ޤ���
+$ EADDRINUSE
+48 ���ɥ쥹�˻��Ǥ�
+$ EADDRNOTAVAIL
+49 �׵ᤵ�줿���ɥ쥹�ƤǤ��ޤ���
+$ ENETDOWN
+50 �ͥåȥ�󤷤Ƥ��ޤ�
+$ ENETUNREACH
+51 �ͥåȥ��ã�Ǥ��ޤ���
+$ ENETRESET
+52 �ꥻ�åȤˤͥåȥ��³�ޤ���
+$ ECONNABORTED
+53 ���եȥ��ˤ��ä���³�Ǥޤ���
+$ ECONNRESET
+54 ��³���̿��ˤ��äƥꥻ�åȤޤ���
+$ ENOBUFS
+55 �Хåե�­�Ǥ�
+$ EISCONN
+56 �åȤϴ�³�Ƥ��ޤ�
+$ ENOTCONN
+57 �åȤ���³�Ƥ��ޤ���
+$ ESHUTDOWN
+58 �åȤΥåȥ��θ���Ǥ��ޤ���
+$ ETOOMANYREFS
+59 �³���Ķ¿�Ż��ȤǤ�
+$ ETIMEDOUT
+60 ����ॢ���Ȥ��ޤ���
+$ ECONNREFUSED
+61 ��³�䤵���ޤ���
+$ ELOOP
+62 �³���Ķ���륷���ܥ��å󥯥��٥��Ǥ�
+$ ENAMETOOLONG
+63 �ե�̾��Ĺ�ޤ�
+$ EHOSTDOWN
+64 �ۥ��Ȥ��󤷤Ƥ��ޤ�
+$ EHOSTUNREACH
+65 �ۥ��Ȥؤη�ϩ���ޤ���
+$ ENOTEMPTY
+66 �ǥ��쥯�ȥ꤬���ǤϤޤ���
+$ EPROCLIM
+67 �ץ�¿�ޤ�
+$ EUSERS
+68 �桼¿�ޤ�
+$ EDQUOT
+69 �ǥ���Ķ�ᤷ�ޤ���
+$ ESTALE
+70  NFS �ե��ϥ��ɥ��Ǥ�
+$ EREMOTE
+71 �ѥΥ��⡼�ȤΥ��٥뤬¿�ޤ�
+$ EBADRPC
+72 ̵ RPC ��¤�ΤǤ�
+$ ERPCMISMATCH
+73 RPC �С��󤬴ְ��äƤ��ޤ�
+$ EPROGUNAVAIL
+74 RPC �ץब���ѤǤ��ޤ���
+$ EPROGMISMATCH
+75 �ץ��ΥС��󤬹��äƤ��ޤ���
+$ EPROCUNAVAIL
+76 �ץ��ǤѤǤ��ʤ� procedure �Ǥ�
+$ ENOLCK
+77 ���å��ѤǤ��ޤ���
+$ ENOSYS
+78 �ؿ��Ƥ��ޤ���
+$ EFTYPE
+79 �ե��η��ޤ��Ϸ���Ŭ�ڤǤ�
+$ EAUTH
+80 ǧ�ڥ��顼�Ǥ�
+$ ENEEDAUTH
+81 ǧ��ʪ��ɬ�פǤ�
+$ EIDRM
+82 ���̻ҤϺޤ���
+$ ENOMSG
+83 �׵ᤵ�줿���Υ��åޤ���
+$ EOVERFLOW
+84 �ǡ��˳�Ǽ�ˤ��礭���ͤǤ�
+$ ECANCELED
+85 ��󥻥뤵���ޤ���
+$ EILSEQ
+86 �ʥХ��Ǥ�
+$ ENOATTR
+87 ���Τ褦��°���Ϥޤ���
+$ EDOOFUS
+88 �ץߥ󥰥��顼�Ǥ�
+$
+$ strsignal() support catalog
+$
+$set 2
+$ SIGHUP
+1 �ϥ󥰥��å�
+$ SIGINT
+2 
+$ SIGQUIT
+3 
+$ SIGILL
+4 ̿��
+$ SIGTRAP
+5 �ȥ졼��/BPT �ȥ��å�
+$ SIGABRT
+6 ���ܡ��ȥȥ��å�
+$ SIGEMT
+7 EMT �ȥ��å�
+$ SIGFPE
+8 ��ư���㳰
+$ SIGKILL
+9 Kill ���줿
+$ SIGBUS
+10 �Х顼
+$ SIGSEGV
+11 �ơ�ȿ
+$ SIGSYS
+12 ¸�ߤ��ʤ��ƥॳ
+$ SIGPIPE
+13 �ѥ˲�
+$ SIGALRM
+14 ���顼�९���å�
+$ SIGTERM
+15 ��λ
+$ SIGURG
+16 

svn commit: r199082 - head/lib/libc/nls

2009-11-09 Thread Hajimu UMEMOTO
Author: ume
Date: Mon Nov  9 12:38:13 2009
New Revision: 199082
URL: http://svn.freebsd.org/changeset/base/199082

Log:
  Fix comment.
  
  Pointed out by:   nyan
  MFC after:1 week

Modified:
  head/lib/libc/nls/ja_JP.UTF-8.msg
  head/lib/libc/nls/ja_JP.eucJP.msg

Modified: head/lib/libc/nls/ja_JP.UTF-8.msg
==
--- head/lib/libc/nls/ja_JP.UTF-8.msg   Mon Nov  9 12:33:47 2009
(r199081)
+++ head/lib/libc/nls/ja_JP.UTF-8.msg   Mon Nov  9 12:38:13 2009
(r199082)
@@ -1,6 +1,6 @@
 $ $FreeBSD$
 $
-$ Message catalog for C locale (template)
+$ Message catalog for ja_JP.UTF-8 locale
 $
 $ strerror() support catalog
 $

Modified: head/lib/libc/nls/ja_JP.eucJP.msg
==
--- head/lib/libc/nls/ja_JP.eucJP.msg   Mon Nov  9 12:33:47 2009
(r199081)
+++ head/lib/libc/nls/ja_JP.eucJP.msg   Mon Nov  9 12:38:13 2009
(r199082)
@@ -1,6 +1,6 @@
 $ $FreeBSD$
 $
-$ Message catalog for C locale (template)
+$ Message catalog for ja_JP.eucJP locale
 $
 $ strerror() support catalog
 $
___
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-unsubscr...@freebsd.org"


svn commit: r199083 - in head/lib/libc: net nls

2009-11-09 Thread Hajimu UMEMOTO
Author: ume
Date: Mon Nov  9 12:46:59 2009
New Revision: 199083
URL: http://svn.freebsd.org/changeset/base/199083

Log:
  Add NLS catalogs support to gai_strerror(3).
  Controlled by NLS define.

Modified:
  head/lib/libc/net/gai_strerror.c
  head/lib/libc/nls/C.msg

Modified: head/lib/libc/net/gai_strerror.c
==
--- head/lib/libc/net/gai_strerror.cMon Nov  9 12:38:13 2009
(r199082)
+++ head/lib/libc/net/gai_strerror.cMon Nov  9 12:46:59 2009
(r199083)
@@ -30,7 +30,17 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "namespace.h"
 #include 
+#if defined(NLS)
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "reentrant.h"
+#endif
+#include "un-namespace.h"
 
 /* Entries EAI_ADDRFAMILY (1) and EAI_NODATA (7) are obsoleted, but left */
 /* for backward compatibility with userland code prior to 2553bis-02 */
@@ -52,9 +62,57 @@ static const char *ai_errlist[] = {
"Argument buffer overflow"  /* EAI_OVERFLOW */
 };
 
+#if defined(NLS)
+static chargai_buf[NL_TEXTMAX];
+static once_t  gai_init_once = ONCE_INITIALIZER;
+static thread_key_tgai_key;
+static int gai_keycreated = 0;
+
+static void
+gai_keycreate(void)
+{
+   gai_keycreated = (thr_keycreate(&gai_key, free) == 0);
+}
+#endif
+
 const char *
 gai_strerror(int ecode)
 {
+#if defined(NLS)
+   nl_catd catd;
+   char *buf;
+
+   if (thr_main() != 0)
+   buf = gai_buf;
+   else {
+   if (thr_once(&gai_init_once, gai_keycreate) != 0 ||
+   !gai_keycreated)
+   goto thr_err;
+   if ((buf = thr_getspecific(gai_key)) == NULL) {
+   if ((buf = malloc(sizeof(gai_buf))) == NULL)
+   goto thr_err;
+   if (thr_setspecific(gai_key, buf) != 0) {
+   free(buf);
+   goto thr_err;
+   }
+   }
+   }
+
+   catd = catopen("libc", NL_CAT_LOCALE);
+   if (ecode > 0 && ecode < EAI_MAX)
+   strlcpy(buf, catgets(catd, 3, ecode, ai_errlist[ecode]),
+   sizeof(gai_buf));
+   else if (ecode == 0)
+   strlcpy(buf, catgets(catd, 3, NL_MSGMAX - 1, "Success"),
+   sizeof(gai_buf));
+   else
+   strlcpy(buf, catgets(catd, 3, NL_MSGMAX, "Unknown error"),
+   sizeof(gai_buf));
+   catclose(catd);
+   return buf;
+
+thr_err:
+#endif
if (ecode >= 0 && ecode < EAI_MAX)
return ai_errlist[ecode];
return "Unknown error";

Modified: head/lib/libc/nls/C.msg
==
--- head/lib/libc/nls/C.msg Mon Nov  9 12:38:13 2009(r199082)
+++ head/lib/libc/nls/C.msg Mon Nov  9 12:46:59 2009(r199083)
@@ -257,3 +257,39 @@ $ SIGUSR1
 30 User defined signal 1
 $ SIGUSR2
 31 User defined signal 2
+$
+$ gai_strerror() support catalog
+$
+$set 3
+$ 1 (obsolete)
+1 Address family for hostname not supported
+$ EAI_AGAIN
+2 Temporary failure in name resolution
+$ EAI_BADFLAGS
+3 Invalid value for ai_flags
+$ EAI_FAIL
+4 Non-recoverable failure in name resolution
+$ EAI_FAMILY
+5 ai_family not supported
+$ EAI_MEMORY
+6 Memory allocation failure
+$ 7 (obsolete)
+7 No address associated with hostname
+$ EAI_NONAME
+8 hostname nor servname provided, or not known
+$ EAI_SERVICE
+9 servname not supported for ai_socktype
+$ EAI_SOCKTYPE
+10 ai_socktype not supported
+$ EAI_SYSTEM
+11 System error returned in errno
+$ EAI_BADHINTS
+12 Invalid value for hints
+$ EAI_PROTOCOL
+13 Resolved protocol is unknown
+$ EAI_OVERFLOW
+14 Argument buffer overflow
+$ 0
+32766 Success
+$ NL_MSGMAX
+32767 Unknown error
___
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-unsubscr...@freebsd.org"


Re: svn commit: r199081 - head/lib/libc/nls

2009-11-09 Thread Hajimu UMEMOTO
Hi,

>>>>> On Mon, 09 Nov 2009 13:42:21 +0100
>>>>> Gabor Kovesdan  said:

gabor> When iconv hits HEAD, I plan to add some Makefile magic to just have the 
gabor> catalogs in one encoding and convert that to all the encodings of the 
gabor> locale. But for now, I think we cannot do anything, so the dulicate 
gabor> catalogs are the only solution I think.

Oh, it's great!  I'm looking forward to see it happen.
Tcsh does similar thing at runtime using iconv.  Our csh has some
trick to load libiconv dynamically.
BTW, gencat(1) doesn't like ja_JP.SJIS catalog.  So, I could not add
ja_JP.SJIS one.

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
u...@mahoroba.org  u...@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/
___
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-unsubscr...@freebsd.org"


svn commit: r199085 - stable/8/sys/netinet6

2009-11-09 Thread Hajimu UMEMOTO
Author: ume
Date: Mon Nov  9 15:11:37 2009
New Revision: 199085
URL: http://svn.freebsd.org/changeset/base/199085

Log:
  MFC r198976, r198993:
   - Don't call LLE_FREE() after nd6_free().
   - Make nd6_llinfo_timer() does its job, again.  ln->la_expire was
 greater than time_second, in most cases.

Modified:
  stable/8/sys/netinet6/nd6.c   (contents, props changed)

Modified: stable/8/sys/netinet6/nd6.c
==
--- stable/8/sys/netinet6/nd6.c Mon Nov  9 14:26:23 2009(r199084)
+++ stable/8/sys/netinet6/nd6.c Mon Nov  9 15:11:37 2009(r199085)
@@ -502,12 +502,13 @@ nd6_llinfo_timer(void *arg)
 
ndi = ND_IFINFO(ifp);
dst = &L3_ADDR_SIN6(ln)->sin6_addr;
-   if ((ln->la_flags & LLE_STATIC) || (ln->la_expire > time_second)) {
+   if (ln->la_flags & LLE_STATIC) {
goto done;
}
 
if (ln->la_flags & LLE_DELETED) {
(void)nd6_free(ln, 0);
+   ln = NULL;
goto done;
}
 
___
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-unsubscr...@freebsd.org"


svn commit: r199092 - head/lib/libc/nls

2009-11-09 Thread Hajimu UMEMOTO
Author: ume
Date: Mon Nov  9 17:26:16 2009
New Revision: 199092
URL: http://svn.freebsd.org/changeset/base/199092

Log:
  Add gai_strerror() catalog for ja_JP.UTF-8 and ja_JP.eucJP.

Modified:
  head/lib/libc/nls/ja_JP.UTF-8.msg
  head/lib/libc/nls/ja_JP.eucJP.msg

Modified: head/lib/libc/nls/ja_JP.UTF-8.msg
==
--- head/lib/libc/nls/ja_JP.UTF-8.msg   Mon Nov  9 16:43:50 2009
(r199091)
+++ head/lib/libc/nls/ja_JP.UTF-8.msg   Mon Nov  9 17:26:16 2009
(r199092)
@@ -247,3 +247,39 @@ $ SIGUSR1
 30 ユーザ定義シグナル 1
 $ SIGUSR2
 31 ユーザ定義シグナル 2
+$
+$ gai_strerror() support catalog
+$
+$set 3
+$ 1 (obsolete)
+1 ホスト名のアドレスファミリーはサポートされません
+$ EAI_AGAIN
+2 名前解決での一時的な失敗
+$ EAI_BADFLAGS
+3 ai_flags の値が無効
+$ EAI_FAIL
+4 名前解決での回復不能な失敗
+$ EAI_FAMILY
+5 ai_family はサポートされません
+$ EAI_MEMORY
+6 メモリ割り当て失敗
+$ 7 (obsolete)
+7 ホスト名に対応するアドレスはありません
+$ EAI_NONAME
+8 ホスト名かサービス名が指定されない、または不明
+$ EAI_SERVICE
+9 サービス名は ai_socktype に対してサポートされません
+$ EAI_SOCKTYPE
+10 ai_socktype はサポートされません
+$ EAI_SYSTEM
+11 システムエラー、errno 参照
+$ EAI_BADHINTS
+12 hints の値が無効
+$ EAI_PROTOCOL
+13 解決されたプロトコルは不明です
+$ EAI_OVERFLOW
+14 引数バッファオーバフロー
+$ 0
+32766 成功
+$ NL_MSGMAX
+32767 不明なエラー

Modified: head/lib/libc/nls/ja_JP.eucJP.msg
==
--- head/lib/libc/nls/ja_JP.eucJP.msg   Mon Nov  9 16:43:50 2009
(r199091)
+++ head/lib/libc/nls/ja_JP.eucJP.msg   Mon Nov  9 17:26:16 2009
(r199092)
@@ -247,3 +247,39 @@ $ SIGUSR1
 30 �桼���ʥ� 1
 $ SIGUSR2
 31 �桼���ʥ� 2
+$
+$ gai_strerror() support catalog
+$
+$set 3
+$ 1 (obsolete)
+1 �ۥ���̾�Υ��ɥ쥹�ե��ߥ꡼�ϥ��ݡ��Ȥޤ���
+$ EAI_AGAIN
+2 ̾���Ǥΰ���Ū�ʼ���
+$ EAI_BADFLAGS
+3 ai_flags ���ͤ�̵��
+$ EAI_FAIL
+4 ̾���Ǥβ�ǽ�ʼ���
+$ EAI_FAMILY
+5 ai_family �ϥ��ݡ��Ȥޤ���
+$ EAI_MEMORY
+6 �Ƽ���
+$ 7 (obsolete)
+7 �ۥ���̾���б륢�ɥ쥹�Ϥޤ���
+$ EAI_NONAME
+8 �ۥ���̾���ӥ�̾�ꤵ���ʤޤ���
+$ EAI_SERVICE
+9 �ӥ�̾�� ai_socktype ���Ф��ƥ��ݡ��Ȥޤ���
+$ EAI_SOCKTYPE
+10 ai_socktype �ϥ��ݡ��Ȥޤ���
+$ EAI_SYSTEM
+11 �ƥ२�顼��errno 
+$ EAI_BADHINTS
+12 hints ���ͤ�̵��
+$ EAI_PROTOCOL
+13 ���褵�줿�ץ��ȥ��Ǥ�
+$ EAI_OVERFLOW
+14 �Хåե��Хե�
+$ 0
+32766 
+$ NL_MSGMAX
+32767 �ʥ��顼
___
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-unsubscr...@freebsd.org"


svn commit: r225906 - head/contrib/sendmail/src

2011-10-01 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Oct  1 18:20:10 2011
New Revision: 225906
URL: http://svn.freebsd.org/changeset/base/225906

Log:
  Shut up warnings with Cyrus SASL 2.1.25.
  
  Spotted by:   ache
  Tested by:ache

Modified:
  head/contrib/sendmail/src/main.c
  head/contrib/sendmail/src/sendmail.h
  head/contrib/sendmail/src/usersmtp.c

Modified: head/contrib/sendmail/src/main.c
==
--- head/contrib/sendmail/src/main.cSat Oct  1 16:08:03 2011
(r225905)
+++ head/contrib/sendmail/src/main.cSat Oct  1 18:20:10 2011
(r225906)
@@ -109,8 +109,8 @@ GIDSET_TInitialGidSet[NGROUPS_MAX];
 #if SASL
 static sasl_callback_t srvcallbacks[] =
 {
-   {   SASL_CB_VERIFYFILE, &safesaslfile,  NULL},
-   {   SASL_CB_PROXY_POLICY,   &proxy_policy,  NULL},
+   {   SASL_CB_VERIFYFILE, (sasl_callback_ft)&safesaslfile,
NULL},
+   {   SASL_CB_PROXY_POLICY,   (sasl_callback_ft)&proxy_policy,
NULL},
{   SASL_CB_LIST_END,   NULL,   NULL}
 };
 #endif /* SASL */

Modified: head/contrib/sendmail/src/sendmail.h
==
--- head/contrib/sendmail/src/sendmail.hSat Oct  1 16:08:03 2011
(r225905)
+++ head/contrib/sendmail/src/sendmail.hSat Oct  1 18:20:10 2011
(r225906)
@@ -133,10 +133,15 @@ SM_UNUSED(static char SmailId[]) = "@(#)
 
 # if SASL == 2 || SASL >= 2
 #  include 
+#  include 
 #  include 
+#  if SASL_VERSION_FULL < 0x020119
+typedef int (*sasl_callback_ft)(void);
+#  endif
 # else /* SASL == 2 || SASL >= 2 */
 #  include 
 #  include 
+typedef int (*sasl_callback_ft)(void);
 # endif /* SASL == 2 || SASL >= 2 */
 # if defined(SASL_VERSION_MAJOR) && defined(SASL_VERSION_MINOR) && 
defined(SASL_VERSION_STEP)
 #  define SASL_VERSION (SASL_VERSION_MAJOR * 1)  + (SASL_VERSION_MINOR * 
100) + SASL_VERSION_STEP

Modified: head/contrib/sendmail/src/usersmtp.c
==
--- head/contrib/sendmail/src/usersmtp.cSat Oct  1 16:08:03 2011
(r225905)
+++ head/contrib/sendmail/src/usersmtp.cSat Oct  1 18:20:10 2011
(r225906)
@@ -524,15 +524,15 @@ static int attemptauth__P((MAILER *, MC
 
 static sasl_callback_t callbacks[] =
 {
-   {   SASL_CB_GETREALM,   &saslgetrealm,  NULL},
+   {   SASL_CB_GETREALM,   (sasl_callback_ft)&saslgetrealm,
NULL},
 #define CB_GETREALM_IDX0
-   {   SASL_CB_PASS,   &getsecret, NULL},
+   {   SASL_CB_PASS,   (sasl_callback_ft)&getsecret,   NULL
},
 #define CB_PASS_IDX1
-   {   SASL_CB_USER,   &getsimple, NULL},
+   {   SASL_CB_USER,   (sasl_callback_ft)&getsimple,   NULL
},
 #define CB_USER_IDX2
-   {   SASL_CB_AUTHNAME,   &getsimple, NULL},
+   {   SASL_CB_AUTHNAME,   (sasl_callback_ft)&getsimple,   NULL
},
 #define CB_AUTHNAME_IDX3
-   {   SASL_CB_VERIFYFILE, &safesaslfile,  NULL},
+   {   SASL_CB_VERIFYFILE, (sasl_callback_ft)&safesaslfile,
NULL},
 #define CB_SAFESASL_IDX4
{   SASL_CB_LIST_END,   NULL,   NULL}
 };
___
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-unsubscr...@freebsd.org"


svn commit: r225907 - stable/9/contrib/sendmail/src

2011-10-01 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Oct  1 19:58:35 2011
New Revision: 225907
URL: http://svn.freebsd.org/changeset/base/225907

Log:
  MFC r225906: Shut up warnings with Cyrus SASL 2.1.25.
  
  Approved by:  re (kib)

Modified:
  stable/9/contrib/sendmail/src/main.c
  stable/9/contrib/sendmail/src/sendmail.h
  stable/9/contrib/sendmail/src/usersmtp.c
Directory Properties:
  stable/9/contrib/sendmail/   (props changed)

Modified: stable/9/contrib/sendmail/src/main.c
==
--- stable/9/contrib/sendmail/src/main.cSat Oct  1 18:20:10 2011
(r225906)
+++ stable/9/contrib/sendmail/src/main.cSat Oct  1 19:58:35 2011
(r225907)
@@ -109,8 +109,8 @@ GIDSET_TInitialGidSet[NGROUPS_MAX];
 #if SASL
 static sasl_callback_t srvcallbacks[] =
 {
-   {   SASL_CB_VERIFYFILE, &safesaslfile,  NULL},
-   {   SASL_CB_PROXY_POLICY,   &proxy_policy,  NULL},
+   {   SASL_CB_VERIFYFILE, (sasl_callback_ft)&safesaslfile,
NULL},
+   {   SASL_CB_PROXY_POLICY,   (sasl_callback_ft)&proxy_policy,
NULL},
{   SASL_CB_LIST_END,   NULL,   NULL}
 };
 #endif /* SASL */

Modified: stable/9/contrib/sendmail/src/sendmail.h
==
--- stable/9/contrib/sendmail/src/sendmail.hSat Oct  1 18:20:10 2011
(r225906)
+++ stable/9/contrib/sendmail/src/sendmail.hSat Oct  1 19:58:35 2011
(r225907)
@@ -133,10 +133,15 @@ SM_UNUSED(static char SmailId[]) = "@(#)
 
 # if SASL == 2 || SASL >= 2
 #  include 
+#  include 
 #  include 
+#  if SASL_VERSION_FULL < 0x020119
+typedef int (*sasl_callback_ft)(void);
+#  endif
 # else /* SASL == 2 || SASL >= 2 */
 #  include 
 #  include 
+typedef int (*sasl_callback_ft)(void);
 # endif /* SASL == 2 || SASL >= 2 */
 # if defined(SASL_VERSION_MAJOR) && defined(SASL_VERSION_MINOR) && 
defined(SASL_VERSION_STEP)
 #  define SASL_VERSION (SASL_VERSION_MAJOR * 1)  + (SASL_VERSION_MINOR * 
100) + SASL_VERSION_STEP

Modified: stable/9/contrib/sendmail/src/usersmtp.c
==
--- stable/9/contrib/sendmail/src/usersmtp.cSat Oct  1 18:20:10 2011
(r225906)
+++ stable/9/contrib/sendmail/src/usersmtp.cSat Oct  1 19:58:35 2011
(r225907)
@@ -524,15 +524,15 @@ static int attemptauth__P((MAILER *, MC
 
 static sasl_callback_t callbacks[] =
 {
-   {   SASL_CB_GETREALM,   &saslgetrealm,  NULL},
+   {   SASL_CB_GETREALM,   (sasl_callback_ft)&saslgetrealm,
NULL},
 #define CB_GETREALM_IDX0
-   {   SASL_CB_PASS,   &getsecret, NULL},
+   {   SASL_CB_PASS,   (sasl_callback_ft)&getsecret,   NULL
},
 #define CB_PASS_IDX1
-   {   SASL_CB_USER,   &getsimple, NULL},
+   {   SASL_CB_USER,   (sasl_callback_ft)&getsimple,   NULL
},
 #define CB_USER_IDX2
-   {   SASL_CB_AUTHNAME,   &getsimple, NULL},
+   {   SASL_CB_AUTHNAME,   (sasl_callback_ft)&getsimple,   NULL
},
 #define CB_AUTHNAME_IDX3
-   {   SASL_CB_VERIFYFILE, &safesaslfile,  NULL},
+   {   SASL_CB_VERIFYFILE, (sasl_callback_ft)&safesaslfile,
NULL},
 #define CB_SAFESASL_IDX4
{   SASL_CB_LIST_END,   NULL,   NULL}
 };
___
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-unsubscr...@freebsd.org"


svn commit: r217642 - head/usr.bin/netstat

2011-01-20 Thread Hajimu UMEMOTO
Author: ume
Date: Thu Jan 20 15:22:01 2011
New Revision: 217642
URL: http://svn.freebsd.org/changeset/base/217642

Log:
  - Hide the internal scope address representation of the KAME IPv6
stack from the output of `netstat -ani'.
  - The node-local multicast address in the output of `netstat -rn'
should be handled as well.
  
  Spotted by:   Bernd Walter 

Modified:
  head/usr.bin/netstat/if.c
  head/usr.bin/netstat/netstat.h
  head/usr.bin/netstat/route.c

Modified: head/usr.bin/netstat/if.c
==
--- head/usr.bin/netstat/if.c   Thu Jan 20 15:09:11 2011(r217641)
+++ head/usr.bin/netstat/if.c   Thu Jan 20 15:22:01 2011(r217642)
@@ -59,6 +59,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef INET6
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -75,7 +78,7 @@ static void sidewaysintpr(int, u_long);
 static void catchalarm(int);
 
 #ifdef INET6
-static char ntop_buf[INET6_ADDRSTRLEN];/* for inet_ntop() */
+static char addr_buf[NI_MAXHOST];  /* for getnameinfo() */
 #endif
 
 /*
@@ -339,13 +342,14 @@ intpr(int interval1, u_long ifnetaddr, v
 #ifdef INET6
case AF_INET6:
sockin6 = (struct sockaddr_in6 *)sa;
+   in6_fillscopeid(&ifaddr.in6.ia_addr);
printf("%-13.13s ",
   netname6(&ifaddr.in6.ia_addr,

&ifaddr.in6.ia_prefixmask.sin6_addr));
-   printf("%-17.17s ",
-   inet_ntop(AF_INET6,
-   &sockin6->sin6_addr,
-   ntop_buf, sizeof(ntop_buf)));
+   in6_fillscopeid(sockin6);
+   getnameinfo(sa, sa->sa_len, addr_buf,
+   sizeof(addr_buf), 0, 0, NI_NUMERICHOST);
+   printf("%-17.17s ", addr_buf);
 
network_layer = 1;
break;
@@ -465,13 +469,13 @@ intpr(int interval1, u_long ifnetaddr, v
break;
 #ifdef INET6
case AF_INET6:
+   in6_fillscopeid(&msa.in6);
+   getnameinfo(&msa.sa, msa.sa.sa_len,
+   addr_buf, sizeof(addr_buf), 0, 0,
+   NI_NUMERICHOST);
printf("%*s %-19.19s(refs: %d)\n",
   Wflag ? 27 : 25, "",
-  inet_ntop(AF_INET6,
-&msa.in6.sin6_addr,
-ntop_buf,
-sizeof(ntop_buf)),
-  ifma.ifma_refcount);
+  addr_buf, ifma.ifma_refcount);
break;
 #endif /* INET6 */
case AF_LINK:

Modified: head/usr.bin/netstat/netstat.h
==
--- head/usr.bin/netstat/netstat.h  Thu Jan 20 15:09:11 2011
(r217641)
+++ head/usr.bin/netstat/netstat.h  Thu Jan 20 15:22:01 2011
(r217642)
@@ -101,6 +101,7 @@ voidmrt6_stats(u_long);
 
 struct sockaddr_in6;
 struct in6_addr;
+void in6_fillscopeid(struct sockaddr_in6 *);
 char *routename6(struct sockaddr_in6 *);
 const char *netname6(struct sockaddr_in6 *, struct in6_addr *);
 void   inet6print(struct in6_addr *, int, const char *, int);

Modified: head/usr.bin/netstat/route.c
==
--- head/usr.bin/netstat/route.cThu Jan 20 15:09:11 2011
(r217641)
+++ head/usr.bin/netstat/route.cThu Jan 20 15:22:01 2011
(r217642)
@@ -633,18 +633,8 @@ fmt_sockaddr(struct sockaddr *sa, struct
case AF_INET6:
{
struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)sa;
-   struct in6_addr *in6 = &sa6->sin6_addr;
 
-   /*
-* XXX: This is a special workaround for KAME kernels.
-* sin6_scope_id field of SA should be set in the future.
-*/
-   if (IN6_IS_ADDR_LINKLOCAL(in6) ||
-   IN6_IS_ADDR_MC_LINKLOCAL(in6)) {
-   /* XXX: override is ok? */
-   sa6->sin6_scope_id = (u_int32_t)ntohs(*(u_short 
*)&in6->s6_addr[2]);
-   *(u_short *)&in6->s6_addr[2] = 0;
-   }
+   in6_fillscopeid(sa6);
 
 

svn commit: r219061 - head/bin/csh

2011-02-26 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Feb 26 18:54:54 2011
New Revision: 219061
URL: http://svn.freebsd.org/changeset/base/219061

Log:
  When WITH_ICONV is set, use our in-tree iconv.

Added:
  head/bin/csh/iconv_stub.h
 - copied unchanged from r219060, head/bin/csh/iconv.h
Deleted:
  head/bin/csh/iconv.h
Modified:
  head/bin/csh/Makefile

Modified: head/bin/csh/Makefile
==
--- head/bin/csh/Makefile   Sat Feb 26 17:28:09 2011(r219060)
+++ head/bin/csh/Makefile   Sat Feb 26 18:54:54 2011(r219061)
@@ -76,18 +76,26 @@ NLSLINKS_es_ES.ISO8859-1= es_ES.ISO8859-
 CFLAGS+= -DNO_NLS_CATALOGS
 .else
 CFLAGS+= -DHAVE_ICONV
+.if ${MK_ICONV} != "no"
+NLSLINKS_de_DE.ISO8859-1 += de_AT.UTF-8 de_CH.UTF-8 de_DE.UTF-8
+NLSLINKS_el_GR.ISO8859-7 = el_GR.UTF-8
+NLSLINKS_es_ES.ISO8859-1 += es_ES.UTF-8
+NLSLINKS_et_EE.ISO8859-15 = et_EE.UTF-8
+NLSLINKS_fi_FI.ISO8859-1 += fi_FI.UTF-8
+NLSLINKS_fr_FR.ISO8859-1 += fr_BE.UTF-8 fr_CA.UTF-8 fr_CH.UTF-8 fr_FR.UTF-8
+NLSLINKS_it_IT.ISO8859-1 += it_CH.UTF-8 it_IT.UTF-8
+NLSLINKS_ja_JP.eucJP = ja_JP.SJIS ja_JP.UTF-8
+NLSLINKS_ru_RU.KOI8-R = ru_RU.CP1251 ru_RU.CP866 ru_RU.ISO8859-5 ru_RU.UTF-8
+NLSLINKS_uk_UA.KOI8-U = uk_UA.ISO8859-5 uk_UA.UTF-8
+.else
+# Above links can be installed from ports/shells/tcsh_nls
+
+GENHDRS+= iconv.h
 SRCS+= iconv_stub.c
-# Following links can be installed from ports/shells/tcsh_nls:
-# NLSLINKS_de_DE.ISO8859-1 += de_AT.UTF-8 de_CH.UTF-8 de_DE.UTF-8
-# NLSLINKS_el_GR.ISO8859-7 = el_GR.UTF-8
-# NLSLINKS_es_ES.ISO8859-1 += es_ES.UTF-8
-# NLSLINKS_et_EE.ISO8859-15 = et_EE.UTF-8
-# NLSLINKS_fi_FI.ISO8859-1 += fi_FI.UTF-8
-# NLSLINKS_fr_FR.ISO8859-1 += fr_BE.UTF-8 fr_CA.UTF-8 fr_CH.UTF-8 fr_FR.UTF-8
-# NLSLINKS_it_IT.ISO8859-1 += it_CH.UTF-8 it_IT.UTF-8
-# NLSLINKS_ja_JP.eucJP = ja_JP.SJIS ja_JP.UTF-8
-# NLSLINKS_ru_RU.KOI8-R = ru_RU.CP1251 ru_RU.CP866 ru_RU.ISO8859-5 ru_RU.UTF-8
-# NLSLINKS_uk_UA.KOI8-U = uk_UA.ISO8859-5 uk_UA.UTF-8
+
+iconv.h: ${.CURDIR}/iconv_stub.h
+   cp ${.CURDIR}/iconv_stub.h ${.TARGET}
+.endif
 .endif
 
 NLSNAME= tcsh
@@ -105,7 +113,8 @@ build-tools: gethost
 
 gethost: gethost.c sh.err.h tc.const.h sh.h
@rm -f ${.TARGET}
-   ${CC} -o gethost ${LDFLAGS} ${CFLAGS} ${TCSHDIR}/gethost.c
+   ${CC} -o gethost ${LDFLAGS} ${CFLAGS:C/-DHAVE_ICONV//} \
+   ${TCSHDIR}/gethost.c
 
 tc.defs.c: gethost ${.CURDIR}/host.defs
@rm -f ${.TARGET}
@@ -133,7 +142,8 @@ tc.const.h: tc.const.c sh.char.h config.
@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
@echo '#ifndef _h_tc_const' >> ${.TARGET}
@echo '#define _h_tc_const' >> ${.TARGET}
-   ${CC} -E ${CFLAGS} ${.ALLSRC} -D_h_tc_const | grep 'Char STR' | \
+   ${CC} -E ${CFLAGS:C/-DHAVE_ICONV//} ${.ALLSRC} -D_h_tc_const | \
+   grep 'Char STR' | \
sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
sort >> ${.TARGET}
@echo '#endif /* _h_tc_const */' >> ${.TARGET}

Copied: head/bin/csh/iconv_stub.h (from r219060, head/bin/csh/iconv.h)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/csh/iconv_stub.h   Sat Feb 26 18:54:54 2011    (r219061, copy 
of r219060, head/bin/csh/iconv.h)
@@ -0,0 +1,44 @@
+/*-
+ * Copyright (c) 2006 Hajimu UMEMOTO 
+ * 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
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _ICONV_H_
+#define _ICONV_H_
+
+typedef void *iconv_t;
+typedef size_t dl_ic

svn commit: r219062 - stable/8/usr.bin/netstat

2011-02-26 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Feb 26 20:04:14 2011
New Revision: 219062
URL: http://svn.freebsd.org/changeset/base/219062

Log:
  MFC r217642:
- Hide the internal scope address representation of the KAME IPv6
  stack from the output of `netstat -ani'.
- The node-local multicast address in the output of `netstat -rn'
  should be handled as well.

Modified:
  stable/8/usr.bin/netstat/if.c
  stable/8/usr.bin/netstat/netstat.h
  stable/8/usr.bin/netstat/route.c
Directory Properties:
  stable/8/usr.bin/netstat/   (props changed)

Modified: stable/8/usr.bin/netstat/if.c
==
--- stable/8/usr.bin/netstat/if.c   Sat Feb 26 18:54:54 2011
(r219061)
+++ stable/8/usr.bin/netstat/if.c   Sat Feb 26 20:04:14 2011
(r219062)
@@ -63,6 +63,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef INET6
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -79,7 +82,7 @@ static void sidewaysintpr(int, u_long);
 static void catchalarm(int);
 
 #ifdef INET6
-static char ntop_buf[INET6_ADDRSTRLEN];/* for inet_ntop() */
+static char addr_buf[NI_MAXHOST];  /* for getnameinfo() */
 #endif
 
 /*
@@ -347,13 +350,14 @@ intpr(int interval1, u_long ifnetaddr, v
 #ifdef INET6
case AF_INET6:
sockin6 = (struct sockaddr_in6 *)sa;
+   in6_fillscopeid(&ifaddr.in6.ia_addr);
printf("%-13.13s ",
   netname6(&ifaddr.in6.ia_addr,

&ifaddr.in6.ia_prefixmask.sin6_addr));
-   printf("%-17.17s ",
-   inet_ntop(AF_INET6,
-   &sockin6->sin6_addr,
-   ntop_buf, sizeof(ntop_buf)));
+   in6_fillscopeid(sockin6);
+   getnameinfo(sa, sa->sa_len, addr_buf,
+   sizeof(addr_buf), 0, 0, NI_NUMERICHOST);
+   printf("%-17.17s ", addr_buf);
 
network_layer = 1;
break;
@@ -475,13 +479,13 @@ intpr(int interval1, u_long ifnetaddr, v
break;
 #ifdef INET6
case AF_INET6:
+   in6_fillscopeid(&msa.in6);
+   getnameinfo(&msa.sa, msa.sa.sa_len,
+   addr_buf, sizeof(addr_buf), 0, 0,
+   NI_NUMERICHOST);
printf("%*s %-19.19s(refs: %d)\n",
   Wflag ? 27 : 25, "",
-  inet_ntop(AF_INET6,
-&msa.in6.sin6_addr,
-ntop_buf,
-sizeof(ntop_buf)),
-  ifma.ifma_refcount);
+  addr_buf, ifma.ifma_refcount);
break;
 #endif /* INET6 */
case AF_LINK:

Modified: stable/8/usr.bin/netstat/netstat.h
==
--- stable/8/usr.bin/netstat/netstat.h  Sat Feb 26 18:54:54 2011
(r219061)
+++ stable/8/usr.bin/netstat/netstat.h  Sat Feb 26 20:04:14 2011
(r219062)
@@ -106,6 +106,7 @@ voidmrt6_stats(u_long);
 
 struct sockaddr_in6;
 struct in6_addr;
+void in6_fillscopeid(struct sockaddr_in6 *);
 char *routename6(struct sockaddr_in6 *);
 const char *netname6(struct sockaddr_in6 *, struct in6_addr *);
 void   inet6print(struct in6_addr *, int, const char *, int);

Modified: stable/8/usr.bin/netstat/route.c
==
--- stable/8/usr.bin/netstat/route.cSat Feb 26 18:54:54 2011
(r219061)
+++ stable/8/usr.bin/netstat/route.cSat Feb 26 20:04:14 2011
(r219062)
@@ -637,18 +637,8 @@ fmt_sockaddr(struct sockaddr *sa, struct
case AF_INET6:
{
struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)sa;
-   struct in6_addr *in6 = &sa6->sin6_addr;
 
-   /*
-* XXX: This is a special workaround for KAME kernels.
-* sin6_scope_id field of SA should be set in the future.
-*/
-   if (IN6_IS_ADDR_LINKLOCAL(in6) ||
-   IN6_IS_ADDR_MC_LINKLOCAL(in6)) {
-   /* XXX: override is ok? */
-   sa6->sin6_scope_id = (u_int32_t)ntohs(*(u_short 
*)&in6->s6_addr[2]);
-   *

svn commit: r219732 - in vendor/openresolv: . dist

2011-03-18 Thread Hajimu UMEMOTO
Author: ume
Date: Fri Mar 18 10:35:54 2011
New Revision: 219732
URL: http://svn.freebsd.org/changeset/base/219732

Log:
  Import openresolv-3.4.1.

Added:
  vendor/openresolv/
  vendor/openresolv/dist/
  vendor/openresolv/dist/Makefile   (contents, props changed)
  vendor/openresolv/dist/README
  vendor/openresolv/dist/configure
  vendor/openresolv/dist/dnsmasq.in   (contents, props changed)
  vendor/openresolv/dist/libc.in   (contents, props changed)
  vendor/openresolv/dist/named.in   (contents, props changed)
  vendor/openresolv/dist/pdnsd.in   (contents, props changed)
  vendor/openresolv/dist/resolvconf.8.in   (contents, props changed)
  vendor/openresolv/dist/resolvconf.conf   (contents, props changed)
  vendor/openresolv/dist/resolvconf.conf.5.in   (contents, props changed)
  vendor/openresolv/dist/resolvconf.in   (contents, props changed)
  vendor/openresolv/dist/unbound.in   (contents, props changed)

Added: vendor/openresolv/dist/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/openresolv/dist/Makefile Fri Mar 18 10:35:54 2011
(r219732)
@@ -0,0 +1,66 @@
+include config.mk
+
+NAME=  openresolv
+VERSION=   3.4.1
+PKG=   ${NAME}-${VERSION}
+
+INSTALL?=  install
+SED?=  sed
+
+BINMODE?=  0755
+DOCMODE?=  0644
+MANMODE?=  0444
+
+RESOLVCONF=resolvconf resolvconf.8 resolvconf.conf.5
+SUBSCRIBERS=   libc dnsmasq named pdnsd unbound
+TARGET=${RESOLVCONF} ${SUBSCRIBERS}
+SRCS=  ${TARGET:C,$,.in,} # pmake
+SRCS:= ${TARGET:=.in} # gmake
+
+SED_PREFIX=-e 's:@PREFIX@:${PREFIX}:g'
+SED_SYSCONFDIR=-e 's:@SYSCONFDIR@:${SYSCONFDIR}:g'
+SED_LIBEXECDIR=-e 's:@LIBEXECDIR@:${LIBEXECDIR}:g'
+SED_VARDIR=-e 's:@VARDIR@:${VARDIR}:g'
+SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g'
+SED_RESTARTCMD=-e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g'
+
+.SUFFIXES: .in
+
+all: ${TARGET}
+
+.in:
+   ${SED}  ${SED_PREFIX} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \
+   ${SED_VARDIR} ${SED_RCDIR} ${SED_RESTARTCMD} \
+   $< > $@
+
+clean:
+   rm -f ${TARGET} openresolv-${VERSION}.tar.bz2
+
+distclean: clean
+   rm -f config.mk
+
+installdirs:
+
+install: ${TARGET}
+   ${INSTALL} -d ${DESTDIR}${SBINDIR}
+   ${INSTALL} -m ${BINMODE} resolvconf ${DESTDIR}${SBINDIR}
+   ${INSTALL} -d ${DESTDIR}${SYSCONFDIR}
+   test -e ${DESTDIR}${SYSCONFDIR}/resolvconf.conf || \
+   ${INSTALL} -m ${DOCMODE} resolvconf.conf ${DESTDIR}${SYSCONFDIR}
+   ${INSTALL} -d ${DESTDIR}${LIBEXECDIR}
+   ${INSTALL} -m ${DOCMODE} ${SUBSCRIBERS} ${DESTDIR}${LIBEXECDIR}
+   ${INSTALL} -d ${DESTDIR}${MANDIR}/man8
+   ${INSTALL} -m ${MANMODE} resolvconf.8 ${DESTDIR}${MANDIR}/man8
+   ${INSTALL} -d ${DESTDIR}${MANDIR}/man5
+   ${INSTALL} -m ${MANMODE} resolvconf.conf.5 ${DESTDIR}${MANDIR}/man5
+
+import:
+   rm -rf /tmp/${PKG}
+   ${INSTALL} -d /tmp/${PKG}
+   cp README ${SRCS} /tmp/${PKG}
+
+dist: import
+   cp configure Makefile resolvconf.conf /tmp/${PKG}
+   tar cvjpf ${PKG}.tar.bz2 -C /tmp ${PKG} 
+   rm -rf /tmp/${PKG} 
+   ls -l ${PKG}.tar.bz2

Added: vendor/openresolv/dist/README
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/openresolv/dist/README   Fri Mar 18 10:35:54 2011
(r219732)
@@ -0,0 +1,11 @@
+openresolv is a resolvconf implementation which manages resolv.conf
+You can find the latest version at http://roy.marples.name/projects/openresolv
+It is written and maintained by Roy Marples 
+
+This resolvconf implementation, along with its subscribers, work with a
+POSIX compliant shell and userland utilities. It is designed to work without
+tools such as sed as it *has* to work without /usr being available.
+
+On systems where resolvconf is expected to be used before /var/run is available
+for writing, you can configure openresolv to write somewhere else, like say a
+ramdisk.

Added: vendor/openresolv/dist/configure
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/openresolv/dist/configureFri Mar 18 10:35:54 2011
(r219732)
@@ -0,0 +1,186 @@
+#!/bin/sh
+# Try and be like autotools configure, but without autotools
+
+# Ensure that we do not inherit these from env
+OS=
+BUILD=
+HOST=
+TARGET=
+RESTARTCMD=
+RCDIR=
+
+for x; do
+   opt=${x%%=*}
+   var=${x#*=}
+   case "$opt" in
+   --os|OS) OS=$var;;
+   --with-cc|CC) CC=$var;;
+   --debug) DEBUG=$var;;
+   --disable-debug) DEBUG=no;;
+   --enable-debug) DEBUG=yes;;
+   --prefix) prefix=$var;;
+   --sysconfdir) SYSCONFDIR=$var;;
+   --bindir|--sbindir) SBI

svn commit: r219733 - vendor/openresolv/3.4.1

2011-03-18 Thread Hajimu UMEMOTO
Author: ume
Date: Fri Mar 18 10:39:52 2011
New Revision: 219733
URL: http://svn.freebsd.org/changeset/base/219733

Log:
  Tag openresolv-3.4.1.

Added:
  vendor/openresolv/3.4.1/
 - copied from r219732, vendor/openresolv/dist/
___
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-unsubscr...@freebsd.org"


svn commit: r219734 - head/contrib/openresolv

2011-03-18 Thread Hajimu UMEMOTO
Author: ume
Date: Fri Mar 18 10:52:23 2011
New Revision: 219734
URL: http://svn.freebsd.org/changeset/base/219734

Log:
  Import openresolv from vendor branch.

Added:
Directory Properties:
  head/contrib/openresolv/   (props changed)
___
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-unsubscr...@freebsd.org"


svn commit: r219735 - head/contrib/openresolv

2011-03-18 Thread Hajimu UMEMOTO
Author: ume
Date: Fri Mar 18 12:07:53 2011
New Revision: 219735
URL: http://svn.freebsd.org/changeset/base/219735

Log:
  Remove contrib/openresolv.
  
  Helped by:jhb

Deleted:
  head/contrib/openresolv/
___
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-unsubscr...@freebsd.org"


svn commit: r219736 - head/contrib/openresolv

2011-03-18 Thread Hajimu UMEMOTO
Author: ume
Date: Fri Mar 18 12:09:27 2011
New Revision: 219736
URL: http://svn.freebsd.org/changeset/base/219736

Log:
  Import openresolv from vendor branch, actually.
  
  Helped by:jhb

Added:
  head/contrib/openresolv/
 - copied from r219735, vendor/openresolv/dist/
___
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-unsubscr...@freebsd.org"


svn commit: r219738 - in head: etc/mtree sbin sbin/resolvconf

2011-03-18 Thread Hajimu UMEMOTO
Author: ume
Date: Fri Mar 18 12:18:52 2011
New Revision: 219738
URL: http://svn.freebsd.org/changeset/base/219738

Log:
  Add resolvconf(8) which manages resolv.conf.

Added:
  head/sbin/resolvconf/
  head/sbin/resolvconf/Makefile   (contents, props changed)
Modified:
  head/etc/mtree/BSD.root.dist
  head/sbin/Makefile

Modified: head/etc/mtree/BSD.root.dist
==
--- head/etc/mtree/BSD.root.distFri Mar 18 12:13:04 2011
(r219737)
+++ head/etc/mtree/BSD.root.distFri Mar 18 12:18:52 2011
(r219738)
@@ -72,6 +72,8 @@
 ..
 ..
 libexec
+resolvconf
+..
 ..
 media
 ..

Modified: head/sbin/Makefile
==
--- head/sbin/Makefile  Fri Mar 18 12:13:04 2011(r219737)
+++ head/sbin/Makefile  Fri Mar 18 12:18:52 2011(r219738)
@@ -62,6 +62,7 @@ SUBDIR=adjkerntz \
rcorder \
reboot \
recoverdisk \
+   resolvconf \
restore \
route \
savecore \

Added: head/sbin/resolvconf/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sbin/resolvconf/Makefile   Fri Mar 18 12:18:52 2011
(r219738)
@@ -0,0 +1,37 @@
+# $FreeBSD$
+
+DIST=  ${.CURDIR}/../../contrib/openresolv
+.PATH: ${DIST}
+
+SCRIPTS=   resolvconf
+
+FILES= libc dnsmasq named pdnsd unbound
+FILESDIR=  /libexec/resolvconf
+
+MAN=   resolvconf.conf.5 resolvconf.8
+
+CLEANFILES=${SCRIPTS} ${FILES} ${MAN}
+
+SYSCONFDIR=/etc
+RCDIR= ${SYSCONFDIR}/rc.d
+VARDIR=/var/run/resolvconf
+
+# We don't assume to restart the services in /sbin.  So, though
+# our service(8) is in /usr/sbin, we can use it, here.
+CMD1=  \1 onestatus >/dev/null 2>\&1
+CMD2=  \1 restart
+RESTARTCMD=/usr/sbin/service ${CMD1} \&\& /usr/sbin/service ${CMD2}
+
+.for f in ${SCRIPTS} ${FILES} ${MAN}
+${f}:  ${f}.in
+   sed -e 's:@PREFIX@::g' \
+   -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' \
+   -e 's:@LIBEXECDIR@:${FILESDIR}:g' \
+   -e 's:@VARDIR@:${VARDIR}:g' \
+   -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g' \
+   -e 's:@RCDIR@:${RCDIR}:g' \
+   -e 's: vpn : ng[0-9]*&:g' \
+   ${DIST}/$@.in > $@
+.endfor
+
+.include 
___
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-unsubscr...@freebsd.org"


svn commit: r219739 - head/sbin/dhclient

2011-03-18 Thread Hajimu UMEMOTO
Author: ume
Date: Fri Mar 18 12:23:20 2011
New Revision: 219739
URL: http://svn.freebsd.org/changeset/base/219739

Log:
  Use resolvconf(8) to update /etc/resolv.conf.
  If you don't want to use resolvconf(8) to update /etc/resolv.conf,
  you can put resolvconf_enable="NO" into /etc/dhclient-enter-hooks.

Modified:
  head/sbin/dhclient/dhclient-script

Modified: head/sbin/dhclient/dhclient-script
==
--- head/sbin/dhclient/dhclient-script  Fri Mar 18 12:18:52 2011
(r219738)
+++ head/sbin/dhclient/dhclient-script  Fri Mar 18 12:23:20 2011
(r219739)
@@ -216,29 +216,40 @@ add_new_resolv_conf() {
cat /etc/resolv.conf.tail >>$tmpres
fi
 
-   # When resolv.conf is not changed actually, we don't
-   # need to update it.
-   # If /usr is not mounted yet, we cannot use cmp, then
-   # the following test fails.  In such case, we simply
-   # ignore an error and do update resolv.conf.
-   if cmp -s $tmpres /etc/resolv.conf; then
-   rm -f $tmpres
-   return 0
-   fi 2>/dev/null
-
-   # In case (e.g. during OpenBSD installs) /etc/resolv.conf
-   # is a symbolic link, take care to preserve the link and write
-   # the new data in the correct location.
+   case $resolvconf_enable in
+   # "no", "false", "off", or "0"
+   [Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
+   # When resolv.conf is not changed actually, we don't
+   # need to update it.
+   # If /usr is not mounted yet, we cannot use cmp, then
+   # the following test fails.  In such case, we simply
+   # ignore an error and do update resolv.conf.
+   if cmp -s $tmpres /etc/resolv.conf; then
+   rm -f $tmpres
+   return 0
+   fi 2>/dev/null
+
+   # In case (e.g. during OpenBSD installs)
+   # /etc/resolv.conf is a symbolic link, take
+   # care to preserve the link and write the new
+   # data in the correct location.
 
-   if [ -f /etc/resolv.conf ]; then
-   cat /etc/resolv.conf > /etc/resolv.conf.save
-   fi
-   cat $tmpres > /etc/resolv.conf
-   rm -f $tmpres
+   if [ -f /etc/resolv.conf ]; then
+   cat /etc/resolv.conf > /etc/resolv.conf.save
+   fi
+   cat $tmpres > /etc/resolv.conf
+
+   # Try to ensure correct ownership and permissions.
+   chown -RL root:wheel /etc/resolv.conf
+   chmod -RL 644 /etc/resolv.conf
+   ;;
 
-   # Try to ensure correct ownership and permissions.
-   chown -RL root:wheel /etc/resolv.conf
-   chmod -RL 644 /etc/resolv.conf
+   *)
+   /sbin/resolvconf -a ${interface} < $tmpres
+   ;;
+   esac
+
+   rm -f $tmpres
 
return 0
fi
@@ -296,6 +307,8 @@ if [ -f /etc/dhclient-enter-hooks ]; the
fi
 fi
 
+: ${resolvconf_enable="YES"}
+
 case $reason in
 MEDIUM)
eval "$IFCONFIG $interface $medium"
@@ -349,9 +362,17 @@ EXPIRE|FAIL)
# XXX Why add alias we just deleted above?
add_new_alias
if is_default_interface; then
-   if [ -f /etc/resolv.conf.save ]; then
-   cat /etc/resolv.conf.save > /etc/resolv.conf
-   fi
+   case $resolvconf_enable in
+   # "no", "false", "off", or "0"
+   [Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
+   if [ -f /etc/resolv.conf.save ]; then
+   cat /etc/resolv.conf.save > /etc/resolv.conf
+   fi
+   ;;
+   *)
+   /sbin/resolvconf -d ${interface}
+   ;;
+   esac
fi
;;
 
___
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-unsubscr...@freebsd.org"


svn commit: r220055 - head/usr.bin/su

2011-03-27 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Mar 27 12:53:20 2011
New Revision: 220055
URL: http://svn.freebsd.org/changeset/base/220055

Log:
  getpwnam(3) may return NULL.
  
  Requested by:   nork
  Reviewed by:Takeharu KATO , nork
  MFC after:  1 week

Modified:
  head/usr.bin/su/su.c

Modified: head/usr.bin/su/su.c
==
--- head/usr.bin/su/su.cSun Mar 27 10:35:39 2011(r220054)
+++ head/usr.bin/su/su.cSun Mar 27 12:53:20 2011(r220055)
@@ -149,7 +149,7 @@ int
 main(int argc, char *argv[])
 {
static char *cleanenv;
-   struct passwd   *pwd;
+   struct passwd   *pwd = NULL;
struct pam_conv conv = { openpam_ttyconv, NULL };
enum tristate   iscsh;
login_cap_t *lc;
@@ -255,8 +255,9 @@ main(int argc, char *argv[])
/* get current login name, real uid and shell */
ruid = getuid();
username = getlogin();
-   pwd = getpwnam(username);
-   if (username == NULL || pwd == NULL || pwd->pw_uid != ruid)
+   if (username != NULL)
+   pwd = getpwnam(username);
+   if (pwd == NULL || pwd->pw_uid != ruid)
pwd = getpwuid(ruid);
if (pwd == NULL) {
 #ifdef USE_BSM_AUDIT
___
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-unsubscr...@freebsd.org"


svn commit: r220326 - stable/8/usr.bin/su

2011-04-04 Thread Hajimu UMEMOTO
Author: ume
Date: Mon Apr  4 14:54:52 2011
New Revision: 220326
URL: http://svn.freebsd.org/changeset/base/220326

Log:
  MFC r220055: getlogin() may return NULL.

Modified:
  stable/8/usr.bin/su/su.c
Directory Properties:
  stable/8/usr.bin/su/   (props changed)

Modified: stable/8/usr.bin/su/su.c
==
--- stable/8/usr.bin/su/su.cMon Apr  4 14:53:36 2011(r220325)
+++ stable/8/usr.bin/su/su.cMon Apr  4 14:54:52 2011(r220326)
@@ -153,7 +153,7 @@ int
 main(int argc, char *argv[])
 {
static char *cleanenv;
-   struct passwd   *pwd;
+   struct passwd   *pwd = NULL;
struct pam_conv conv = { openpam_ttyconv, NULL };
enum tristate   iscsh;
login_cap_t *lc;
@@ -259,8 +259,9 @@ main(int argc, char *argv[])
/* get current login name, real uid and shell */
ruid = getuid();
username = getlogin();
-   pwd = getpwnam(username);
-   if (username == NULL || pwd == NULL || pwd->pw_uid != ruid)
+   if (username != NULL)
+   pwd = getpwnam(username);
+   if (pwd == NULL || pwd->pw_uid != ruid)
pwd = getpwuid(ruid);
if (pwd == NULL) {
 #ifdef USE_BSM_AUDIT
___
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-unsubscr...@freebsd.org"


svn commit: r220327 - stable/7/usr.bin/su

2011-04-04 Thread Hajimu UMEMOTO
Author: ume
Date: Mon Apr  4 14:57:28 2011
New Revision: 220327
URL: http://svn.freebsd.org/changeset/base/220327

Log:
  MFC r220055: getlogin() may return NULL.

Modified:
  stable/7/usr.bin/su/su.c
Directory Properties:
  stable/7/usr.bin/su/   (props changed)

Modified: stable/7/usr.bin/su/su.c
==
--- stable/7/usr.bin/su/su.cMon Apr  4 14:54:52 2011(r220326)
+++ stable/7/usr.bin/su/su.cMon Apr  4 14:57:28 2011(r220327)
@@ -153,7 +153,7 @@ int
 main(int argc, char *argv[])
 {
static char *cleanenv;
-   struct passwd   *pwd;
+   struct passwd   *pwd = NULL;
struct pam_conv conv = { openpam_ttyconv, NULL };
enum tristate   iscsh;
login_cap_t *lc;
@@ -258,8 +258,9 @@ main(int argc, char *argv[])
/* get current login name, real uid and shell */
ruid = getuid();
username = getlogin();
-   pwd = getpwnam(username);
-   if (username == NULL || pwd == NULL || pwd->pw_uid != ruid)
+   if (username != NULL)
+   pwd = getpwnam(username);
+   if (pwd == NULL || pwd->pw_uid != ruid)
pwd = getpwuid(ruid);
if (pwd == NULL) {
 #ifdef USE_BSM_AUDIT
___
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-unsubscr...@freebsd.org"


svn commit: r221297 - head/contrib/openresolv

2011-05-01 Thread Hajimu UMEMOTO
Author: ume
Date: Sun May  1 15:46:18 2011
New Revision: 221297
URL: http://svn.freebsd.org/changeset/base/221297

Log:
  Fix typo in manpage resolvconf.conf(5).
  
  PR:   docs/156494
  Submitted by: bcr
  Requested by: bcr
  Obtained from:http://roy.marples.name/projects/openresolv/ticket/12

Modified:
  head/contrib/openresolv/resolvconf.conf.5.in

Modified: head/contrib/openresolv/resolvconf.conf.5.in
==
--- head/contrib/openresolv/resolvconf.conf.5.inSun May  1 13:26:34 
2011(r221296)
+++ head/contrib/openresolv/resolvconf.conf.5.inSun May  1 15:46:18 
2011(r221297)
@@ -43,7 +43,7 @@ Listed below are the standard
 .Nm
 variables that may be set.
 .Pp
-After updaing this file, you may wish to run
+After updating this file, you may wish to run
 .Nm resolvconf -u
 to apply the new configuration.
 .Sh RESOLVCONF OPTIONS
___
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-unsubscr...@freebsd.org"


svn commit: r190382 - head/lib/libc/net

2009-03-24 Thread Hajimu UMEMOTO
Author: ume
Date: Tue Mar 24 17:47:24 2009
New Revision: 190382
URL: http://svn.freebsd.org/changeset/base/190382

Log:
  getaddrinfo(3) should accept numeric when ai_socktype is not
  specified in hint or hints is NULL.
  
  PR:   bin/51827
  Submitted by: Mark Andrews 
  MFC after:1 week

Modified:
  head/lib/libc/net/getaddrinfo.c

Modified: head/lib/libc/net/getaddrinfo.c
==
--- head/lib/libc/net/getaddrinfo.c Tue Mar 24 17:22:10 2009
(r190381)
+++ head/lib/libc/net/getaddrinfo.c Tue Mar 24 17:47:24 2009
(r190382)
@@ -1347,7 +1347,17 @@ get_port(struct addrinfo *ai, const char
allownumeric = 1;
break;
case ANY:
-   allownumeric = 0;
+   switch (ai->ai_family) {
+   case AF_INET:
+#ifdef AF_INET6
+   case AF_INET6:
+#endif
+   allownumeric = 1;
+   break;
+   default:
+   allownumeric = 0;
+   break;
+   }
break;
default:
return EAI_SOCKTYPE;
___
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-unsubscr...@freebsd.org"


svn commit: r190416 - head/lib/libc/net

2009-03-25 Thread Hajimu UMEMOTO
Author: ume
Date: Wed Mar 25 16:23:43 2009
New Revision: 190416
URL: http://svn.freebsd.org/changeset/base/190416

Log:
  Add support for SCTP to getaddrinfo(3).
  Now, getaddrinfo(3) returns two SOCK_STREAMs, IPPROTO_TCP and
  IPPROTO_SCTP.  It confuses some programs.  If getaddrinfo(3) returns
  IPPROTO_SCTP when SOCK_STREAM is specified by hints.ai_socktype, at
  least Apache doesn't work.  So, I made getaddrinfo(3) to return
  IPPROTO_SCTP with SOCK_STREAM only when IPPROTO_SCTP is specified
  explicitly by hints.ai_protocol.
  
  PR:   bin/128167
  Submitted by: Bruce Cran  (partly)
  MFC after:2 week

Modified:
  head/lib/libc/net/getaddrinfo.c

Modified: head/lib/libc/net/getaddrinfo.c
==
--- head/lib/libc/net/getaddrinfo.c Wed Mar 25 15:42:07 2009
(r190415)
+++ head/lib/libc/net/getaddrinfo.c Wed Mar 25 16:23:43 2009
(r190416)
@@ -165,18 +165,24 @@ struct explore {
 
 static const struct explore explore[] = {
 #if 0
-   { PF_LOCAL, 0, ANY, ANY, NULL, 0x01 },
+   { PF_LOCAL, ANY, ANY, NULL, 0x01 },
 #endif
 #ifdef INET6
{ PF_INET6, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 },
{ PF_INET6, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 },
+   { PF_INET6, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x03 },
+   { PF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 },
{ PF_INET6, SOCK_RAW, ANY, NULL, 0x05 },
 #endif
{ PF_INET, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 },
{ PF_INET, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 },
+   { PF_INET, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x03 },
+   { PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 },
{ PF_INET, SOCK_RAW, ANY, NULL, 0x05 },
{ PF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 },
{ PF_UNSPEC, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 },
+   { PF_UNSPEC, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x03 },
+   { PF_UNSPEC, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 },
{ PF_UNSPEC, SOCK_RAW, ANY, NULL, 0x05 },
{ -1, 0, 0, NULL, 0 },
 };
@@ -417,10 +423,12 @@ getaddrinfo(const char *hostname, const 
if (ex->e_protocol == ANY)
continue;
if (pai->ai_socktype == ex->e_socktype &&
-   pai->ai_protocol != ex->e_protocol) {
-   ERR(EAI_BADHINTS);
-   }
+   pai->ai_protocol == ex->e_protocol)
+   break;
}
+
+   if (ex->e_af < 0)
+   ERR(EAI_BADHINTS);
}
}
 
@@ -1344,6 +1352,7 @@ get_port(struct addrinfo *ai, const char
return EAI_SERVICE;
case SOCK_DGRAM:
case SOCK_STREAM:
+   case SOCK_SEQPACKET:
allownumeric = 1;
break;
case ANY:
@@ -1373,13 +1382,17 @@ get_port(struct addrinfo *ai, const char
} else {
if (ai->ai_flags & AI_NUMERICSERV)
return EAI_NONAME;
-   switch (ai->ai_socktype) {
-   case SOCK_DGRAM:
+
+   switch (ai->ai_protocol) {
+   case IPPROTO_UDP:
proto = "udp";
break;
-   case SOCK_STREAM:
+   case IPPROTO_TCP:
proto = "tcp";
break;
+   case IPPROTO_SCTP:
+   proto = "sctp";
+   break;
default:
proto = NULL;
break;
___
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-unsubscr...@freebsd.org"


svn commit: r190525 - head/lib/libc/net

2009-03-29 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Mar 29 17:55:11 2009
New Revision: 190525
URL: http://svn.freebsd.org/changeset/base/190525

Log:
  Query DNS only once per an address family.
  
  Obtained from:KAME
  MFC after:2 weeks

Modified:
  head/lib/libc/net/getaddrinfo.c

Modified: head/lib/libc/net/getaddrinfo.c
==
--- head/lib/libc/net/getaddrinfo.c Sun Mar 29 17:45:48 2009
(r190524)
+++ head/lib/libc/net/getaddrinfo.c Sun Mar 29 17:55:11 2009
(r190525)
@@ -102,7 +102,6 @@ __FBSDID("$FreeBSD$");
 # define FAITH
 #endif
 
-#define SUCCESS 0
 #define ANY 0
 #define YES 1
 #define NO  0
@@ -179,11 +178,6 @@ static const struct explore explore[] = 
{ PF_INET, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x03 },
{ PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 },
{ PF_INET, SOCK_RAW, ANY, NULL, 0x05 },
-   { PF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 },
-   { PF_UNSPEC, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 },
-   { PF_UNSPEC, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x03 },
-   { PF_UNSPEC, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 },
-   { PF_UNSPEC, SOCK_RAW, ANY, NULL, 0x05 },
{ -1, 0, 0, NULL, 0 },
 };
 
@@ -233,6 +227,8 @@ typedef union {
 } querybuf;
 
 static int str2number(const char *, int *);
+static int explore_copy(const struct addrinfo *, const struct addrinfo *,
+   struct addrinfo **);
 static int explore_null(const struct addrinfo *,
const char *, struct addrinfo **);
 static int explore_numeric(const struct addrinfo *, const char *,
@@ -243,6 +239,7 @@ static int get_canonname(const struct ad
struct addrinfo *, const char *);
 static struct addrinfo *get_ai(const struct addrinfo *,
const struct afd *, const char *);
+static struct addrinfo *copy_ai(const struct addrinfo *);
 static int get_portmatch(const struct addrinfo *, const char *);
 static int get_port(struct addrinfo *, const char *, int);
 static const struct afd *find_afd(int);
@@ -371,12 +368,23 @@ getaddrinfo(const char *hostname, const 
struct addrinfo sentinel;
struct addrinfo *cur;
int error = 0;
-   struct addrinfo ai;
-   struct addrinfo ai0;
+   struct addrinfo ai, ai0, *afai;
struct addrinfo *pai;
+   const struct afd *afd;
const struct explore *ex;
+   struct addrinfo *afailist[sizeof(afdl)/sizeof(afdl[0])];
+   struct addrinfo *afai_unspec;
+   int found;
int numeric = 0;
 
+   /* ensure we return NULL on errors */
+   *res = NULL;
+
+   memset(&ai, 0, sizeof(ai));
+
+   memset(afailist, 0, sizeof(afailist));
+   afai_unspec = NULL;
+
memset(&sentinel, 0, sizeof(sentinel));
cur = &sentinel;
pai = &ai;
@@ -416,15 +424,18 @@ getaddrinfo(const char *hostname, const 
 */
if (pai->ai_socktype != ANY && pai->ai_protocol != ANY) {
for (ex = explore; ex->e_af >= 0; ex++) {
-   if (pai->ai_family != ex->e_af)
+   if (!MATCH_FAMILY(pai->ai_family, ex->e_af,
+   WILD_AF(ex)))
continue;
-   if (ex->e_socktype == ANY)
+   if (!MATCH(pai->ai_socktype, ex->e_socktype,
+   WILD_SOCKTYPE(ex)))
continue;
-   if (ex->e_protocol == ANY)
+   if (!MATCH(pai->ai_protocol, ex->e_protocol,
+   WILD_PROTOCOL(ex)))
continue;
-   if (pai->ai_socktype == ex->e_socktype &&
-   pai->ai_protocol == ex->e_protocol)
-   break;
+
+   /* matched */
+   break;
}
 
if (ex->e_af < 0)
@@ -460,49 +471,48 @@ getaddrinfo(const char *hostname, const 
 
ai0 = *pai;
 
-   /* NULL hostname, or numeric hostname */
-   for (ex = explore; ex->e_af >= 0; ex++) {
+   /*
+* NULL hostname, or numeric hostname.
+* If numeric representation of AF1 can be interpreted as FQDN
+* representation of AF2, we need to think again about the code below.
+*/
+   found = 0;
+   for (afd = afdl; afd->a_af; afd++) {
*pai = ai0;
 
-   /* PF_UNSPEC entries are prepared for DNS queries only */
-   if (ex->e_af == PF_UNSPEC)
-   continue;
-
-   if (!MATCH_FAMILY(pai->ai_family, ex->e_af, WILD_AF(ex)))
-   continue;
-   if (!MATCH(pai->ai_socktype, ex->e_socktype, WILD_SOCKTYPE(ex)))
-   continue;
-

svn commit: r190972 - in stable/7/lib/libc: . net string

2009-04-12 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Apr 12 19:06:41 2009
New Revision: 190972
URL: http://svn.freebsd.org/changeset/base/190972

Log:
  MFH r190382,190416,190525:
  - getaddrinfo(3) should accept numeric when ai_socktype is not
specified in hint or hints is NULL.
  - Add support for SCTP to getaddrinfo(3).
Now, getaddrinfo(3) returns two SOCK_STREAMs, IPPROTO_TCP and
IPPROTO_SCTP.  It confuses some programs.  If getaddrinfo(3) returns
IPPROTO_SCTP when SOCK_STREAM is specified by hints.ai_socktype, at
least Apache doesn't work.  So, I made getaddrinfo(3) to return
IPPROTO_SCTP with SOCK_STREAM only when IPPROTO_SCTP is specified
explicitly by hints.ai_protocol.
  - Query DNS only once per an address family.
  
  Approved by:  re (kib)

Modified:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/net/getaddrinfo.c
  stable/7/lib/libc/string/ffsll.c   (props changed)
  stable/7/lib/libc/string/flsll.c   (props changed)

Modified: stable/7/lib/libc/net/getaddrinfo.c
==
--- stable/7/lib/libc/net/getaddrinfo.c Sun Apr 12 19:04:27 2009
(r190971)
+++ stable/7/lib/libc/net/getaddrinfo.c Sun Apr 12 19:06:41 2009
(r190972)
@@ -102,7 +102,6 @@ __FBSDID("$FreeBSD$");
 # define FAITH
 #endif
 
-#define SUCCESS 0
 #define ANY 0
 #define YES 1
 #define NO  0
@@ -165,19 +164,20 @@ struct explore {
 
 static const struct explore explore[] = {
 #if 0
-   { PF_LOCAL, 0, ANY, ANY, NULL, 0x01 },
+   { PF_LOCAL, ANY, ANY, NULL, 0x01 },
 #endif
 #ifdef INET6
{ PF_INET6, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 },
{ PF_INET6, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 },
+   { PF_INET6, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x03 },
+   { PF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 },
{ PF_INET6, SOCK_RAW, ANY, NULL, 0x05 },
 #endif
{ PF_INET, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 },
{ PF_INET, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 },
+   { PF_INET, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x03 },
+   { PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 },
{ PF_INET, SOCK_RAW, ANY, NULL, 0x05 },
-   { PF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 },
-   { PF_UNSPEC, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 },
-   { PF_UNSPEC, SOCK_RAW, ANY, NULL, 0x05 },
{ -1, 0, 0, NULL, 0 },
 };
 
@@ -227,6 +227,8 @@ typedef union {
 } querybuf;
 
 static int str2number(const char *, int *);
+static int explore_copy(const struct addrinfo *, const struct addrinfo *,
+   struct addrinfo **);
 static int explore_null(const struct addrinfo *,
const char *, struct addrinfo **);
 static int explore_numeric(const struct addrinfo *, const char *,
@@ -237,6 +239,7 @@ static int get_canonname(const struct ad
struct addrinfo *, const char *);
 static struct addrinfo *get_ai(const struct addrinfo *,
const struct afd *, const char *);
+static struct addrinfo *copy_ai(const struct addrinfo *);
 static int get_portmatch(const struct addrinfo *, const char *);
 static int get_port(struct addrinfo *, const char *, int);
 static const struct afd *find_afd(int);
@@ -365,12 +368,23 @@ getaddrinfo(const char *hostname, const 
struct addrinfo sentinel;
struct addrinfo *cur;
int error = 0;
-   struct addrinfo ai;
-   struct addrinfo ai0;
+   struct addrinfo ai, ai0, *afai;
struct addrinfo *pai;
+   const struct afd *afd;
const struct explore *ex;
+   struct addrinfo *afailist[sizeof(afdl)/sizeof(afdl[0])];
+   struct addrinfo *afai_unspec;
+   int found;
int numeric = 0;
 
+   /* ensure we return NULL on errors */
+   *res = NULL;
+
+   memset(&ai, 0, sizeof(ai));
+
+   memset(afailist, 0, sizeof(afailist));
+   afai_unspec = NULL;
+
memset(&sentinel, 0, sizeof(sentinel));
cur = &sentinel;
pai = &ai;
@@ -410,17 +424,22 @@ getaddrinfo(const char *hostname, const 
 */
if (pai->ai_socktype != ANY && pai->ai_protocol != ANY) {
for (ex = explore; ex->e_af >= 0; ex++) {
-   if (pai->ai_family != ex->e_af)
+   if (!MATCH_FAMILY(pai->ai_family, ex->e_af,
+   WILD_AF(ex)))
continue;
-   if (ex->e_socktype == ANY)
+   if (!MATCH(pai->ai_socktype, ex->e_socktype,
+   WILD_SOCKTYPE(ex)))
continue;
-   if (ex->e_protocol == ANY)
+   if (!MATCH(pai->ai_protocol, ex->e_protocol,
+   WILD_PROTOCOL(ex)))
continue;
-   if (pai->ai_socktype == ex->e_socktype &&
-

svn commit: r229766 - in head: lib/libc/net sbin/route

2012-01-07 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Jan  7 09:01:19 2012
New Revision: 229766
URL: http://svn.freebsd.org/changeset/base/229766

Log:
  Handle the internal scope address representation of the KAME IPv6
  stack for the node-local multicast address.
  
  Spotted by:   Rainer Bredehorn 
  MFC after:1 week

Modified:
  head/lib/libc/net/getaddrinfo.c
  head/sbin/route/route.c

Modified: head/lib/libc/net/getaddrinfo.c
==
--- head/lib/libc/net/getaddrinfo.c Sat Jan  7 04:13:25 2012
(r229765)
+++ head/lib/libc/net/getaddrinfo.c Sat Jan  7 09:01:19 2012
(r229766)
@@ -1576,7 +1576,8 @@ ip6_str2scopeid(char *scope, struct sock
if (*scope == '\0')
return -1;
 
-   if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6)) {
+   if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6) ||
+   IN6_IS_ADDR_MC_NODELOCAL(a6)) {
/*
 * We currently assume a one-to-one mapping between links
 * and interfaces, so we simply use interface indices for

Modified: head/sbin/route/route.c
==
--- head/sbin/route/route.c Sat Jan  7 04:13:25 2012(r229765)
+++ head/sbin/route/route.c Sat Jan  7 09:01:19 2012(r229766)
@@ -375,7 +375,8 @@ routename(struct sockaddr *sa)
 #ifdef __KAME__
if (sa->sa_len == sizeof(struct sockaddr_in6) &&
(IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr) ||
-IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr)) &&
+IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr) ||
+IN6_IS_ADDR_MC_NODELOCAL(&sin6.sin6_addr)) &&
sin6.sin6_scope_id == 0) {
sin6.sin6_scope_id =
ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]);
@@ -500,7 +501,8 @@ netname(struct sockaddr *sa)
 #ifdef __KAME__
if (sa->sa_len == sizeof(struct sockaddr_in6) &&
(IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr) ||
-IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr)) &&
+IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr) ||
+IN6_IS_ADDR_MC_NODELOCAL(&sin6.sin6_addr)) &&
sin6.sin6_scope_id == 0) {
sin6.sin6_scope_id =
ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]);
@@ -1002,7 +1004,8 @@ getaddr(int which, char *str, struct hos
memcpy(&su->sin6, res->ai_addr, sizeof(su->sin6));
 #ifdef __KAME__
if ((IN6_IS_ADDR_LINKLOCAL(&su->sin6.sin6_addr) ||
-IN6_IS_ADDR_MC_LINKLOCAL(&su->sin6.sin6_addr)) &&
+IN6_IS_ADDR_MC_LINKLOCAL(&su->sin6.sin6_addr) ||
+IN6_IS_ADDR_MC_NODELOCAL(&su->sin6.sin6_addr)) &&
su->sin6.sin6_scope_id) {
*(u_int16_t *)&su->sin6.sin6_addr.s6_addr[2] =
htons(su->sin6.sin6_scope_id);
___
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-unsubscr...@freebsd.org"


svn commit: r230111 - in stable/9: lib/libc/net sbin/route

2012-01-14 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Jan 14 19:08:39 2012
New Revision: 230111
URL: http://svn.freebsd.org/changeset/base/230111

Log:
  MFC r229766:
Handle the internal scope address representation of the KAME IPv6
stack for the node-local multicast address.

Modified:
  stable/9/lib/libc/net/getaddrinfo.c
  stable/9/sbin/route/route.c
Directory Properties:
  stable/9/lib/libc/   (props changed)
  stable/9/sbin/route/   (props changed)

Modified: stable/9/lib/libc/net/getaddrinfo.c
==
--- stable/9/lib/libc/net/getaddrinfo.c Sat Jan 14 18:16:10 2012
(r230110)
+++ stable/9/lib/libc/net/getaddrinfo.c Sat Jan 14 19:08:39 2012
(r230111)
@@ -1576,7 +1576,8 @@ ip6_str2scopeid(char *scope, struct sock
if (*scope == '\0')
return -1;
 
-   if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6)) {
+   if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6) ||
+   IN6_IS_ADDR_MC_NODELOCAL(a6)) {
/*
 * We currently assume a one-to-one mapping between links
 * and interfaces, so we simply use interface indices for

Modified: stable/9/sbin/route/route.c
==
--- stable/9/sbin/route/route.c Sat Jan 14 18:16:10 2012(r230110)
+++ stable/9/sbin/route/route.c Sat Jan 14 19:08:39 2012(r230111)
@@ -375,7 +375,8 @@ routename(struct sockaddr *sa)
 #ifdef __KAME__
if (sa->sa_len == sizeof(struct sockaddr_in6) &&
(IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr) ||
-IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr)) &&
+IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr) ||
+IN6_IS_ADDR_MC_NODELOCAL(&sin6.sin6_addr)) &&
sin6.sin6_scope_id == 0) {
sin6.sin6_scope_id =
ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]);
@@ -500,7 +501,8 @@ netname(struct sockaddr *sa)
 #ifdef __KAME__
if (sa->sa_len == sizeof(struct sockaddr_in6) &&
(IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr) ||
-IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr)) &&
+IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr) ||
+IN6_IS_ADDR_MC_NODELOCAL(&sin6.sin6_addr)) &&
sin6.sin6_scope_id == 0) {
sin6.sin6_scope_id =
ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]);
@@ -1002,7 +1004,8 @@ getaddr(int which, char *str, struct hos
memcpy(&su->sin6, res->ai_addr, sizeof(su->sin6));
 #ifdef __KAME__
if ((IN6_IS_ADDR_LINKLOCAL(&su->sin6.sin6_addr) ||
-IN6_IS_ADDR_MC_LINKLOCAL(&su->sin6.sin6_addr)) &&
+IN6_IS_ADDR_MC_LINKLOCAL(&su->sin6.sin6_addr) ||
+IN6_IS_ADDR_MC_NODELOCAL(&su->sin6.sin6_addr)) &&
su->sin6.sin6_scope_id) {
*(u_int16_t *)&su->sin6.sin6_addr.s6_addr[2] =
htons(su->sin6.sin6_scope_id);
___
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-unsubscr...@freebsd.org"


svn commit: r230112 - in stable/8: lib/libc/net sbin/route

2012-01-14 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Jan 14 19:22:45 2012
New Revision: 230112
URL: http://svn.freebsd.org/changeset/base/230112

Log:
  MFC r229766:
Handle the internal scope address representation of the KAME IPv6
stack for the node-local multicast address.

Modified:
  stable/8/lib/libc/net/getaddrinfo.c
  stable/8/sbin/route/route.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/sbin/route/   (props changed)

Modified: stable/8/lib/libc/net/getaddrinfo.c
==
--- stable/8/lib/libc/net/getaddrinfo.c Sat Jan 14 19:08:39 2012
(r230111)
+++ stable/8/lib/libc/net/getaddrinfo.c Sat Jan 14 19:22:45 2012
(r230112)
@@ -1576,7 +1576,8 @@ ip6_str2scopeid(char *scope, struct sock
if (*scope == '\0')
return -1;
 
-   if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6)) {
+   if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6) ||
+   IN6_IS_ADDR_MC_NODELOCAL(a6)) {
/*
 * We currently assume a one-to-one mapping between links
 * and interfaces, so we simply use interface indices for

Modified: stable/8/sbin/route/route.c
==
--- stable/8/sbin/route/route.c Sat Jan 14 19:08:39 2012(r230111)
+++ stable/8/sbin/route/route.c Sat Jan 14 19:22:45 2012(r230112)
@@ -375,7 +375,8 @@ routename(struct sockaddr *sa)
 #ifdef __KAME__
if (sa->sa_len == sizeof(struct sockaddr_in6) &&
(IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr) ||
-IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr)) &&
+IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr) ||
+IN6_IS_ADDR_MC_NODELOCAL(&sin6.sin6_addr)) &&
sin6.sin6_scope_id == 0) {
sin6.sin6_scope_id =
ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]);
@@ -500,7 +501,8 @@ netname(struct sockaddr *sa)
 #ifdef __KAME__
if (sa->sa_len == sizeof(struct sockaddr_in6) &&
(IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr) ||
-IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr)) &&
+IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr) ||
+IN6_IS_ADDR_MC_NODELOCAL(&sin6.sin6_addr)) &&
sin6.sin6_scope_id == 0) {
sin6.sin6_scope_id =
ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]);
@@ -1002,7 +1004,8 @@ getaddr(int which, char *str, struct hos
memcpy(&su->sin6, res->ai_addr, sizeof(su->sin6));
 #ifdef __KAME__
if ((IN6_IS_ADDR_LINKLOCAL(&su->sin6.sin6_addr) ||
-IN6_IS_ADDR_MC_LINKLOCAL(&su->sin6.sin6_addr)) &&
+IN6_IS_ADDR_MC_LINKLOCAL(&su->sin6.sin6_addr) ||
+IN6_IS_ADDR_MC_NODELOCAL(&su->sin6.sin6_addr)) &&
su->sin6.sin6_scope_id) {
*(u_int16_t *)&su->sin6.sin6_addr.s6_addr[2] =
htons(su->sin6.sin6_scope_id);
___
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-unsubscr...@freebsd.org"


svn commit: r230113 - in stable/9/kerberos5: . lib/libhdb

2012-01-14 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Jan 14 19:38:24 2012
New Revision: 230113
URL: http://svn.freebsd.org/changeset/base/230113

Log:
  MFC r228284, r228308:
- Make heimdal buildable with WITH_OPENLDAP defined, again.
- Our heimdal uses the deprecated OpenLDAP functions.
- Don't support OpenLDAP during lib32 build.

Modified:
  stable/9/kerberos5/Makefile.inc
  stable/9/kerberos5/lib/libhdb/Makefile
Directory Properties:
  stable/9/kerberos5/   (props changed)

Modified: stable/9/kerberos5/Makefile.inc
==
--- stable/9/kerberos5/Makefile.inc Sat Jan 14 19:22:45 2012
(r230112)
+++ stable/9/kerberos5/Makefile.inc Sat Jan 14 19:38:24 2012
(r230113)
@@ -6,11 +6,11 @@ KRB5DIR=  ${.CURDIR}/../../../crypto/heim
 
 CFLAGS+=   -DHAVE_CONFIG_H -I${.CURDIR}/../../include
 
-.if defined(WITH_OPENLDAP)
+.if defined(WITH_OPENLDAP) && !defined(COMPAT_32BIT)
 OPENLDAPBASE?= /usr/local
 LDAPLDADD= -lldap -llber
 LDAPDPADD= ${LDAPLDADD:C;^-l(.*)$;${OPENLDAPBASE}/lib/lib\1.a;}
-LDAPCFLAGS=-I${OPENLDAPBASE}/include -DOPENLDAP=1
+LDAPCFLAGS=-I${OPENLDAPBASE}/include -DOPENLDAP=1 -DLDAP_DEPRECATED=1
 LDAPLDFLAGS=   -L${OPENLDAPBASE}/lib -Wl,-rpath,${OPENLDAPBASE}/lib
 .endif
 

Modified: stable/9/kerberos5/lib/libhdb/Makefile
==
--- stable/9/kerberos5/lib/libhdb/Makefile  Sat Jan 14 19:22:45 2012
(r230112)
+++ stable/9/kerberos5/lib/libhdb/Makefile  Sat Jan 14 19:38:24 2012
(r230113)
@@ -1,9 +1,9 @@
 # $FreeBSD$
 
 LIB=   hdb
-LDFLAGS=   -Wl,--no-undefined
-LDADD= -lasn1 -lcom_err -lkrb5 -lroken
-DPADD= ${LIBASN1} ${LIBCOM_ERR} ${LIBKRB5} ${LIBROKEN}
+LDFLAGS=   -Wl,--no-undefined ${LDAPLDFLAGS}
+LDADD= -lasn1 -lcom_err -lkrb5 -lroken ${LDAPLDADD}
+DPADD= ${LIBASN1} ${LIBCOM_ERR} ${LIBKRB5} ${LIBROKEN} ${LDAPDPADD}
 
 INCS=  hdb-private.h \
hdb-protos.h \
___
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-unsubscr...@freebsd.org"


svn commit: r243649 - head/contrib/sendmail/src

2012-11-28 Thread Hajimu UMEMOTO
Author: ume
Date: Wed Nov 28 11:47:47 2012
New Revision: 243649
URL: http://svnweb.freebsd.org/changeset/base/243649

Log:
  cyrus-sasl 2.1.26 was released.  In this version, the type of callback
  functions was changed from "unsigned long" to "size_t".
  
  Reviewed by:  gshapiro
  MFC after:3 days

Modified:
  head/contrib/sendmail/src/sasl.c

Modified: head/contrib/sendmail/src/sasl.c
==
--- head/contrib/sendmail/src/sasl.cWed Nov 28 07:12:08 2012
(r243648)
+++ head/contrib/sendmail/src/sasl.cWed Nov 28 11:47:47 2012
(r243649)
@@ -24,9 +24,15 @@ SM_RCSID("@(#)$Id: sasl.c,v 8.22 2006/08
 **  using unsigned long: for portability, it should be size_t.
 */
 
-void *sm_sasl_malloc __P((unsigned long));
-static void *sm_sasl_calloc __P((unsigned long, unsigned long));
-static void *sm_sasl_realloc __P((void *, unsigned long));
+#if defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a
+#define SM_SASL_SIZE_T size_t
+#else /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */
+#define SM_SASL_SIZE_T unsigned long
+#endif /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */
+
+void *sm_sasl_malloc __P((SM_SASL_SIZE_T));
+static void *sm_sasl_calloc __P((SM_SASL_SIZE_T, SM_SASL_SIZE_T));
+static void *sm_sasl_realloc __P((void *, SM_SASL_SIZE_T));
 void sm_sasl_free __P((void *));
 
 /*
@@ -50,7 +56,7 @@ void sm_sasl_free __P((void *));
 
 void *
 sm_sasl_malloc(size)
-   unsigned long size;
+   SM_SASL_SIZE_T size;
 {
return sm_malloc((size_t) size);
 }
@@ -71,8 +77,8 @@ sm_sasl_malloc(size)
 
 static void *
 sm_sasl_calloc(nelem, elemsize)
-   unsigned long nelem;
-   unsigned long elemsize;
+   SM_SASL_SIZE_T nelem;
+   SM_SASL_SIZE_T elemsize;
 {
size_t size;
void *p;
@@ -99,7 +105,7 @@ sm_sasl_calloc(nelem, elemsize)
 static void *
 sm_sasl_realloc(o, size)
void *o;
-   unsigned long size;
+   SM_SASL_SIZE_T size;
 {
return sm_realloc(o, (size_t) size);
 }
___
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-unsubscr...@freebsd.org"


svn commit: r243748 - stable/8/contrib/sendmail/src

2012-12-01 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Dec  1 11:08:46 2012
New Revision: 243748
URL: http://svnweb.freebsd.org/changeset/base/243748

Log:
  MFC r243649: cyrus-sasl 2.1.26 was released.  In this version, the type
  of callback functions was changed from "unsigned long" to "size_t".

Modified:
  stable/8/contrib/sendmail/src/sasl.c
Directory Properties:
  stable/8/contrib/sendmail/   (props changed)

Modified: stable/8/contrib/sendmail/src/sasl.c
==
--- stable/8/contrib/sendmail/src/sasl.cSat Dec  1 11:03:19 2012
(r243747)
+++ stable/8/contrib/sendmail/src/sasl.cSat Dec  1 11:08:46 2012
(r243748)
@@ -24,9 +24,15 @@ SM_RCSID("@(#)$Id: sasl.c,v 8.22 2006/08
 **  using unsigned long: for portability, it should be size_t.
 */
 
-void *sm_sasl_malloc __P((unsigned long));
-static void *sm_sasl_calloc __P((unsigned long, unsigned long));
-static void *sm_sasl_realloc __P((void *, unsigned long));
+#if defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a
+#define SM_SASL_SIZE_T size_t
+#else /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */
+#define SM_SASL_SIZE_T unsigned long
+#endif /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */
+
+void *sm_sasl_malloc __P((SM_SASL_SIZE_T));
+static void *sm_sasl_calloc __P((SM_SASL_SIZE_T, SM_SASL_SIZE_T));
+static void *sm_sasl_realloc __P((void *, SM_SASL_SIZE_T));
 void sm_sasl_free __P((void *));
 
 /*
@@ -50,7 +56,7 @@ void sm_sasl_free __P((void *));
 
 void *
 sm_sasl_malloc(size)
-   unsigned long size;
+   SM_SASL_SIZE_T size;
 {
return sm_malloc((size_t) size);
 }
@@ -71,8 +77,8 @@ sm_sasl_malloc(size)
 
 static void *
 sm_sasl_calloc(nelem, elemsize)
-   unsigned long nelem;
-   unsigned long elemsize;
+   SM_SASL_SIZE_T nelem;
+   SM_SASL_SIZE_T elemsize;
 {
size_t size;
void *p;
@@ -99,7 +105,7 @@ sm_sasl_calloc(nelem, elemsize)
 static void *
 sm_sasl_realloc(o, size)
void *o;
-   unsigned long size;
+   SM_SASL_SIZE_T size;
 {
return sm_realloc(o, (size_t) size);
 }
___
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-unsubscr...@freebsd.org"


svn commit: r243749 - stable/7/contrib/sendmail/src

2012-12-01 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Dec  1 11:12:04 2012
New Revision: 243749
URL: http://svnweb.freebsd.org/changeset/base/243749

Log:
  MFC r243649: cyrus-sasl 2.1.26 was released.  In this version, the type
  of callback functions was changed from "unsigned long" to "size_t".

Modified:
  stable/7/contrib/sendmail/src/sasl.c
Directory Properties:
  stable/7/contrib/sendmail/   (props changed)

Modified: stable/7/contrib/sendmail/src/sasl.c
==
--- stable/7/contrib/sendmail/src/sasl.cSat Dec  1 11:08:46 2012
(r243748)
+++ stable/7/contrib/sendmail/src/sasl.cSat Dec  1 11:12:04 2012
(r243749)
@@ -24,9 +24,15 @@ SM_RCSID("@(#)$Id: sasl.c,v 8.22 2006/08
 **  using unsigned long: for portability, it should be size_t.
 */
 
-void *sm_sasl_malloc __P((unsigned long));
-static void *sm_sasl_calloc __P((unsigned long, unsigned long));
-static void *sm_sasl_realloc __P((void *, unsigned long));
+#if defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a
+#define SM_SASL_SIZE_T size_t
+#else /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */
+#define SM_SASL_SIZE_T unsigned long
+#endif /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */
+
+void *sm_sasl_malloc __P((SM_SASL_SIZE_T));
+static void *sm_sasl_calloc __P((SM_SASL_SIZE_T, SM_SASL_SIZE_T));
+static void *sm_sasl_realloc __P((void *, SM_SASL_SIZE_T));
 void sm_sasl_free __P((void *));
 
 /*
@@ -50,7 +56,7 @@ void sm_sasl_free __P((void *));
 
 void *
 sm_sasl_malloc(size)
-   unsigned long size;
+   SM_SASL_SIZE_T size;
 {
return sm_malloc((size_t) size);
 }
@@ -71,8 +77,8 @@ sm_sasl_malloc(size)
 
 static void *
 sm_sasl_calloc(nelem, elemsize)
-   unsigned long nelem;
-   unsigned long elemsize;
+   SM_SASL_SIZE_T nelem;
+   SM_SASL_SIZE_T elemsize;
 {
size_t size;
void *p;
@@ -99,7 +105,7 @@ sm_sasl_calloc(nelem, elemsize)
 static void *
 sm_sasl_realloc(o, size)
void *o;
-   unsigned long size;
+   SM_SASL_SIZE_T size;
 {
return sm_realloc(o, (size_t) size);
 }
___
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-unsubscr...@freebsd.org"


svn commit: r243747 - stable/9/contrib/sendmail/src

2012-12-01 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Dec  1 11:03:19 2012
New Revision: 243747
URL: http://svnweb.freebsd.org/changeset/base/243747

Log:
  MFC r243649: cyrus-sasl 2.1.26 was released.  In this version, the type
  of callback functions was changed from "unsigned long" to "size_t".

Modified:
  stable/9/contrib/sendmail/src/sasl.c
Directory Properties:
  stable/9/contrib/sendmail/   (props changed)

Modified: stable/9/contrib/sendmail/src/sasl.c
==
--- stable/9/contrib/sendmail/src/sasl.cSat Dec  1 08:59:36 2012
(r243746)
+++ stable/9/contrib/sendmail/src/sasl.cSat Dec  1 11:03:19 2012
(r243747)
@@ -24,9 +24,15 @@ SM_RCSID("@(#)$Id: sasl.c,v 8.22 2006/08
 **  using unsigned long: for portability, it should be size_t.
 */
 
-void *sm_sasl_malloc __P((unsigned long));
-static void *sm_sasl_calloc __P((unsigned long, unsigned long));
-static void *sm_sasl_realloc __P((void *, unsigned long));
+#if defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a
+#define SM_SASL_SIZE_T size_t
+#else /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */
+#define SM_SASL_SIZE_T unsigned long
+#endif /* defined(SASL_VERSION_FULL) && SASL_VERSION_FULL >= 0x02011a */
+
+void *sm_sasl_malloc __P((SM_SASL_SIZE_T));
+static void *sm_sasl_calloc __P((SM_SASL_SIZE_T, SM_SASL_SIZE_T));
+static void *sm_sasl_realloc __P((void *, SM_SASL_SIZE_T));
 void sm_sasl_free __P((void *));
 
 /*
@@ -50,7 +56,7 @@ void sm_sasl_free __P((void *));
 
 void *
 sm_sasl_malloc(size)
-   unsigned long size;
+   SM_SASL_SIZE_T size;
 {
return sm_malloc((size_t) size);
 }
@@ -71,8 +77,8 @@ sm_sasl_malloc(size)
 
 static void *
 sm_sasl_calloc(nelem, elemsize)
-   unsigned long nelem;
-   unsigned long elemsize;
+   SM_SASL_SIZE_T nelem;
+   SM_SASL_SIZE_T elemsize;
 {
size_t size;
void *p;
@@ -99,7 +105,7 @@ sm_sasl_calloc(nelem, elemsize)
 static void *
 sm_sasl_realloc(o, size)
void *o;
-   unsigned long size;
+   SM_SASL_SIZE_T size;
 {
return sm_realloc(o, (size_t) size);
 }
___
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-unsubscr...@freebsd.org"


svn commit: r244770 - head/etc/mtree

2012-12-28 Thread Hajimu UMEMOTO
Author: ume
Date: Fri Dec 28 10:42:01 2012
New Revision: 244770
URL: http://svnweb.freebsd.org/changeset/base/244770

Log:
  Fix location of /var/audit/dist and /var/audit/remote.
  Note that those who did installworld after r243752 should
  remove wrongly created /var/dist and /var/remote.
  
  Reviewed by:  pjd

Modified:
  head/etc/mtree/BSD.var.dist

Modified: head/etc/mtree/BSD.var.dist
==
--- head/etc/mtree/BSD.var.dist Fri Dec 28 09:19:49 2012(r244769)
+++ head/etc/mtree/BSD.var.dist Fri Dec 28 10:42:01 2012(r244770)
@@ -18,11 +18,11 @@
 /set mode=0750
 /set gname=audit
 audit
-..
 distuname=auditdistd gname=audit mode=0770
 ..
 remote  uname=auditdistd gname=wheel mode=0700
 ..
+..
 /set gname=wheel
 backups
 ..
___
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-unsubscr...@freebsd.org"


svn commit: r244771 - stable/9/etc/mtree

2012-12-28 Thread Hajimu UMEMOTO
Author: ume
Date: Fri Dec 28 10:58:03 2012
New Revision: 244771
URL: http://svnweb.freebsd.org/changeset/base/244771

Log:
  MFC r244770: Fix location of /var/audit/dist and /var/audit/remote.
  Note that those who did installworld after r244398 should remove
  wrongly created /var/dist and /var/remote.
  
  Reviewed by:  pjd

Modified:
  stable/9/etc/mtree/BSD.var.dist
Directory Properties:
  stable/9/etc/   (props changed)

Modified: stable/9/etc/mtree/BSD.var.dist
==
--- stable/9/etc/mtree/BSD.var.dist Fri Dec 28 10:42:01 2012
(r244770)
+++ stable/9/etc/mtree/BSD.var.dist Fri Dec 28 10:58:03 2012
(r244771)
@@ -18,11 +18,11 @@
 /set mode=0750
 /set gname=audit
 audit
-..
 distuname=auditdistd gname=audit mode=0770
 ..
 remote  uname=auditdistd gname=wheel mode=0700
 ..
+..
 /set gname=wheel
 backups
 ..
___
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-unsubscr...@freebsd.org"


svn commit: r244855 - head

2012-12-30 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Dec 30 08:00:40 2012
New Revision: 244855
URL: http://svnweb.freebsd.org/changeset/base/244855

Log:
  Add directories which were wrongly created during auditdistd addition.
  
  Requested by: netchild

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Sun Dec 30 06:48:12 2012(r244854)
+++ head/ObsoleteFiles.inc  Sun Dec 30 08:00:40 2012(r244855)
@@ -38,6 +38,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20121230: remove wrongly created directories for auditdistd
+OLD_DIRS+=var/dist
+OLD_DIRS+=var/remote
 # 20121114: zpool-features manual page moved from section 5 to 7
 OLD_FILES+=usr/share/man/man5/zpool-features.5.gz
 # 20121022: remove harp, hfa and idt man page
___
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-unsubscr...@freebsd.org"


svn commit: r244856 - stable/9

2012-12-30 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Dec 30 08:16:05 2012
New Revision: 244856
URL: http://svnweb.freebsd.org/changeset/base/244856

Log:
  MFC r244855: Add directories which were wrongly created during
  auditdistd addition.
  
  Requested by: netchild

Modified:
  stable/9/ObsoleteFiles.inc   (contents, props changed)

Modified: stable/9/ObsoleteFiles.inc
==
--- stable/9/ObsoleteFiles.inc  Sun Dec 30 08:00:40 2012(r244855)
+++ stable/9/ObsoleteFiles.inc  Sun Dec 30 08:16:05 2012(r244856)
@@ -38,6 +38,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20121230: remove wrongly created directories for auditdistd
+OLD_DIRS+=var/dist
+OLD_DIRS+=var/remote
 # 20121015: remove incomplete unwind.h
 OLD_FILES+=usr/include/clang/3.1/unwind.h
 # 20120713: auth.conf removed
___
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-unsubscr...@freebsd.org"


svn commit: r245225 - head/lib/libc/net

2013-01-09 Thread Hajimu UMEMOTO
Author: ume
Date: Wed Jan  9 15:22:37 2013
New Revision: 245225
URL: http://svnweb.freebsd.org/changeset/base/245225

Log:
  Disable destination address selection support of
  getipnodebyname(1).  RFC 2553 mentions IPv6 addresses
  are returned 1st.
  
  Spotted by:   uqs
  MFC after:1 week

Modified:
  head/lib/libc/net/name6.c

Modified: head/lib/libc/net/name6.c
==
--- head/lib/libc/net/name6.c   Wed Jan  9 11:58:47 2013(r245224)
+++ head/lib/libc/net/name6.c   Wed Jan  9 15:22:37 2013(r245225)
@@ -200,6 +200,7 @@ static structhostent *_hpmapv6(struct 
 #endif
 static struct   hostent *_hpsort(struct hostent *, res_state);
 
+#ifdef ENABLE_IP6ADDRCTL
 static struct   hostent *_hpreorder(struct hostent *);
 static int  get_addrselectpolicy(struct policyhead *);
 static void free_addrselectpolicy(struct policyhead *);
@@ -209,6 +210,7 @@ static void  set_source(struct hp_order 
 static int  matchlen(struct sockaddr *, struct sockaddr *);
 static int  comp_dst(const void *, const void *);
 static int  gai_addr2scopetype(struct sockaddr *);
+#endif
 
 /*
  * Functions defined in RFC2553
@@ -309,7 +311,11 @@ getipnodebyname(const char *name, int af
*errp = statp->res_h_errno;

statp->options = options;
+#ifdef ENABLE_IP6ADDRCTL
return _hpreorder(_hpsort(hp, statp));
+#else
+   return _hpsort(hp, statp);
+#endif
 }
 
 struct hostent *
@@ -632,6 +638,7 @@ _hpsort(struct hostent *hp, res_state st
return hp;
 }
 
+#ifdef ENABLE_IP6ADDRCTL
 /*
  * _hpreorder: sort address by default address selection
  */
@@ -1109,3 +1116,4 @@ gai_addr2scopetype(struct sockaddr *sa)
return(-1);
}
 }
+#endif
___
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-unsubscr...@freebsd.org"


svn commit: r245230 - in head: sbin/ifconfig sys/netinet6 usr.sbin/ndp

2013-01-09 Thread Hajimu UMEMOTO
Author: ume
Date: Wed Jan  9 18:18:08 2013
New Revision: 245230
URL: http://svnweb.freebsd.org/changeset/base/245230

Log:
  Add no_prefer_iface option.
  It stops treating the address on the interface as special by source
  address selection rule even when the interface is outgoing interface.
  This is desired in some situation.
  
  Requested by: hrs
  Reviewed by:  IHANet folks including hrs
  MFC after:1 week

Modified:
  head/sbin/ifconfig/af_inet6.c
  head/sbin/ifconfig/af_nd6.c
  head/sbin/ifconfig/ifconfig.8
  head/sys/netinet6/in6_src.c
  head/sys/netinet6/nd6.h
  head/usr.sbin/ndp/ndp.8
  head/usr.sbin/ndp/ndp.c

Modified: head/sbin/ifconfig/af_inet6.c
==
--- head/sbin/ifconfig/af_inet6.c   Wed Jan  9 17:09:06 2013
(r245229)
+++ head/sbin/ifconfig/af_inet6.c   Wed Jan  9 18:18:08 2013
(r245230)
@@ -473,6 +473,8 @@ static struct cmd inet6_cmds[] = {
DEF_CMD("-nud", -ND6_IFF_PERFORMNUD,setnd6flags),
DEF_CMD("auto_linklocal",ND6_IFF_AUTO_LINKLOCAL,setnd6flags),
DEF_CMD("-auto_linklocal",-ND6_IFF_AUTO_LINKLOCAL,setnd6flags),
+   DEF_CMD("no_prefer_iface",ND6_IFF_NO_PREFER_IFACE,setnd6flags),
+   DEF_CMD("-no_prefer_iface",-ND6_IFF_NO_PREFER_IFACE,setnd6flags),
DEF_CMD_ARG("pltime",   setip6pltime),
DEF_CMD_ARG("vltime",   setip6vltime),
DEF_CMD("eui64",0,  setip6eui64),

Modified: head/sbin/ifconfig/af_nd6.c
==
--- head/sbin/ifconfig/af_nd6.c Wed Jan  9 17:09:06 2013(r245229)
+++ head/sbin/ifconfig/af_nd6.c Wed Jan  9 18:18:08 2013(r245230)
@@ -58,7 +58,7 @@ static const char rcsid[] =
 #defineMAX_SYSCTL_TRY  5
 #defineND6BITS "\020\001PERFORMNUD\002ACCEPT_RTADV\003PREFER_SOURCE" \
"\004IFDISABLED\005DONT_SET_IFROUTE\006AUTO_LINKLOCAL" \
-   "\007NO_RADR\020DEFAULTIF"
+   "\007NO_RADR\010NO_PREFER_IFACE\020DEFAULTIF"
 
 static int isnd6defif(int);
 void setnd6flags(const char *, int, int, const struct afswtch *);

Modified: head/sbin/ifconfig/ifconfig.8
==
--- head/sbin/ifconfig/ifconfig.8   Wed Jan  9 17:09:06 2013
(r245229)
+++ head/sbin/ifconfig/ifconfig.8   Wed Jan  9 18:18:08 2013
(r245230)
@@ -28,7 +28,7 @@
 .\" From: @(#)ifconfig.8   8.3 (Berkeley) 1/5/94
 .\" $FreeBSD$
 .\"
-.Dd November 7, 2012
+.Dd January 10, 2013
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -716,6 +716,13 @@ Set a flag to enable Neighbor Unreachabi
 .It Cm -nud
 Clear a flag
 .Cm nud .
+.It Cm no_prefer_iface
+Set a flag to not prefer address on the interface as candidates of the
+source address for outgoing packets, even when the interface is
+outgoing interface.
+.It Cm -no_prefer_iface
+Clear a flag
+.Cm no_prefer_iface .
 .El
 .Pp
 The following parameters are specific to cloning

Modified: head/sys/netinet6/in6_src.c
==
--- head/sys/netinet6/in6_src.c Wed Jan  9 17:09:06 2013(r245229)
+++ head/sys/netinet6/in6_src.c Wed Jan  9 18:18:08 2013(r245230)
@@ -383,10 +383,12 @@ in6_selectsrc(struct sockaddr_in6 *dstso
 */
 
/* Rule 5: Prefer outgoing interface */
-   if (ia_best->ia_ifp == ifp && ia->ia_ifp != ifp)
-   NEXT(5);
-   if (ia_best->ia_ifp != ifp && ia->ia_ifp == ifp)
-   REPLACE(5);
+   if (!(ND_IFINFO(ifp)->flags & ND6_IFF_NO_PREFER_IFACE)) {
+   if (ia_best->ia_ifp == ifp && ia->ia_ifp != ifp)
+   NEXT(5);
+   if (ia_best->ia_ifp != ifp && ia->ia_ifp == ifp)
+   REPLACE(5);
+   }
 
/*
 * Rule 6: Prefer matching label

Modified: head/sys/netinet6/nd6.h
==
--- head/sys/netinet6/nd6.h Wed Jan  9 17:09:06 2013(r245229)
+++ head/sys/netinet6/nd6.h Wed Jan  9 18:18:08 2013(r245230)
@@ -86,6 +86,7 @@ struct nd_ifinfo {
 #define ND6_IFF_DONT_SET_IFROUTE   0x10
 #define ND6_IFF_AUTO_LINKLOCAL 0x20
 #defineND6_IFF_NO_RADR 0x40
+#define ND6_IFF_NO_PREFER_IFACE0x80 /* XXX: not related to ND. */
 
 #defineND6_CREATE  LLE_CREATE
 #defineND6_EXCLUSIVE   LLE_EXCLUSIVE

Modified: head/usr.sbin/ndp/ndp.8
==
--- head/usr.sbin/ndp/ndp.8 Wed Jan  9 17:09:06 2013(r245229)
+++ head/usr.sbin/ndp/ndp.8 Wed Jan  9 18:18:08 2013(r245230)
@@ -29,7 +29,7 @@
 .\"
 .\

svn commit: r245256 - head/lib/libc/net

2013-01-10 Thread Hajimu UMEMOTO
Author: ume
Date: Thu Jan 10 14:08:19 2013
New Revision: 245256
URL: http://svnweb.freebsd.org/changeset/base/245256

Log:
  Re-enable ip6addrctl support but only for IPv6 address.
  
  Requested by: Ben Morrow 
  MFC after:1 week

Modified:
  head/lib/libc/net/name6.c

Modified: head/lib/libc/net/name6.c
==
--- head/lib/libc/net/name6.c   Thu Jan 10 12:43:58 2013(r245255)
+++ head/lib/libc/net/name6.c   Thu Jan 10 14:08:19 2013(r245256)
@@ -200,7 +200,7 @@ static structhostent *_hpmapv6(struct 
 #endif
 static struct   hostent *_hpsort(struct hostent *, res_state);
 
-#ifdef ENABLE_IP6ADDRCTL
+#ifdef INET6
 static struct   hostent *_hpreorder(struct hostent *);
 static int  get_addrselectpolicy(struct policyhead *);
 static void free_addrselectpolicy(struct policyhead *);
@@ -287,8 +287,10 @@ getipnodebyname(const char *name, int af

hp = gethostbyname2(name, af);
hp = _hpcopy(hp, errp);
-
 #ifdef INET6
+   if (af == AF_INET6)
+   hp = _hpreorder(hp);
+
if (af == AF_INET6 && ((flags & AI_ALL) || hp == NULL) &&
MAPADDRENABLED(flags)) {
struct hostent *hp2 = gethostbyname2(name, AF_INET);
@@ -311,11 +313,7 @@ getipnodebyname(const char *name, int af
*errp = statp->res_h_errno;

statp->options = options;
-#ifdef ENABLE_IP6ADDRCTL
-   return _hpreorder(_hpsort(hp, statp));
-#else
return _hpsort(hp, statp);
-#endif
 }
 
 struct hostent *
@@ -638,7 +636,7 @@ _hpsort(struct hostent *hp, res_state st
return hp;
 }
 
-#ifdef ENABLE_IP6ADDRCTL
+#ifdef INET6
 /*
  * _hpreorder: sort address by default address selection
  */
___
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-unsubscr...@freebsd.org"


svn commit: r245553 - stable/9/lib/libc/net

2013-01-17 Thread Hajimu UMEMOTO
Author: ume
Date: Thu Jan 17 16:11:38 2013
New Revision: 245553
URL: http://svnweb.freebsd.org/changeset/base/245553

Log:
  MFC r245225, r245256: Restrict use of source address selection
  of getipnodebyname(1) only to IPv6 address.

Modified:
  stable/9/lib/libc/net/name6.c
Directory Properties:
  stable/9/lib/libc/   (props changed)

Modified: stable/9/lib/libc/net/name6.c
==
--- stable/9/lib/libc/net/name6.c   Thu Jan 17 15:45:45 2013
(r245552)
+++ stable/9/lib/libc/net/name6.c   Thu Jan 17 16:11:38 2013
(r245553)
@@ -200,6 +200,7 @@ static structhostent *_hpmapv6(struct 
 #endif
 static struct   hostent *_hpsort(struct hostent *, res_state);
 
+#ifdef INET6
 static struct   hostent *_hpreorder(struct hostent *);
 static int  get_addrselectpolicy(struct policyhead *);
 static void free_addrselectpolicy(struct policyhead *);
@@ -209,6 +210,7 @@ static void  set_source(struct hp_order 
 static int  matchlen(struct sockaddr *, struct sockaddr *);
 static int  comp_dst(const void *, const void *);
 static int  gai_addr2scopetype(struct sockaddr *);
+#endif
 
 /*
  * Functions defined in RFC2553
@@ -285,8 +287,10 @@ getipnodebyname(const char *name, int af

hp = gethostbyname2(name, af);
hp = _hpcopy(hp, errp);
-
 #ifdef INET6
+   if (af == AF_INET6)
+   hp = _hpreorder(hp);
+
if (af == AF_INET6 && ((flags & AI_ALL) || hp == NULL) &&
MAPADDRENABLED(flags)) {
struct hostent *hp2 = gethostbyname2(name, AF_INET);
@@ -309,7 +313,7 @@ getipnodebyname(const char *name, int af
*errp = statp->res_h_errno;

statp->options = options;
-   return _hpreorder(_hpsort(hp, statp));
+   return _hpsort(hp, statp);
 }
 
 struct hostent *
@@ -632,6 +636,7 @@ _hpsort(struct hostent *hp, res_state st
return hp;
 }
 
+#ifdef INET6
 /*
  * _hpreorder: sort address by default address selection
  */
@@ -1109,3 +1114,4 @@ gai_addr2scopetype(struct sockaddr *sa)
return(-1);
}
 }
+#endif
___
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-unsubscr...@freebsd.org"


svn commit: r245555 - in stable/9: sbin/ifconfig sys/netinet6 usr.sbin/ndp

2013-01-17 Thread Hajimu UMEMOTO
Author: ume
Date: Thu Jan 17 16:39:21 2013
New Revision: 24
URL: http://svnweb.freebsd.org/changeset/base/24

Log:
  MFC r245230: Add no_prefer_iface option.
  It stops treating the address on the interface as special by source
  address selection rule even when the interface is outgoing interface.
  This is desired in some situation.

Modified:
  stable/9/sbin/ifconfig/af_inet6.c
  stable/9/sbin/ifconfig/af_nd6.c
  stable/9/sbin/ifconfig/ifconfig.8
  stable/9/sys/netinet6/in6_src.c
  stable/9/sys/netinet6/nd6.h
  stable/9/usr.sbin/ndp/ndp.8
  stable/9/usr.sbin/ndp/ndp.c
Directory Properties:
  stable/9/sbin/ifconfig/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/usr.sbin/ndp/   (props changed)

Modified: stable/9/sbin/ifconfig/af_inet6.c
==
--- stable/9/sbin/ifconfig/af_inet6.c   Thu Jan 17 16:26:40 2013
(r245554)
+++ stable/9/sbin/ifconfig/af_inet6.c   Thu Jan 17 16:39:21 2013
(r24)
@@ -511,6 +511,8 @@ static struct cmd inet6_cmds[] = {
DEF_CMD("-prefer_source",-ND6_IFF_PREFER_SOURCE,setnd6flags),
DEF_CMD("auto_linklocal",ND6_IFF_AUTO_LINKLOCAL,setnd6flags),
DEF_CMD("-auto_linklocal",-ND6_IFF_AUTO_LINKLOCAL,setnd6flags),
+   DEF_CMD("no_prefer_iface",ND6_IFF_NO_PREFER_IFACE,setnd6flags),
+   DEF_CMD("-no_prefer_iface",-ND6_IFF_NO_PREFER_IFACE,setnd6flags),
DEF_CMD_ARG("pltime",   setip6pltime),
DEF_CMD_ARG("vltime",   setip6vltime),
DEF_CMD("eui64",0,  setip6eui64),

Modified: stable/9/sbin/ifconfig/af_nd6.c
==
--- stable/9/sbin/ifconfig/af_nd6.c Thu Jan 17 16:26:40 2013
(r245554)
+++ stable/9/sbin/ifconfig/af_nd6.c Thu Jan 17 16:39:21 2013
(r24)
@@ -58,7 +58,7 @@ static const char rcsid[] =
 #defineMAX_SYSCTL_TRY  5
 #defineND6BITS "\020\001PERFORMNUD\002ACCEPT_RTADV\003PREFER_SOURCE" \
"\004IFDISABLED\005DONT_SET_IFROUTE\006AUTO_LINKLOCAL" \
-   "\007NO_RADR\020DEFAULTIF"
+   "\007NO_RADR\010NO_PREFER_IFACE\020DEFAULTIF"
 
 static int isnd6defif(int);
 void setnd6flags(const char *, int, int, const struct afswtch *);

Modified: stable/9/sbin/ifconfig/ifconfig.8
==
--- stable/9/sbin/ifconfig/ifconfig.8   Thu Jan 17 16:26:40 2013
(r245554)
+++ stable/9/sbin/ifconfig/ifconfig.8   Thu Jan 17 16:39:21 2013
(r24)
@@ -28,7 +28,7 @@
 .\" From: @(#)ifconfig.8   8.3 (Berkeley) 1/5/94
 .\" $FreeBSD$
 .\"
-.Dd November 7, 2012
+.Dd January 10, 2013
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -722,6 +722,13 @@ source address for outgoing packets.
 .It Cm -prefer_source
 Clear a flag
 .Cm prefer_source .
+.It Cm no_prefer_iface
+Set a flag to not prefer address on the interface as candidates of the
+source address for outgoing packets, even when the interface is
+outgoing interface.
+.It Cm -no_prefer_iface
+Clear a flag
+.Cm no_prefer_iface .
 .El
 .Pp
 The following parameters are specific to cloning

Modified: stable/9/sys/netinet6/in6_src.c
==
--- stable/9/sys/netinet6/in6_src.c Thu Jan 17 16:26:40 2013
(r245554)
+++ stable/9/sys/netinet6/in6_src.c Thu Jan 17 16:39:21 2013
(r24)
@@ -383,10 +383,12 @@ in6_selectsrc(struct sockaddr_in6 *dstso
 */
 
/* Rule 5: Prefer outgoing interface */
-   if (ia_best->ia_ifp == ifp && ia->ia_ifp != ifp)
-   NEXT(5);
-   if (ia_best->ia_ifp != ifp && ia->ia_ifp == ifp)
-   REPLACE(5);
+   if (!(ND_IFINFO(ifp)->flags & ND6_IFF_NO_PREFER_IFACE)) {
+   if (ia_best->ia_ifp == ifp && ia->ia_ifp != ifp)
+   NEXT(5);
+   if (ia_best->ia_ifp != ifp && ia->ia_ifp == ifp)
+   REPLACE(5);
+   }
 
/*
 * Rule 6: Prefer matching label

Modified: stable/9/sys/netinet6/nd6.h
==
--- stable/9/sys/netinet6/nd6.h Thu Jan 17 16:26:40 2013(r245554)
+++ stable/9/sys/netinet6/nd6.h Thu Jan 17 16:39:21 2013(r24)
@@ -86,6 +86,7 @@ struct nd_ifinfo {
 #define ND6_IFF_DONT_SET_IFROUTE   0x10
 #define ND6_IFF_AUTO_LINKLOCAL 0x20
 #defineND6_IFF_NO_RADR 0x40
+#define ND6_IFF_NO_PREFER_IFACE0x80 /* XXX: not related to ND. */
 
 #defineND6_CREATE  LLE_CREATE
 #defineND6_EXCLUSIVE   LLE_EXCLUSIVE

Modified: stable/9/usr.sbin/ndp/ndp.8
==
---

svn commit: r245557 - stable/8/lib/libc/net

2013-01-17 Thread Hajimu UMEMOTO
Author: ume
Date: Thu Jan 17 17:05:54 2013
New Revision: 245557
URL: http://svnweb.freebsd.org/changeset/base/245557

Log:
  MFC r245225, r245256: Restrict use of source address selection
  of getipnodebyname(1) only to IPv6 address.

Modified:
  stable/8/lib/libc/net/name6.c
Directory Properties:
  stable/8/lib/libc/   (props changed)

Modified: stable/8/lib/libc/net/name6.c
==
--- stable/8/lib/libc/net/name6.c   Thu Jan 17 16:43:59 2013
(r245556)
+++ stable/8/lib/libc/net/name6.c   Thu Jan 17 17:05:54 2013
(r245557)
@@ -200,6 +200,7 @@ static structhostent *_hpmapv6(struct 
 #endif
 static struct   hostent *_hpsort(struct hostent *, res_state);
 
+#ifdef INET6
 static struct   hostent *_hpreorder(struct hostent *);
 static int  get_addrselectpolicy(struct policyhead *);
 static void free_addrselectpolicy(struct policyhead *);
@@ -209,6 +210,7 @@ static void  set_source(struct hp_order 
 static int  matchlen(struct sockaddr *, struct sockaddr *);
 static int  comp_dst(const void *, const void *);
 static int  gai_addr2scopetype(struct sockaddr *);
+#endif
 
 /*
  * Functions defined in RFC2553
@@ -285,8 +287,10 @@ getipnodebyname(const char *name, int af

hp = gethostbyname2(name, af);
hp = _hpcopy(hp, errp);
-
 #ifdef INET6
+   if (af == AF_INET6)
+   hp = _hpreorder(hp);
+
if (af == AF_INET6 && ((flags & AI_ALL) || hp == NULL) &&
MAPADDRENABLED(flags)) {
struct hostent *hp2 = gethostbyname2(name, AF_INET);
@@ -309,7 +313,7 @@ getipnodebyname(const char *name, int af
*errp = statp->res_h_errno;

statp->options = options;
-   return _hpreorder(_hpsort(hp, statp));
+   return _hpsort(hp, statp);
 }
 
 struct hostent *
@@ -632,6 +636,7 @@ _hpsort(struct hostent *hp, res_state st
return hp;
 }
 
+#ifdef INET6
 /*
  * _hpreorder: sort address by default address selection
  */
@@ -1109,3 +1114,4 @@ gai_addr2scopetype(struct sockaddr *sa)
return(-1);
}
 }
+#endif
___
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-unsubscr...@freebsd.org"


svn commit: r245559 - stable/7/lib/libc/net

2013-01-17 Thread Hajimu UMEMOTO
Author: ume
Date: Thu Jan 17 17:08:10 2013
New Revision: 245559
URL: http://svnweb.freebsd.org/changeset/base/245559

Log:
  MFC r245225, r245256: Restrict use of source address selection
  of getipnodebyname(1) only to IPv6 address.

Modified:
  stable/7/lib/libc/net/name6.c
Directory Properties:
  stable/7/lib/libc/   (props changed)

Modified: stable/7/lib/libc/net/name6.c
==
--- stable/7/lib/libc/net/name6.c   Thu Jan 17 17:07:54 2013
(r245558)
+++ stable/7/lib/libc/net/name6.c   Thu Jan 17 17:08:10 2013
(r245559)
@@ -200,6 +200,7 @@ static structhostent *_hpmapv6(struct 
 #endif
 static struct   hostent *_hpsort(struct hostent *, res_state);
 
+#ifdef INET6
 static struct   hostent *_hpreorder(struct hostent *);
 static int  get_addrselectpolicy(struct policyhead *);
 static void free_addrselectpolicy(struct policyhead *);
@@ -209,6 +210,7 @@ static void  set_source(struct hp_order 
 static int  matchlen(struct sockaddr *, struct sockaddr *);
 static int  comp_dst(const void *, const void *);
 static int  gai_addr2scopetype(struct sockaddr *);
+#endif
 
 /*
  * Functions defined in RFC2553
@@ -285,8 +287,10 @@ getipnodebyname(const char *name, int af

hp = gethostbyname2(name, af);
hp = _hpcopy(hp, errp);
-
 #ifdef INET6
+   if (af == AF_INET6)
+   hp = _hpreorder(hp);
+
if (af == AF_INET6 && ((flags & AI_ALL) || hp == NULL) &&
MAPADDRENABLED(flags)) {
struct hostent *hp2 = gethostbyname2(name, AF_INET);
@@ -309,7 +313,7 @@ getipnodebyname(const char *name, int af
*errp = statp->res_h_errno;

statp->options = options;
-   return _hpreorder(_hpsort(hp, statp));
+   return _hpsort(hp, statp);
 }
 
 struct hostent *
@@ -632,6 +636,7 @@ _hpsort(struct hostent *hp, res_state st
return hp;
 }
 
+#ifdef INET6
 /*
  * _hpreorder: sort address by default address selection
  */
@@ -,3 +1116,4 @@ gai_addr2scopetype(struct sockaddr *sa)
return(-1);
}
 }
+#endif
___
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-unsubscr...@freebsd.org"


svn commit: r241507 - head/etc/periodic/daily

2012-10-13 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Oct 13 14:45:42 2012
New Revision: 241507
URL: http://svn.freebsd.org/changeset/base/241507

Log:
  Make a command for pkg_info changeable like pkg_version in
  /etc/periodic/weekly/400.status-pkg to be friendly with pkgng.
  
  MFC after:1 week

Modified:
  head/etc/periodic/daily/490.status-pkg-changes

Modified: head/etc/periodic/daily/490.status-pkg-changes
==
--- head/etc/periodic/daily/490.status-pkg-changes  Sat Oct 13 13:00:51 
2012(r241506)
+++ head/etc/periodic/daily/490.status-pkg-changes  Sat Oct 13 14:45:42 
2012(r241507)
@@ -23,7 +23,7 @@ case "$daily_status_pkg_changes_enable" 
if [ -f $bak/pkg_info.bak ]; then
mv -f $bak/pkg_info.bak $bak/pkg_info.bak2
fi
-   /usr/sbin/pkg_info > $bak/pkg_info.bak
+   ${pkg_info:-/usr/sbin/pkg_info} > $bak/pkg_info.bak
 
cmp -sz $bak/pkg_info.bak $bak/pkg_info.bak2
if [ $? -eq 1 ]; then
___
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-unsubscr...@freebsd.org"


svn commit: r241786 - stable/9/etc/periodic/daily

2012-10-20 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Oct 20 17:27:57 2012
New Revision: 241786
URL: http://svn.freebsd.org/changeset/base/241786

Log:
  MFC r241507: Make a command for pkg_info changeable like
  pkg_version in /etc/periodic/weekly/400.status-pkg to be
  friendly with pkgng.

Modified:
  stable/9/etc/periodic/daily/490.status-pkg-changes
Directory Properties:
  stable/9/etc/   (props changed)

Modified: stable/9/etc/periodic/daily/490.status-pkg-changes
==
--- stable/9/etc/periodic/daily/490.status-pkg-changes  Sat Oct 20 16:57:23 
2012(r241785)
+++ stable/9/etc/periodic/daily/490.status-pkg-changes  Sat Oct 20 17:27:57 
2012(r241786)
@@ -23,7 +23,7 @@ case "$daily_status_pkg_changes_enable" 
if [ -f $bak/pkg_info.bak ]; then
mv -f $bak/pkg_info.bak $bak/pkg_info.bak2
fi
-   /usr/sbin/pkg_info > $bak/pkg_info.bak
+   ${pkg_info:-/usr/sbin/pkg_info} > $bak/pkg_info.bak
 
cmp -sz $bak/pkg_info.bak $bak/pkg_info.bak2
if [ $? -eq 1 ]; then
___
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-unsubscr...@freebsd.org"


svn commit: r241787 - head/etc/defaults

2012-10-20 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Oct 20 18:05:27 2012
New Revision: 241787
URL: http://svn.freebsd.org/changeset/base/241787

Log:
  Use correct INDEX on 10-CURRENT.

Modified:
  head/etc/defaults/periodic.conf

Modified: head/etc/defaults/periodic.conf
==
--- head/etc/defaults/periodic.conf Sat Oct 20 17:27:57 2012
(r241786)
+++ head/etc/defaults/periodic.conf Sat Oct 20 18:05:27 2012
(r241787)
@@ -245,7 +245,7 @@ weekly_noid_dirs="/"
# Look here
 # 400.status-pkg
 weekly_status_pkg_enable="NO"  # Find out-of-date pkgs
 pkg_version=pkg_version# Use this 
program
-pkg_version_index=/usr/ports/INDEX-9   # Use this index file
+pkg_version_index=/usr/ports/INDEX-10  # Use this index file
 
 # 999.local
 weekly_local="/etc/weekly.local"   # Local scripts
___
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-unsubscr...@freebsd.org"


svn commit: r241788 - head/etc/defaults

2012-10-20 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Oct 20 18:13:20 2012
New Revision: 241788
URL: http://svn.freebsd.org/changeset/base/241788

Log:
  Set default for ${pkg_info} like ${pkg_version}.
  
  MFC after:1 week

Modified:
  head/etc/defaults/periodic.conf

Modified: head/etc/defaults/periodic.conf
==
--- head/etc/defaults/periodic.conf Sat Oct 20 18:05:27 2012
(r241787)
+++ head/etc/defaults/periodic.conf Sat Oct 20 18:13:20 2012
(r241788)
@@ -144,6 +144,7 @@ daily_status_ntpd_enable="NO"   
# Check
 
 # 490.status-pkg-changes
 daily_status_pkg_changes_enable="NO"   # Show package changes
+pkg_info="pkg_info"# Use this program
 
 # 500.queuerun
 daily_queuerun_enable="YES"# Run mail queue
___
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-unsubscr...@freebsd.org"


svn commit: r242318 - stable/9/etc/defaults

2012-10-29 Thread Hajimu UMEMOTO
Author: ume
Date: Mon Oct 29 16:58:45 2012
New Revision: 242318
URL: http://svn.freebsd.org/changeset/base/242318

Log:
  MFC r241788: Set default for ${pkg_info} like ${pkg_version}.

Modified:
  stable/9/etc/defaults/periodic.conf
Directory Properties:
  stable/9/etc/   (props changed)

Modified: stable/9/etc/defaults/periodic.conf
==
--- stable/9/etc/defaults/periodic.conf Mon Oct 29 16:42:37 2012
(r242317)
+++ stable/9/etc/defaults/periodic.conf Mon Oct 29 16:58:45 2012
(r242318)
@@ -143,6 +143,7 @@ daily_status_ntpd_enable="NO"   
# Check
 
 # 490.status-pkg-changes
 daily_status_pkg_changes_enable="NO"   # Show package changes
+pkg_info="pkg_info"# Use this program
 
 # 500.queuerun
 daily_queuerun_enable="YES"# Run mail queue
___
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-unsubscr...@freebsd.org"


svn commit: r237488 - stable/9/usr.sbin/traceroute6

2012-06-23 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Jun 23 17:59:32 2012
New Revision: 237488
URL: http://svn.freebsd.org/changeset/base/237488

Log:
  MFC r235138: Add -a and -A option to the usage.

Modified:
  stable/9/usr.sbin/traceroute6/traceroute6.c
Directory Properties:
  stable/9/usr.sbin/traceroute6/   (props changed)

Modified: stable/9/usr.sbin/traceroute6/traceroute6.c
==
--- stable/9/usr.sbin/traceroute6/traceroute6.c Sat Jun 23 17:46:42 2012
(r237487)
+++ stable/9/usr.sbin/traceroute6/traceroute6.c Sat Jun 23 17:59:32 2012
(r237488)
@@ -1448,7 +1448,8 @@ usage()
 {
 
fprintf(stderr,
-"usage: traceroute6 [-dIlnNrUv] [-f firsthop] [-g gateway] [-m hoplimit]\n"
-"   [-p port] [-q probes] [-s src] [-w waittime] target [datalen]\n");
+"usage: traceroute6 [-adIlnNrUv] [-A as_server] [-f firsthop] [-g gateway]\n"
+"   [-m hoplimit] [-p port] [-q probes] [-s src] [-w waittime] target\n"
+"   [datalen]\n");
exit(1);
 }
___
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-unsubscr...@freebsd.org"


svn commit: r237489 - stable/8/usr.sbin/traceroute6

2012-06-23 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Jun 23 18:07:48 2012
New Revision: 237489
URL: http://svn.freebsd.org/changeset/base/237489

Log:
  MFC r235138: Add -a and -A option to the usage.

Modified:
  stable/8/usr.sbin/traceroute6/traceroute6.c
Directory Properties:
  stable/8/usr.sbin/traceroute6/   (props changed)

Modified: stable/8/usr.sbin/traceroute6/traceroute6.c
==
--- stable/8/usr.sbin/traceroute6/traceroute6.c Sat Jun 23 17:59:32 2012
(r237488)
+++ stable/8/usr.sbin/traceroute6/traceroute6.c Sat Jun 23 18:07:48 2012
(r237489)
@@ -1453,7 +1453,8 @@ usage()
 {
 
fprintf(stderr,
-"usage: traceroute6 [-dIlnNrUv] [-f firsthop] [-g gateway] [-m hoplimit]\n"
-"   [-p port] [-q probes] [-s src] [-w waittime] target [datalen]\n");
+"usage: traceroute6 [-adIlnNrUv] [-A as_server] [-f firsthop] [-g gateway]\n"
+"   [-m hoplimit] [-p port] [-q probes] [-s src] [-w waittime] target\n"
+"   [datalen]\n");
exit(1);
 }
___
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-unsubscr...@freebsd.org"


svn commit: r235138 - head/usr.sbin/traceroute6

2012-05-08 Thread Hajimu UMEMOTO
Author: ume
Date: Tue May  8 15:18:35 2012
New Revision: 235138
URL: http://svn.freebsd.org/changeset/base/235138

Log:
  Add -a and -A option to the usage.
  
  MFC after:1 week

Modified:
  head/usr.sbin/traceroute6/traceroute6.c

Modified: head/usr.sbin/traceroute6/traceroute6.c
==
--- head/usr.sbin/traceroute6/traceroute6.c Tue May  8 08:19:07 2012
(r235137)
+++ head/usr.sbin/traceroute6/traceroute6.c Tue May  8 15:18:35 2012
(r235138)
@@ -1448,7 +1448,8 @@ usage()
 {
 
fprintf(stderr,
-"usage: traceroute6 [-dIlnNrUv] [-f firsthop] [-g gateway] [-m hoplimit]\n"
-"   [-p port] [-q probes] [-s src] [-w waittime] target [datalen]\n");
+"usage: traceroute6 [-adIlnNrUv] [-A as_server] [-f firsthop] [-g gateway]\n"
+"   [-m hoplimit] [-p port] [-q probes] [-s src] [-w waittime] target\n"
+"   [datalen]\n");
exit(1);
 }
___
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-unsubscr...@freebsd.org"


svn commit: r246255 - head/etc/rc.d

2013-02-02 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Feb  2 18:08:09 2013
New Revision: 246255
URL: http://svnweb.freebsd.org/changeset/base/246255

Log:
  Use the default policy table of RFC 6724.
  
  MFC after:1 weeks

Modified:
  head/etc/rc.d/ip6addrctl

Modified: head/etc/rc.d/ip6addrctl
==
--- head/etc/rc.d/ip6addrctlSat Feb  2 14:19:50 2013(r246254)
+++ head/etc/rc.d/ip6addrctlSat Feb  2 18:08:09 2013(r246255)
@@ -29,11 +29,15 @@ ip6addrctl_prefer_ipv6()
afexists inet6 || return 0
 
ip6addrctl flush >/dev/null 2>&1
-   ip6addrctl add ::1/128  50  0
-   ip6addrctl add ::/0 40  1
-   ip6addrctl add 2002::/1630  2
-   ip6addrctl add ::/9620  3
-   ip6addrctl add :::0:0/9610  4
+   ip6addrctl add ::1/128   50  0
+   ip6addrctl add ::/0  40  1
+   ip6addrctl add :::0:0/96 35  4
+   ip6addrctl add 2002::/16 30  2
+   ip6addrctl add 2001::/32  5  5
+   ip6addrctl add fc00::/7   3 13
+   ip6addrctl add ::/96  1  3
+   ip6addrctl add fec0::/10  1 11
+   ip6addrctl add 3ffe::/16  1 12
checkyesno ip6addrctl_verbose && ip6addrctl
 }
 
@@ -42,11 +46,15 @@ ip6addrctl_prefer_ipv4()
afexists inet6 || return 0
 
ip6addrctl flush >/dev/null 2>&1
-   ip6addrctl add :::0:0/9650  0
-   ip6addrctl add ::1/128  40  1
-   ip6addrctl add ::/0 30  2
-   ip6addrctl add 2002::/1620  3
-   ip6addrctl add ::/9610  4
+   ip6addrctl add ::1/128   50  0
+   ip6addrctl add ::/0  40  1
+   ip6addrctl add :::0:0/96100  4
+   ip6addrctl add 2002::/16 30  2
+   ip6addrctl add 2001::/32  5  5
+   ip6addrctl add fc00::/7   3 13
+   ip6addrctl add ::/96  1  3
+   ip6addrctl add fec0::/10  1 11
+   ip6addrctl add 3ffe::/16  1 12
checkyesno ip6addrctl_verbose && ip6addrctl
 }
 
___
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-unsubscr...@freebsd.org"


svn commit: r246599 - stable/8/etc/rc.d

2013-02-09 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Feb  9 18:00:29 2013
New Revision: 246599
URL: http://svnweb.freebsd.org/changeset/base/246599

Log:
  MFC r246255: Use the default policy table of RFC 6724.

Modified:
  stable/8/etc/rc.d/ip6addrctl
Directory Properties:
  stable/8/etc/   (props changed)

Modified: stable/8/etc/rc.d/ip6addrctl
==
--- stable/8/etc/rc.d/ip6addrctlSat Feb  9 17:56:57 2013
(r246598)
+++ stable/8/etc/rc.d/ip6addrctlSat Feb  9 18:00:29 2013
(r246599)
@@ -22,22 +22,30 @@ prefer_ipv4_cmd="ip6addrctl_prefer_ipv4"
 ip6addrctl_prefer_ipv6()
 {
ip6addrctl flush >/dev/null 2>&1
-   ip6addrctl add ::1/128  50  0
-   ip6addrctl add ::/0 40  1
-   ip6addrctl add 2002::/1630  2
-   ip6addrctl add ::/9620  3
-   ip6addrctl add :::0:0/9610  4
+   ip6addrctl add ::1/128   50  0
+   ip6addrctl add ::/0  40  1
+   ip6addrctl add :::0:0/96 35  4
+   ip6addrctl add 2002::/16 30  2
+   ip6addrctl add 2001::/32  5  5
+   ip6addrctl add fc00::/7   3 13
+   ip6addrctl add ::/96  1  3
+   ip6addrctl add fec0::/10  1 11
+   ip6addrctl add 3ffe::/16  1 12
checkyesno ip6addrctl_verbose && ip6addrctl
 }
 
 ip6addrctl_prefer_ipv4()
 {
ip6addrctl flush >/dev/null 2>&1
-   ip6addrctl add :::0:0/9650  0
-   ip6addrctl add ::1/128  40  1
-   ip6addrctl add ::/0 30  2
-   ip6addrctl add 2002::/1620  3
-   ip6addrctl add ::/9610  4
+   ip6addrctl add ::1/128   50  0
+   ip6addrctl add ::/0  40  1
+   ip6addrctl add :::0:0/96100  4
+   ip6addrctl add 2002::/16 30  2
+   ip6addrctl add 2001::/32  5  5
+   ip6addrctl add fc00::/7   3 13
+   ip6addrctl add ::/96  1  3
+   ip6addrctl add fec0::/10  1 11
+   ip6addrctl add 3ffe::/16  1 12
checkyesno ip6addrctl_verbose && ip6addrctl
 }
 
___
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-unsubscr...@freebsd.org"


svn commit: r246598 - stable/9/etc/rc.d

2013-02-09 Thread Hajimu UMEMOTO
Author: ume
Date: Sat Feb  9 17:56:57 2013
New Revision: 246598
URL: http://svnweb.freebsd.org/changeset/base/246598

Log:
  MFC r246255: Use the default policy table of RFC 6724.

Modified:
  stable/9/etc/rc.d/ip6addrctl
Directory Properties:
  stable/9/etc/   (props changed)

Modified: stable/9/etc/rc.d/ip6addrctl
==
--- stable/9/etc/rc.d/ip6addrctlSat Feb  9 17:34:48 2013
(r246597)
+++ stable/9/etc/rc.d/ip6addrctlSat Feb  9 17:56:57 2013
(r246598)
@@ -29,11 +29,15 @@ ip6addrctl_prefer_ipv6()
afexists inet6 || return 0
 
ip6addrctl flush >/dev/null 2>&1
-   ip6addrctl add ::1/128  50  0
-   ip6addrctl add ::/0 40  1
-   ip6addrctl add 2002::/1630  2
-   ip6addrctl add ::/9620  3
-   ip6addrctl add :::0:0/9610  4
+   ip6addrctl add ::1/128   50  0
+   ip6addrctl add ::/0  40  1
+   ip6addrctl add :::0:0/96 35  4
+   ip6addrctl add 2002::/16 30  2
+   ip6addrctl add 2001::/32  5  5
+   ip6addrctl add fc00::/7   3 13
+   ip6addrctl add ::/96  1  3
+   ip6addrctl add fec0::/10  1 11
+   ip6addrctl add 3ffe::/16  1 12
checkyesno ip6addrctl_verbose && ip6addrctl
 }
 
@@ -42,11 +46,15 @@ ip6addrctl_prefer_ipv4()
afexists inet6 || return 0
 
ip6addrctl flush >/dev/null 2>&1
-   ip6addrctl add :::0:0/9650  0
-   ip6addrctl add ::1/128  40  1
-   ip6addrctl add ::/0 30  2
-   ip6addrctl add 2002::/1620  3
-   ip6addrctl add ::/9610  4
+   ip6addrctl add ::1/128   50  0
+   ip6addrctl add ::/0  40  1
+   ip6addrctl add :::0:0/96100  4
+   ip6addrctl add 2002::/16 30  2
+   ip6addrctl add 2001::/32  5  5
+   ip6addrctl add fc00::/7   3 13
+   ip6addrctl add ::/96  1  3
+   ip6addrctl add fec0::/10  1 11
+   ip6addrctl add 3ffe::/16  1 12
checkyesno ip6addrctl_verbose && ip6addrctl
 }
 
___
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-unsubscr...@freebsd.org"


Re: svn commit: r239356 - head/sbin/dhclient

2012-08-20 Thread Hajimu UMEMOTO
Hi,

>>>>> On Tue, 21 Aug 2012 05:03:11 +0400
>>>>> Andrey Chernov  said:

ache> Having dual-stack machine it seems proper way for me to run both DHCP and 
ache> DHCPv6 clients (net-mgmt/wide-dhcp? net/dhcp6?). But I fear they both 
will 
ache> interact with single /etc/resolv.conf overriding each other there.

FreeBSD 9 and above already have a feature to handle multiple source
of DNS address,; resolvconf(8).  Our dhclient(8) and rtsol(8) uses it
to write /etc/resolv.conf.

ache> As I already mention, perhaps it is router bug combined with the lack of 
ache> validity checking in dhclient itself. As result I currently have
ache> /etc/resolv.conf:
ache> nameserver 192.168.1.1
ache> nameserver 

Don't you see `# Generated by resolvconf' line in your generated
/etc/resolv.conf?
DHCP cannot carry an IPv6 address.
I suspect your router advertises an IPv6 address of your DNS server.
You can confirm where the DNS server addresss come from by executing
`resolvconf -l'.
The following is the output on my box for example:

ume@yuga:~% resolvconf -l
# resolv.conf from em0:dhcpv6
search mahoroba.org
nameserver 2001:2f0:104:8010::1
nameserver 2001:2f0:104:8010:221:5aff:feeb:183

# resolv.conf from em0:slaac:[fe80::218:71ff:feec:5271]
nameserver 2001:2f0:104:8010::1
search mahoroba.org

# resolv.conf from em0
search mahoroba.org
nameserver 192.168.100.59
nameserver 192.168.100.55 

My network announces DHCPv6 and my box is configured to use DHCPv6.
So, there are three sources for a DNS address, here.

Sincerely,

--
Hajimu UMEMOTO
u...@mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.mahoroba.org/~ume/
___
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-unsubscr...@freebsd.org"


Re: svn commit: r239356 - head/sbin/dhclient

2012-08-20 Thread Hajimu UMEMOTO
Hi,

>>>>> On Tue, 21 Aug 2012 08:45:53 +0400
>>>>> Andrey Chernov  said:

ache> resolvconf -l output:

ache> # resolv.conf from msk0
ache> search 
ache> nameserver 192.168.1.1

ache> # resolv.conf from msk0:slaac
ache> nameserver 

ache> (btw, what is slaac?)

It is abbreviation for StateLess Address AutoConfiguration described
in rfc 4862.
This RA option is described in rfc 5006 (IPv6 Router Advertisement
Option for DNS Configuration).

ache> And I want to override  
ache> with simple link-local IPv6 address of my router, i.e. fe80:...

I think your network admin setup to advertise the address.  Why do you
want to use link-local address, instead?

ache> Is it possible with resolvconf(8)?

resolvconf(8) doesn't have such rewrite feature.  However, rtsol(8)
has -R option to specify your own script to update /etc/resolv.conf.
You may want to write your own script to rewrite nameserver address
then pass it to resolvconf(8).

Sincerely,

--
Hajimu UMEMOTO
u...@mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.mahoroba.org/~ume/
___
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-unsubscr...@freebsd.org"


Re: svn commit: r239356 - head/sbin/dhclient

2012-08-20 Thread Hajimu UMEMOTO
Hi,

>>>>> On Tue, 21 Aug 2012 10:30:27 +0400
>>>>> Andrey Chernov  said:

ache> I am network admin, but what router advertise is out my easy control 
ache> (fixing configs in the Linux router's FS or even rebuilding router 
ache> components is needed, I don't want to touch this hardware).

You may want to try -u option of rtsol(8) to determine which router
advertises it.  It saves link-local address of the advertising router
in interface name.  You can see it by `resolvconf -l'.

ache> I want override because router runs dnsmasq with caching (on both its 
IPv4 
ache> and IPv6 adresses), and NS it advertise goes through tunnel each time 
ache> without caching in the router.

Okay, thanks.

Sincerely,

--
Hajimu UMEMOTO
u...@mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.mahoroba.org/~ume/
___
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-unsubscr...@freebsd.org"


Re: svn commit: r239356 - head/sbin/dhclient

2012-08-22 Thread Hajimu UMEMOTO
Hi,

>>>>> On Wed, 22 Aug 2012 04:06:46 +0400
>>>>> Andrey Chernov  said:

ache> BTW, I notice that link-local router address behavior is 
ache> strange and inconsistant for both 'host -6' and 'dig -6' commands.
ache> host -6 example.com fe80::
ache> dig -6 @fe80:: example.com
ache> both hangs, but in the same time
ache> host -6 example.com fe80::%
ache> dig -6 @fe80::% example.com
ache> works!
ache> host -6 example.com fe80::%1
ache> dig -6 #fe80::%1 example.com
ache> works too. Not understanding addresses without % or %1 looks like 
ache> routing problems, but I don't know where to fix it.

A link-local address has a scope; an interface here.  You cannot omit
it on FreeBSD by default.  To be able to omit it, specify something
like ipv6_default_interface="em0" in your /etc/rc.conf.

ache> So, I try to use 
ache> nameserver fe80::% (or with %1 suffix)
ache> in my resolv.conf, as result
ache> host -6 example.com
ache> dig -6 example.com
ache> (without NS specified) both hangs despite they working when exact the 
same 
ache> NS address is given in their command lines.

Our stub resolver in libc should work with a link-local address as
nameserver.  However, host(1) and dig(1) don't use the stub resolver
in libc, and use its own resolver.  I suspect host(1) and dig(1) have
some problem in handling a link-local address.
In anyway, I don't recommend to use a link-local address for DNS.

Sincerely,

--
Hajimu UMEMOTO
u...@mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.mahoroba.org/~ume/
___
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-unsubscr...@freebsd.org"


Re: svn commit: r239356 - head/sbin/dhclient

2012-08-23 Thread Hajimu UMEMOTO
Hi,

>>>>> On Thu, 23 Aug 2012 08:41:37 +0400
>>>>> Andrey Chernov  said:

ache> On Thu, Aug 23, 2012 at 12:27:46AM +0900, Hajimu UMEMOTO wrote:
> A link-local address has a scope; an interface here.  You cannot omit
> it on FreeBSD by default.  To be able to omit it, specify something
> like ipv6_default_interface="em0" in your /etc/rc.conf.

ache> Please enlighten me a bit. 
ache> RFC 4007 "11.6. Omitting Zone Indices" states:
ache>   "The format defined in this document does not intend to invalidate the
ache>original format for non-global addresses; that is, the format without
ache>the zone index portion.  As described in Section 6, in some common
ache>cases with the notion of the default zone index, there can be no
ache>ambiguity about scope zones.  In such an environment, the
ache>implementation can omit the "%" part."

ache> Does absolutely trusted IPv6 local net using link-local addresses only 
ache> falls in that case? If yes, is there a way to make address scope optional 
ache> for all link-local addresses in FreeBSD?

FreeBSD doesn't have a feature to define a zone manually.
If a node has more than one interfaces, a link-local address without
zone identifer has ambiguity.  If you mean `all link-local addresses'
are within one interface, yes, you can omit zone identifer by setting
ipv6_default_interface'

ache> Are link-local addresses ever usable for DNS or not due to their 
ache> % part? F.e. for the case there is no global IPv6 net assigned 
at 
ache> all but pure isolated IPv6 local network.

> In anyway, I don't recommend to use a link-local address for DNS.

ache> Is it only due to their scope part or other reasons exists too?

As you saw, dig(1) and host(1) doesn't work well with a link-local
address.
Not only a zone identifier, but also some implementation may handle a
link-local address (fe80:: prefix) as special.

Sincerely,

--
Hajimu UMEMOTO
u...@mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.mahoroba.org/~ume/
___
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-unsubscr...@freebsd.org"


svn commit: r188316 - head/lib/libc/net

2009-02-08 Thread Hajimu UMEMOTO
Author: ume
Date: Sun Feb  8 16:58:05 2009
New Revision: 188316
URL: http://svn.freebsd.org/changeset/base/188316

Log:
  Shutup warning for DNAME RR.
  
  PR:   bin/127591
  Submitted by: "Eugene M. Kim" <20080111.freebsd.org__at__ab.ote.we.lv>
  MFC after:1 week

Modified:
  head/lib/libc/net/getaddrinfo.c
  head/lib/libc/net/gethostbydns.c

Modified: head/lib/libc/net/getaddrinfo.c
==
--- head/lib/libc/net/getaddrinfo.c Sun Feb  8 15:38:31 2009
(r188315)
+++ head/lib/libc/net/getaddrinfo.c Sun Feb  8 16:58:05 2009
(r188316)
@@ -1863,7 +1863,8 @@ getanswer(const querybuf *answer, int an
}
} else if (type != qtype) {
 #ifdef DEBUG
-   if (type != T_KEY && type != T_SIG)
+   if (type != T_KEY && type != T_SIG &&
+   type != ns_t_dname)
syslog(LOG_NOTICE|LOG_AUTH,
   "gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"",
   qname, p_class(C_IN), p_type(qtype),

Modified: head/lib/libc/net/gethostbydns.c
==
--- head/lib/libc/net/gethostbydns.cSun Feb  8 15:38:31 2009
(r188315)
+++ head/lib/libc/net/gethostbydns.cSun Feb  8 16:58:05 2009
(r188316)
@@ -294,7 +294,7 @@ gethostanswer(const querybuf *answer, in
continue;
}
if (type != qtype) {
-   if (type != T_SIG)
+   if (type != T_SIG && type != ns_t_dname)
syslog(LOG_NOTICE|LOG_AUTH,
"gethostby*.gethostanswer: asked for \"%s %s %s\", got type \"%s\"",
   qname, p_class(C_IN), p_type(qtype),
___
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-unsubscr...@freebsd.org"


svn commit: r188690 - in stable/7/lib/libc: . net string

2009-02-16 Thread Hajimu UMEMOTO
Author: ume
Date: Mon Feb 16 18:24:48 2009
New Revision: 188690
URL: http://svn.freebsd.org/changeset/base/188690

Log:
  MFH 188316: Shutup warning for DNAME RR.
  
  PR:   bin/127591
  Submitted by: "Eugene M. Kim" <20080111.freebsd.org__at__ab.ote.we.lv>

Modified:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/net/getaddrinfo.c
  stable/7/lib/libc/net/gethostbydns.c
  stable/7/lib/libc/string/ffsll.c   (props changed)
  stable/7/lib/libc/string/flsll.c   (props changed)

Modified: stable/7/lib/libc/net/getaddrinfo.c
==
--- stable/7/lib/libc/net/getaddrinfo.c Mon Feb 16 18:07:23 2009
(r188689)
+++ stable/7/lib/libc/net/getaddrinfo.c Mon Feb 16 18:24:48 2009
(r188690)
@@ -1884,7 +1884,8 @@ getanswer(const querybuf *answer, int an
}
} else if (type != qtype) {
 #ifdef DEBUG
-   if (type != T_KEY && type != T_SIG)
+   if (type != T_KEY && type != T_SIG &&
+   type != ns_t_dname)
syslog(LOG_NOTICE|LOG_AUTH,
   "gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"",
   qname, p_class(C_IN), p_type(qtype),

Modified: stable/7/lib/libc/net/gethostbydns.c
==
--- stable/7/lib/libc/net/gethostbydns.cMon Feb 16 18:07:23 2009
(r188689)
+++ stable/7/lib/libc/net/gethostbydns.cMon Feb 16 18:24:48 2009
(r188690)
@@ -294,7 +294,7 @@ gethostanswer(const querybuf *answer, in
continue;
}
if (type != qtype) {
-   if (type != T_SIG)
+   if (type != T_SIG && type != ns_t_dname)
syslog(LOG_NOTICE|LOG_AUTH,
"gethostby*.gethostanswer: asked for \"%s %s %s\", got type \"%s\"",
   qname, p_class(C_IN), p_type(qtype),
___
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-unsubscr...@freebsd.org"


svn commit: r188691 - in stable/6/lib/libc: . inet net sys

2009-02-16 Thread Hajimu UMEMOTO
Author: ume
Date: Mon Feb 16 18:32:28 2009
New Revision: 188691
URL: http://svn.freebsd.org/changeset/base/188691

Log:
  MFH 188316: Shutup warning for DNAME RR.
  
  PR:   bin/127591
  Submitted by: "Eugene M. Kim" <20080111.freebsd.org__at__ab.ote.we.lv>

Modified:
  stable/6/lib/libc/   (props changed)
  stable/6/lib/libc/inet/inet_net_pton.c   (props changed)
  stable/6/lib/libc/net/getaddrinfo.c
  stable/6/lib/libc/net/gethostbydns.c
  stable/6/lib/libc/sys/   (props changed)

Modified: stable/6/lib/libc/net/getaddrinfo.c
==
--- stable/6/lib/libc/net/getaddrinfo.c Mon Feb 16 18:24:48 2009
(r188690)
+++ stable/6/lib/libc/net/getaddrinfo.c Mon Feb 16 18:32:28 2009
(r188691)
@@ -1686,7 +1686,8 @@ getanswer(const querybuf *answer, int an
}
} else if (type != qtype) {
 #ifdef DEBUG
-   if (type != T_KEY && type != T_SIG)
+   if (type != T_KEY && type != T_SIG &&
+   type != ns_t_dname)
syslog(LOG_NOTICE|LOG_AUTH,
   "gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"",
   qname, p_class(C_IN), p_type(qtype),

Modified: stable/6/lib/libc/net/gethostbydns.c
==
--- stable/6/lib/libc/net/gethostbydns.cMon Feb 16 18:24:48 2009
(r188690)
+++ stable/6/lib/libc/net/gethostbydns.cMon Feb 16 18:32:28 2009
(r188691)
@@ -298,7 +298,7 @@ gethostanswer(const querybuf *answer, in
continue;
}
if (type != qtype) {
-   if (type != T_SIG)
+   if (type != T_SIG && type != ns_t_dname)
syslog(LOG_NOTICE|LOG_AUTH,
"gethostby*.gethostanswer: asked for \"%s %s %s\", got type \"%s\"",
   qname, p_class(C_IN), p_type(qtype),
___
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-unsubscr...@freebsd.org"


svn commit: r199128 - head/lib/libc/nls

2009-11-09 Thread Hajimu UMEMOTO
Author: ume
Date: Tue Nov 10 03:56:51 2009
New Revision: 199128
URL: http://svn.freebsd.org/changeset/base/199128

Log:
  Add Japanese catalogue entries for newer errnos: EBADMSG, EMULTIHOP,
  ENOLINK, EPROTO, ENOTCAPABLE.

Modified:
  head/lib/libc/nls/ja_JP.UTF-8.msg
  head/lib/libc/nls/ja_JP.eucJP.msg

Modified: head/lib/libc/nls/ja_JP.UTF-8.msg
==
--- head/lib/libc/nls/ja_JP.UTF-8.msg   Tue Nov 10 03:18:49 2009
(r199127)
+++ head/lib/libc/nls/ja_JP.UTF-8.msg   Tue Nov 10 03:56:51 2009
(r199128)
@@ -181,6 +181,16 @@ $ ENOATTR
 87 そのような属性はありません
 $ EDOOFUS
 88 プログラミングエラーです
+$ EBADMSG
+89 無効なメッセージです
+$ EMULTIHOP
+90 マルチホップが試みられました
+$ ENOLINK
+91 リンクが切断されています
+$ EPROTO
+92 プロトコルエラーです
+$ ENOTCAPABLE
+93 ケーパビリティが不足です
 $
 $ strsignal() support catalog
 $

Modified: head/lib/libc/nls/ja_JP.eucJP.msg
==
--- head/lib/libc/nls/ja_JP.eucJP.msg   Tue Nov 10 03:18:49 2009
(r199127)
+++ head/lib/libc/nls/ja_JP.eucJP.msg   Tue Nov 10 03:56:51 2009
(r199128)
@@ -181,6 +181,16 @@ $ ENOATTR
 87 ���Τ褦��°���Ϥޤ���
 $ EDOOFUS
 88 �ץߥ󥰥��顼�Ǥ�
+$ EBADMSG
+89 ̵���ʥ��å��Ǥ�
+$ EMULTIHOP
+90 �ޥۥåפߤޤ���
+$ ENOLINK
+91 ���󥯤ǤƤ��ޤ�
+$ EPROTO
+92 �ץ��ȥ��륨�顼�Ǥ�
+$ ENOTCAPABLE
+93 �ѥӥ��ƥ�­�Ǥ�
 $
 $ strsignal() support catalog
 $
___
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-unsubscr...@freebsd.org"


svn commit: r199173 - head/sys/netinet6

2009-11-11 Thread Hajimu UMEMOTO
Author: ume
Date: Wed Nov 11 08:28:18 2009
New Revision: 199173
URL: http://svn.freebsd.org/changeset/base/199173

Log:
  CURVNET_RESTORE() was not called in certain cases.
  
  MFC after:3 days

Modified:
  head/sys/netinet6/nd6.c

Modified: head/sys/netinet6/nd6.c
==
--- head/sys/netinet6/nd6.c Wed Nov 11 08:27:09 2009(r199172)
+++ head/sys/netinet6/nd6.c Wed Nov 11 08:28:18 2009(r199173)
@@ -582,10 +582,10 @@ nd6_llinfo_timer(void *arg)
}
break;
}
-   CURVNET_RESTORE();
 done:
if (ln != NULL)
LLE_FREE(ln);
+   CURVNET_RESTORE();
 }
 
 
___
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-unsubscr...@freebsd.org"


svn commit: r199179 - head/share/timedef

2009-11-11 Thread Hajimu UMEMOTO
Author: ume
Date: Wed Nov 11 11:24:02 2009
New Revision: 199179
URL: http://svn.freebsd.org/changeset/base/199179

Log:
  Add unit to the short month names for Japanese locales.
  Without unit, the output of the application like ls(1)
  is complicated.
  
  Reviewed by:  nork
  MFC after:1 week

Modified:
  head/share/timedef/ja_JP.SJIS.src
  head/share/timedef/ja_JP.UTF-8.src
  head/share/timedef/ja_JP.eucJP.src

Modified: head/share/timedef/ja_JP.SJIS.src
==
--- head/share/timedef/ja_JP.SJIS.src   Wed Nov 11 11:10:36 2009
(r199178)
+++ head/share/timedef/ja_JP.SJIS.src   Wed Nov 11 11:24:02 2009
(r199179)
@@ -5,18 +5,18 @@
 #
 # Short month names
 #
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
+ 1��
+ 2��
+ 3��
+ 4��
+ 5��
+ 6��
+ 7��
+ 8��
+ 9��
+10��
+11��
+12��
 #
 # Long month names (as in a date)
 #

Modified: head/share/timedef/ja_JP.UTF-8.src
==
--- head/share/timedef/ja_JP.UTF-8.src  Wed Nov 11 11:10:36 2009
(r199178)
+++ head/share/timedef/ja_JP.UTF-8.src  Wed Nov 11 11:24:02 2009
(r199179)
@@ -4,18 +4,18 @@
 # WARNING: empty lines are essential too
 #
 # Short month names
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
+ 1月
+ 2月
+ 3月
+ 4月
+ 5月
+ 6月
+ 7月
+ 8月
+ 9月
+10月
+11月
+12月
 #
 # Long month names (as in a date)
 #

Modified: head/share/timedef/ja_JP.eucJP.src
==
--- head/share/timedef/ja_JP.eucJP.src  Wed Nov 11 11:10:36 2009
(r199178)
+++ head/share/timedef/ja_JP.eucJP.src  Wed Nov 11 11:24:02 2009
(r199179)
@@ -4,18 +4,18 @@
 # WARNING: empty lines are essential too
 #
 # Short month names
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
-10
-11
-12
+ 1��
+ 2��
+ 3��
+ 4��
+ 5��
+ 6��
+ 7��
+ 8��
+ 9��
+10��
+11��
+12��
 #
 # Long month names (as in a date)
 #
___
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-unsubscr...@freebsd.org"


svn commit: r199188 - head/lib/libc/net

2009-11-11 Thread Hajimu UMEMOTO
Author: ume
Date: Wed Nov 11 15:21:06 2009
New Revision: 199188
URL: http://svn.freebsd.org/changeset/base/199188

Log:
  ANSIfy.
  
  MFC after:1 week

Modified:
  head/lib/libc/net/ip6opt.c

Modified: head/lib/libc/net/ip6opt.c
==
--- head/lib/libc/net/ip6opt.c  Wed Nov 11 15:00:56 2009(r199187)
+++ head/lib/libc/net/ip6opt.c  Wed Nov 11 15:21:06 2009(r199188)
@@ -55,8 +55,7 @@ static void inet6_insert_padopt(u_char *
  * byte, the length byte, and the option data.
  */
 int
-inet6_option_space(nbytes)
-   int nbytes;
+inet6_option_space(int nbytes)
 {
nbytes += 2;/* we need space for nxt-hdr and length fields */
return(CMSG_SPACE((nbytes + 7) & ~7));
@@ -68,10 +67,7 @@ inet6_option_space(nbytes)
  * success or -1 on an error.
  */
 int
-inet6_option_init(bp, cmsgp, type)
-   void *bp;
-   struct cmsghdr **cmsgp;
-   int type;
+inet6_option_init(void *bp, struct cmsghdr **cmsgp, int type)
 {
struct cmsghdr *ch = (struct cmsghdr *)bp;
 
@@ -98,11 +94,8 @@ inet6_option_init(bp, cmsgp, type)
  * earlier.  It must have a value between 0 and 7, inclusive.
  */
 int
-inet6_option_append(cmsg, typep, multx, plusy)
-   struct cmsghdr *cmsg;
-   const u_int8_t *typep;
-   int multx;
-   int plusy;
+inet6_option_append(struct cmsghdr *cmsg, const u_int8_t *typep, int multx,
+int plusy)
 {
int padlen, optlen, off;
u_char *bp = (u_char *)cmsg + cmsg->cmsg_len;
@@ -171,11 +164,7 @@ inet6_option_append(cmsg, typep, multx, 
  * 
  */
 u_int8_t *
-inet6_option_alloc(cmsg, datalen, multx, plusy)
-   struct cmsghdr *cmsg;
-   int datalen;
-   int multx;
-   int plusy;
+inet6_option_alloc(struct cmsghdr *cmsg, int datalen, int multx, int plusy)
 {
int padlen, off;
u_int8_t *bp = (u_char *)cmsg + cmsg->cmsg_len;
@@ -238,9 +227,7 @@ inet6_option_alloc(cmsg, datalen, multx,
  * (RFC 2292, 6.3.5)
  */
 int
-inet6_option_next(cmsg, tptrp)
-   const struct cmsghdr *cmsg;
-   u_int8_t **tptrp;
+inet6_option_next(const struct cmsghdr *cmsg, u_int8_t **tptrp)
 {
struct ip6_ext *ip6e;
int hdrlen, optlen;
@@ -296,10 +283,7 @@ inet6_option_next(cmsg, tptrp)
  *   it's a typo. The variable should be type of u_int8_t **.
  */
 int
-inet6_option_find(cmsg, tptrp, type)
-   const struct cmsghdr *cmsg;
-   u_int8_t **tptrp;
-   int type;
+inet6_option_find(const struct cmsghdr *cmsg, u_int8_t **tptrp, int type)
 {
struct ip6_ext *ip6e;
int hdrlen, optlen;
@@ -352,8 +336,7 @@ inet6_option_find(cmsg, tptrp, type)
  * calculated length and the limitation of the buffer.
  */
 static int
-ip6optlen(opt, lim)
-   u_int8_t *opt, *lim;
+ip6optlen(u_int8_t *opt, u_int8_t *lim)
 {
int optlen;
 
___
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-unsubscr...@freebsd.org"


  1   2   3   4   >