Re: Important: following -current update!

2013-04-16 Thread Michał Markowski
$ cd /usr/src/sys/arch/`uname -m`/config
cd: no such file or directory: /usr/src/sys/arch/i386/config
$ cd /usr/src/sys/arch/`uname -m`/conf
$


--- /cvs/www/faq/current.html   Tue Apr 16 11:54:22 2013
+++ /tmp/current.html   Tue Apr 16 12:10:27 2013
@@ -597,7 +597,7 @@
 ul
 liUpdate entire source tree using cvs
 liconfigure and build a new kernel:
-blockquotepreb   cd /usr/src/sys/arch/`uname -m`/config
+blockquotepreb   cd /usr/src/sys/arch/`uname -m`/conf
config GENERIC  # or GENERIC.MP or whatever config you use
cd ../compile/GENERIC   # or GENERIC.MP or ...
make clean


--
Michał Markowski



Re: Bug with setlocale and __mb_cur_max

2013-04-16 Thread Vladimir Támara Patiño

On Wed, Apr 10, 2013 at 01:48:03PM +0200, Stefan Sperling wrote:

 +  return 1;  // If not UTF8 then single byte encoding

No C++ comments, please!


The attached patch doens't have C++ comments.


--
Dios, gracias por tu amor infinito.
--  
 Vladimir Támara Patiño.  http://vtamara.pasosdeJesus.org/

 http://www.pasosdejesus.org/dominio_publico_colombia.html

Common subdirectories: /usr/src-orig/lib/libc/citrus/CVS and 
/usr/src/lib/libc/citrus/CVS
diff -u -x *~ /usr/src-orig/lib/libc/citrus/citrus_ctype.c 
/usr/src/lib/libc/citrus/citrus_ctype.c
--- /usr/src-orig/lib/libc/citrus/citrus_ctype.cSat Feb  9 14:26:51 2013
+++ /usr/src/lib/libc/citrus/citrus_ctype.c Wed Apr 10 07:36:58 2013
@@ -45,15 +45,24 @@
 };
 
 int
+_citrus_ctype_mb_cur_max(char const *encname)
+{
+   if (strcmp(encname, UTF8) == 0) {
+   return _CITRUS_UTF8_MB_CUR_MAX;
+   }
+   return 1;  /* If not UTF8 then single byte encoding */
+}
+
+int
 _citrus_ctype_open(struct _citrus_ctype_rec **rcc, char const *encname)
 {
if (!strcmp(encname, NONE)) {
*rcc = _citrus_ctype_none;
-   __mb_cur_max = 1;
+   __mb_cur_max = _citrus_ctype_mb_cur_max(encname);
return (0);
} else if (!strcmp(encname, UTF8)) {
*rcc = _citrus_ctype_utf8;
-   __mb_cur_max = _CITRUS_UTF8_MB_CUR_MAX;
+   __mb_cur_max = _citrus_ctype_mb_cur_max(encname);
return (0);
}
 
diff -u -x *~ /usr/src-orig/lib/libc/citrus/citrus_ctype.h 
/usr/src/lib/libc/citrus/citrus_ctype.h
--- /usr/src-orig/lib/libc/citrus/citrus_ctype.hMon Aug  2 13:05:22 2010
+++ /usr/src/lib/libc/citrus/citrus_ctype.h Wed Apr 10 05:33:22 2013
@@ -35,6 +35,7 @@
 
 extern struct _citrus_ctype_rec _citrus_ctype_none;
 
+int _citrus_ctype_mb_cur_max(char const *);
 int _citrus_ctype_open(struct _citrus_ctype_rec **, char const *);
 
 #endif
--- /usr/src-orig/lib/libc/locale/setrunelocale.c   Sat Feb  9 14:26:52 2013
+++ /usr/src/lib/libc/locale/setrunelocale.cWed Apr 10 05:35:23 2013
@@ -100,6 +100,7 @@
 #include unistd.h
 #include locale.h
 #include citrus/citrus_ctype.h
+#include citrus/citrus_utf8.h
 #include rune_local.h
 
 struct localetable {
@@ -195,6 +196,7 @@
 
 found:
_CurrentRuneLocale = rl;
+   __mb_cur_max = _citrus_ctype_mb_cur_max(rl-rl_encoding);
 
return 0;
 }


Merge inet_ntoa() and inet_ntoa4()

2013-04-16 Thread Martin Pieuchot
Diff below merge two slightly different versions of our kernel's
inet_ntoa(). I picked 8 rooms for ip4buf to be consistent with
what ip6_sprintf() does.

ok?

Index: netinet/ip_input.c
===
RCS file: /home/ncvs/src/sys/netinet/ip_input.c,v
retrieving revision 1.208
diff -u -p -r1.208 ip_input.c
--- netinet/ip_input.c  10 Apr 2013 08:50:59 -  1.208
+++ netinet/ip_input.c  15 Apr 2013 12:03:46 -
@@ -134,16 +134,26 @@ struct ipstat ipstat;
 
 intin_ouraddr(struct in_addr, struct mbuf *);
 
+
+/* Allow 8 sucessive calls of inet_ntoa() before trashing the value. */
+static int ip4round = 0;
+static charip4buf[8][16];
+
+/*
+ * Return a printable string for the IPv4 address.
+ */
 char *
-inet_ntoa(ina)
-   struct in_addr ina;
+inet_ntoa(struct in_addr ina)
 {
-   static char buf[4*sizeof 123];
unsigned char *ucp = (unsigned char *)ina;
+   char *buf;
+
+   ip4round = (ip4round + 1)  7;
+   buf = ip4buf[ip4round];
+
+   snprintf(buf, sizeof(ip4buf[0]), %d.%d.%d.%d,
+   ucp[0]  0xff, ucp[1]  0xff, ucp[2]  0xff, ucp[3]  0xff);
 
-   snprintf(buf, sizeof buf, %d.%d.%d.%d,
-   ucp[0]  0xff, ucp[1]  0xff,
-   ucp[2]  0xff, ucp[3]  0xff);
return (buf);
 }
 
Index: netinet/ip_ipsp.c
===
RCS file: /home/ncvs/src/sys/netinet/ip_ipsp.c,v
retrieving revision 1.189
diff -u -p -r1.189 ip_ipsp.c
--- netinet/ip_ipsp.c   11 Apr 2013 12:06:25 -  1.189
+++ netinet/ip_ipsp.c   15 Apr 2013 12:03:46 -
@@ -981,21 +981,6 @@ tdb_add_inp(struct tdb *tdb, struct inpc
}
 }
 
-/* Return a printable string for the IPv4 address. */
-char *
-inet_ntoa4(struct in_addr ina)
-{
-   static char buf[4][4 * sizeof 123 + 4];
-   unsigned char *ucp = (unsigned char *) ina;
-   static int i = 3;
-
-   i = (i + 1) % 4;
-   snprintf(buf[i], sizeof buf[0], %d.%d.%d.%d,
-   ucp[0]  0xff, ucp[1]  0xff,
-   ucp[2]  0xff, ucp[3]  0xff);
-   return (buf[i]);
-}
-
 /* Return a printable string for the address. */
 char *
 ipsp_address(union sockaddr_union sa)
@@ -1003,7 +988,7 @@ ipsp_address(union sockaddr_union sa)
switch (sa.sa.sa_family) {
 #ifdef INET
case AF_INET:
-   return inet_ntoa4(sa.sin.sin_addr);
+   return inet_ntoa(sa.sin.sin_addr);
 #endif /* INET */
 
 #ifdef INET6
Index: netinet/ip_ipsp.h
===
RCS file: /home/ncvs/src/sys/netinet/ip_ipsp.h,v
retrieving revision 1.154
diff -u -p -r1.154 ip_ipsp.h
--- netinet/ip_ipsp.h   11 Apr 2013 12:06:25 -  1.154
+++ netinet/ip_ipsp.h   15 Apr 2013 12:03:46 -
@@ -502,7 +502,6 @@ do {
\
 
 /* Misc. */
 uint8_tget_sa_require(struct inpcb *);
-char   *inet_ntoa4(struct in_addr);
 char   *ipsp_address(union sockaddr_union);
 
 /* TDB management routines */
Index: netinet/ipsec_input.c
===
RCS file: /home/ncvs/src/sys/netinet/ipsec_input.c,v
retrieving revision 1.113
diff -u -p -r1.113 ipsec_input.c
--- netinet/ipsec_input.c   11 Apr 2013 12:06:25 -  1.113
+++ netinet/ipsec_input.c   15 Apr 2013 12:03:46 -
@@ -407,7 +407,7 @@ ipsec_common_input_cb(struct mbuf *m, st
DPRINTF((ipsec_common_input_cb(): inner 
source address %s doesn't correspond to 
expected proxy source %s, SA %s/%08x\n,
-   inet_ntoa4(ipn.ip_src),
+   inet_ntoa(ipn.ip_src),
ipsp_address(tdbp-tdb_proxy),
ipsp_address(tdbp-tdb_dst),
ntohl(tdbp-tdb_spi)));
@@ -514,7 +514,7 @@ ipsec_common_input_cb(struct mbuf *m, st
DPRINTF((ipsec_common_input_cb(): inner 
source address %s doesn't correspond to 
expected proxy source %s, SA %s/%08x\n,
-   inet_ntoa4(ipn.ip_src),
+   inet_ntoa(ipn.ip_src),
ipsp_address(tdbp-tdb_proxy),
ipsp_address(tdbp-tdb_dst),
ntohl(tdbp-tdb_spi)));



typos in /cvs/src/sys/dev/pci/if_em.h

2013-04-16 Thread Diego Casati
hi,

while reading if_em.h i've bumped into a few typos.

ok?

# cvs diff -Nup if_em.h 
Index: if_em.h
===
RCS file: /cvs/src/sys/dev/pci/if_em.h,v
retrieving revision 1.48
diff -u -p -r1.48 if_em.h
--- if_em.h 7 Sep 2010 16:21:44 -   1.48
+++ if_em.h 16 Apr 2013 19:25:56 -
@@ -92,7 +92,7 @@ POSSIBILITY OF SUCH DAMAGE.
  *   Increasing this value allows the driver to queue more transmits. Each
  *   descriptor is 16 bytes.
  *   Since TDLEN should be multiple of 128bytes, the number of transmit
- *   desscriptors should meet the following condition.
+ *   descriptors should meet the following condition.
  *  (num_tx_desc * sizeof(struct em_tx_desc)) % 128 == 0
  */
 #define EM_MAX_TXD_82543   256
@@ -108,7 +108,7 @@ POSSIBILITY OF SUCH DAMAGE.
  *   Each descriptor is 16 bytes.  A receive buffer is also allocated for each
  *   descriptor. The maximum MTU size is 16110.
  *   Since TDLEN should be multiple of 128bytes, the number of transmit
- *   desscriptors should meet the following condition.
+ *   descriptors should meet the following condition.
  *  (num_tx_desc * sizeof(struct em_tx_desc)) % 128 == 0
  */
 #define EM_MAX_RXD_82543   256