svn commit: r228562 - head/sys/sys

2011-12-16 Thread Ed Schouten
Author: ed
Date: Fri Dec 16 08:22:23 2011
New Revision: 228562
URL: http://svn.freebsd.org/changeset/base/228562

Log:
  Process a lot of feedback from bde@ on sys/cdefs.h:
  
  - Add __alignof() for non-GCC and GCC  2.95.
  - Simply implement the C1X keywords on top of the existing __macros.
  - Add struct __hack to _Static_assert to require consumers to add a
semicolon.
  - Add an extra underscore to __assert_ to allow it to be combined with
locally defined versions of CTASSERT in the tree.
  - Add proper casts to __offsetof() to make it work for cases where
sizeof(size_t) != sizeof(uintptr_t).
  - Globally replace size_t and uintptr_t by __size_t and __uintptr_t.
This removes the dependency on sys/types.h / stdint.h. Practically
any header file ends up including machines/_types.h somehow.
  - Change argument names of macros to match with the rest of the file.
  
  MFC after:3 months

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==
--- head/sys/sys/cdefs.hFri Dec 16 02:09:51 2011(r228561)
+++ head/sys/sys/cdefs.hFri Dec 16 08:22:23 2011(r228562)
@@ -218,6 +218,10 @@
 #endif
 #endif
 
+#if !__GNUC_PREREQ__(2, 95)
+#define__alignof(x)__offsetof(struct { char __a; x __b; }, __b)
+#endif
+
 /*
  * Keywords added in C1X.
  */
@@ -230,24 +234,17 @@
 #elif defined(__STDC_VERSION__)  __STDC_VERSION__  201000L
 /* Do nothing.  They are language keywords. */
 #else
-/* Not supported.  Implement them manually. */
-#ifdef __GNUC__
-#define_Alignas(e) __attribute__((__aligned__(e)))
-#define_Alignof(e) __alignof__(e)
-#define_Noreturn   __attribute__((__noreturn__))
+/* Not supported.  Implement them using our versions. */
+#define_Alignas(x) __aligned(x)
+#define_Alignof(x) __alignof(x)
+#define_Noreturn   __dead2
 #define_Thread_local   __thread
-#else
-#define_Alignas(e)
-#define_Alignof(e) __offsetof(struct { char __a; e __b; }, 
__b)
-#define_Noreturn
-#define_Thread_local
-#endif
 #ifdef __COUNTER__
-#define_Static_assert(e, s)__Static_assert(e, __COUNTER__)
-#define__Static_assert(e, c)   ___Static_assert(e, c)
-#define___Static_assert(e, c)  typedef char __assert ## c[(e) ? 1 : -1]
+#define_Static_assert(x, y)__Static_assert(x, __COUNTER__)
+#define__Static_assert(x, y)   ___Static_assert(x, y)
+#define___Static_assert(x, y)  typedef char __assert_ ## y[(x) ? 1 : 
-1]
 #else
-#define_Static_assert(e, s)
+#define_Static_assert(x, y)struct __hack
 #endif
 #endif
 
@@ -363,10 +360,11 @@
 #define __offsetof(type, field) __builtin_offsetof(type, field)
 #else
 #ifndef __cplusplus
-#define__offsetof(type, field) ((size_t)(((type *)0)-field))
+#define__offsetof(type, field) \
+   ((__size_t)(__uintptr_t)((const volatile void *)((type *)0)-member))
 #else
 #define __offsetof(type, field)\
-  (__offsetof__ (reinterpret_cast size_t \
+  (__offsetof__ (reinterpret_cast __size_t   \
  (reinterpret_cast const volatile char \
   (static_casttype * (0)-field
 #endif
@@ -495,15 +493,15 @@
 #endif
 
 #ifndef__DECONST
-#define__DECONST(type, var)((type)(uintptr_t)(const void *)(var))
+#define__DECONST(type, var)((type)(__uintptr_t)(const void *)(var))
 #endif
 
 #ifndef__DEVOLATILE
-#define__DEVOLATILE(type, var) ((type)(uintptr_t)(volatile void 
*)(var))
+#define__DEVOLATILE(type, var) ((type)(__uintptr_t)(volatile void 
*)(var))
 #endif
 
 #ifndef__DEQUALIFY
-#define__DEQUALIFY(type, var)  ((type)(uintptr_t)(const volatile void 
*)(var))
+#define__DEQUALIFY(type, var)  ((type)(__uintptr_t)(const volatile 
void *)(var))
 #endif
 
 /*-
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228563 - head/sys/conf

2011-12-16 Thread Gleb Smirnoff
Author: glebius
Date: Fri Dec 16 08:27:04 2011
New Revision: 228563
URL: http://svn.freebsd.org/changeset/base/228563

Log:
  Fix my braino in description of RADIX_MPATH.

Modified:
  head/sys/conf/NOTES

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Fri Dec 16 08:22:23 2011(r228562)
+++ head/sys/conf/NOTES Fri Dec 16 08:27:04 2011(r228563)
@@ -916,7 +916,7 @@ device  lagg
 # for sockets with the SO_DEBUG option set, which can then be examined
 # using the trpt(8) utility.
 #
-# RADIX_MPATH provides support for multiple forwarding tables.
+# RADIX_MPATH provides support for equal-cost multi-path routing.
 #
 optionsMROUTING# Multicast routing
 optionsIPFIREWALL  #firewall
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r223637 - in head: . contrib/pf/authpf contrib/pf/ftp-proxy contrib/pf/man contrib/pf/pfctl contrib/pf/pflogd sbin/pflogd sys/conf sys/contrib/altq/altq sys/contrib/pf/net sys/modules

2011-12-16 Thread Bjoern A. Zeeb
On 16. Dec 2011, at 02:58 , Peter Jeremy wrote:

 On 2011-Jun-28 11:57:25 +, Bjoern A. Zeeb b...@freebsd.org wrote:
 Author: bz
 Date: Tue Jun 28 11:57:25 2011
 New Revision: 223637
 URL: http://svn.freebsd.org/changeset/base/223637
 
 Log:
 Update packet filter (pf) code to OpenBSD 4.5.
 
 Further to my mail last Wednesday, I've found nested #ifdef __FreeBSD__
 conditionals in pf_ioctl.c as well - it looks like conditional code was
 added to support network stack virtualisation without noting that the
 code was already protectd by a #ifdef __FreeBSD__.

I have run unifdef on the code before but didn't want to do a sweeping
commit before 9.0 was handled.  The virtualization #ifdefs should go anyway
from the middle of the code and be done with the #define so that Open could
easily pick it up if we'd be at the same level.

Expect that this will be dealt with eventually.

-- 
Bjoern A. Zeeb You have to have visions!
 Stop bit received. Insert coin for new address family.

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r228562 - head/sys/sys

2011-12-16 Thread Tijl Coosemans
On Friday 16 December 2011 09:22:24 Ed Schouten wrote:
 Author: ed
 Date: Fri Dec 16 08:22:23 2011
 New Revision: 228562
 URL: http://svn.freebsd.org/changeset/base/228562
 
 Log:
   Process a lot of feedback from bde@ on sys/cdefs.h:
   
   - Add __alignof() for non-GCC and GCC  2.95.
   - Simply implement the C1X keywords on top of the existing __macros.
   - Add struct __hack to _Static_assert to require consumers to add a
 semicolon.
   - Add an extra underscore to __assert_ to allow it to be combined with
 locally defined versions of CTASSERT in the tree.
   - Add proper casts to __offsetof() to make it work for cases where
 sizeof(size_t) != sizeof(uintptr_t).
   - Globally replace size_t and uintptr_t by __size_t and __uintptr_t.
 This removes the dependency on sys/types.h / stdint.h. Practically
 any header file ends up including machines/_types.h somehow.
   - Change argument names of macros to match with the rest of the file.
   
   MFC after:  3 months
 
 Modified:
   head/sys/sys/cdefs.h
 
 Modified: head/sys/sys/cdefs.h
 ==
 --- head/sys/sys/cdefs.h  Fri Dec 16 02:09:51 2011(r228561)
 +++ head/sys/sys/cdefs.h  Fri Dec 16 08:22:23 2011(r228562)
 @@ -363,10 +360,11 @@
  #define __offsetof(type, field)   __builtin_offsetof(type, field)
  #else
  #ifndef __cplusplus
 -#define  __offsetof(type, field) ((size_t)(((type *)0)-field))
 +#define  __offsetof(type, field) \
 + ((__size_t)(__uintptr_t)((const volatile void *)((type *)0)-member))

s/member/field/

  #else
  #define __offsetof(type, field)  \
 -  (__offsetof__ (reinterpret_cast size_t   \
 +  (__offsetof__ (reinterpret_cast __size_t \
   (reinterpret_cast const volatile char   \
(static_casttype * (0)-field
  #endif


signature.asc
Description: This is a digitally signed message part.


svn commit: r228564 - head/sys/sys

2011-12-16 Thread Ed Schouten
Author: ed
Date: Fri Dec 16 09:56:22 2011
New Revision: 228564
URL: http://svn.freebsd.org/changeset/base/228564

Log:
  Fix typo in macro.
  
  I copied this macro directly from Bruce's email, as I assumed it was
  awesome already.
  
  Reported by:  tijl@

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==
--- head/sys/sys/cdefs.hFri Dec 16 08:27:04 2011(r228563)
+++ head/sys/sys/cdefs.hFri Dec 16 09:56:22 2011(r228564)
@@ -361,7 +361,7 @@
 #else
 #ifndef __cplusplus
 #define__offsetof(type, field) \
-   ((__size_t)(__uintptr_t)((const volatile void *)((type *)0)-member))
+   ((__size_t)(__uintptr_t)((const volatile void *)((type *)0)-field))
 #else
 #define __offsetof(type, field)\
   (__offsetof__ (reinterpret_cast __size_t   \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228565 - head/sbin/devd

2011-12-16 Thread Gleb Smirnoff
Author: glebius
Date: Fri Dec 16 10:14:41 2011
New Revision: 228565
URL: http://svn.freebsd.org/changeset/base/228565

Log:
  Xref re_format(7).

Modified:
  head/sbin/devd/devd.8

Modified: head/sbin/devd/devd.8
==
--- head/sbin/devd/devd.8   Fri Dec 16 09:56:22 2011(r228564)
+++ head/sbin/devd/devd.8   Fri Dec 16 10:14:41 2011(r228565)
@@ -25,7 +25,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd November 24, 2005
+.Dd December 16, 2011
 .Dt DEVD 8
 .Os
 .Sh NAME
@@ -142,6 +142,7 @@ to communicate with its clients.
 .El
 .Sh SEE ALSO
 .Xr devctl 4 ,
-.Xr devd.conf 5
+.Xr devd.conf 5 ,
+.Xr re_format 7
 .Sh AUTHORS
 .An M. Warner Losh
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228566 - head/sbin/devd

2011-12-16 Thread Gleb Smirnoff
Author: glebius
Date: Fri Dec 16 10:21:01 2011
New Revision: 228566
URL: http://svn.freebsd.org/changeset/base/228566

Log:
  Xref re_format(7) in devd.conf(5), not in devd(8).
  
  Pointy hat to:glebius

Modified:
  head/sbin/devd/devd.8
  head/sbin/devd/devd.conf.5

Modified: head/sbin/devd/devd.8
==
--- head/sbin/devd/devd.8   Fri Dec 16 10:14:41 2011(r228565)
+++ head/sbin/devd/devd.8   Fri Dec 16 10:21:01 2011(r228566)
@@ -25,7 +25,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd December 16, 2011
+.Dd November 24, 2005
 .Dt DEVD 8
 .Os
 .Sh NAME
@@ -142,7 +142,6 @@ to communicate with its clients.
 .El
 .Sh SEE ALSO
 .Xr devctl 4 ,
-.Xr devd.conf 5 ,
-.Xr re_format 7
+.Xr devd.conf 5
 .Sh AUTHORS
 .An M. Warner Losh

Modified: head/sbin/devd/devd.conf.5
==
--- head/sbin/devd/devd.conf.5  Fri Dec 16 10:14:41 2011(r228565)
+++ head/sbin/devd/devd.conf.5  Fri Dec 16 10:21:01 2011(r228566)
@@ -41,7 +41,7 @@
 .\ ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
 .\ SOFTWARE.
 .\
-.Dd October 25, 2011
+.Dd December 16, 2011
 .Dt DEVD.CONF 5
 .Os
 .Sh NAME
@@ -542,4 +542,5 @@ has many additional examples.
 .Sh SEE ALSO
 .Xr coretemp 4 ,
 .Xr devfs 5 ,
-.Xr devd 8
+.Xr devd 8 ,
+.Xr re_format 7
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228567 - in head/sys: sys vm

2011-12-16 Thread Konstantin Belousov
Author: kib
Date: Fri Dec 16 10:56:16 2011
New Revision: 228567
URL: http://svn.freebsd.org/changeset/base/228567

Log:
  Move kstack_cache_entry into the private header, and make the
  stack cache list header accessible outside vm_glue.c.
  
  MFC after:1 week

Added:
  head/sys/sys/_kstack_cache.h   (contents, props changed)
Modified:
  head/sys/vm/vm_glue.c

Added: head/sys/sys/_kstack_cache.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/sys/_kstack_cache.hFri Dec 16 10:56:16 2011
(r228567)
@@ -0,0 +1,43 @@
+/*-
+ * Copyright (c) 2009 Konstantin Belousov k...@freebsd.org
+ *
+ * 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.
+ * 4. Neither the name of the University nor the names of its contributors
+ *may be used to endorse or promote products derived from this software
+ *without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 _SYS__KSTACK_CACHE_H
+#define_SYS__KSTACK_CACHE_H
+
+struct kstack_cache_entry {
+   struct vm_object *ksobj;
+   struct kstack_cache_entry *next_ks_entry;
+};
+
+extern struct kstack_cache_entry *kstack_cache;
+
+#endif
+
+

Modified: head/sys/vm/vm_glue.c
==
--- head/sys/vm/vm_glue.c   Fri Dec 16 10:21:01 2011(r228566)
+++ head/sys/vm/vm_glue.c   Fri Dec 16 10:56:16 2011(r228567)
@@ -77,7 +77,7 @@ __FBSDID($FreeBSD$);
 #include sys/vmmeter.h
 #include sys/sx.h
 #include sys/sysctl.h
-
+#include sys/_kstack_cache.h
 #include sys/eventhandler.h
 #include sys/kernel.h
 #include sys/ktr.h
@@ -331,12 +331,7 @@ vm_sync_icache(vm_map_t map, vm_offset_t
pmap_sync_icache(map-pmap, va, sz);
 }
 
-struct kstack_cache_entry {
-   vm_object_t ksobj;
-   struct kstack_cache_entry *next_ks_entry;
-};
-
-static struct kstack_cache_entry *kstack_cache;
+struct kstack_cache_entry *kstack_cache;
 static int kstack_cache_size = 128;
 static int kstacks;
 static struct mtx kstack_cache_mtx;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228569 - head/sys/ddb

2011-12-16 Thread Konstantin Belousov
Author: kib
Date: Fri Dec 16 11:44:20 2011
New Revision: 228569
URL: http://svn.freebsd.org/changeset/base/228569

Log:
  Add 'findstack' ddb command to search either the thread kernel stack
  or cached stack containing the specified kernel virtual address.
  
  Discussed with:   pho
  MFC after:1 week

Modified:
  head/sys/ddb/db_command.c
  head/sys/ddb/db_ps.c
  head/sys/ddb/ddb.h

Modified: head/sys/ddb/db_command.c
==
--- head/sys/ddb/db_command.c   Fri Dec 16 11:42:50 2011(r228568)
+++ head/sys/ddb/db_command.c   Fri Dec 16 11:44:20 2011(r228569)
@@ -140,6 +140,7 @@ static struct command db_cmds[] = {
{ unscript,   db_unscript_cmd,CS_OWN, 0 },
{ capture,db_capture_cmd, CS_OWN, 0 },
{ textdump,   db_textdump_cmd,CS_OWN, 0 },
+   { findstack,  db_findstack_cmd,   0,  0 },
 };
 struct command_table db_cmd_table = LIST_HEAD_INITIALIZER(db_cmd_table);
 

Modified: head/sys/ddb/db_ps.c
==
--- head/sys/ddb/db_ps.cFri Dec 16 11:42:50 2011(r228568)
+++ head/sys/ddb/db_ps.cFri Dec 16 11:44:20 2011(r228569)
@@ -37,6 +37,7 @@ __FBSDID($FreeBSD$);
 #include sys/proc.h
 #include sys/sysent.h
 #include sys/systm.h
+#include sys/_kstack_cache.h
 #include vm/vm.h
 #include vm/vm_param.h
 #include vm/pmap.h
@@ -429,3 +430,39 @@ DB_SHOW_COMMAND(proc, db_show_proc)
break;
}
 }
+
+void
+db_findstack_cmd(db_expr_t addr, boolean_t have_addr,
+db_expr_t dummy3 __unused, char *dummy4 __unused)
+{
+   struct proc *p;
+   struct thread *td;
+   struct kstack_cache_entry *ks_ce;
+   vm_offset_t saddr;
+
+   if (have_addr)
+   saddr = addr;
+   else {
+   db_printf(Usage: findstack address\n);
+   return;
+   }
+
+   for (p = LIST_FIRST(allproc); p != NULL; p = LIST_NEXT(p, p_list)) {
+   FOREACH_THREAD_IN_PROC(p, td) {
+   if (td-td_kstack = saddr  saddr  td-td_kstack +
+   PAGE_SIZE * td-td_kstack_pages) {
+   db_printf(Thread %p\n, td);
+   return;
+   }
+   }
+   }
+
+   for (ks_ce = kstack_cache; ks_ce != NULL;
+ks_ce = ks_ce-next_ks_entry) {
+   if ((vm_offset_t)ks_ce = saddr  saddr  (vm_offset_t)ks_ce +
+   PAGE_SIZE * KSTACK_PAGES) {
+   db_printf(Cached stack %p\n, ks_ce);
+   return;
+   }
+   }
+}

Modified: head/sys/ddb/ddb.h
==
--- head/sys/ddb/ddb.h  Fri Dec 16 11:42:50 2011(r228568)
+++ head/sys/ddb/ddb.h  Fri Dec 16 11:44:20 2011(r228569)
@@ -226,6 +226,7 @@ db_cmdfcn_t db_delete_cmd;
 db_cmdfcn_tdb_deletehwatch_cmd;
 db_cmdfcn_tdb_deletewatch_cmd;
 db_cmdfcn_tdb_examine_cmd;
+db_cmdfcn_tdb_findstack_cmd;
 db_cmdfcn_tdb_hwatchpoint_cmd;
 db_cmdfcn_tdb_listbreak_cmd;
 db_cmdfcn_tdb_scripts_cmd;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228570 - head/share/man/man4

2011-12-16 Thread Konstantin Belousov
Author: kib
Date: Fri Dec 16 11:52:33 2011
New Revision: 228570
URL: http://svn.freebsd.org/changeset/base/228570

Log:
  Document 'findstack'.
  
  MFC after:1 week

Modified:
  head/share/man/man4/ddb.4

Modified: head/share/man/man4/ddb.4
==
--- head/share/man/man4/ddb.4   Fri Dec 16 11:44:20 2011(r228569)
+++ head/share/man/man4/ddb.4   Fri Dec 16 11:52:33 2011(r228570)
@@ -60,7 +60,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd September 5, 2010
+.Dd December 16, 2011
 .Dt DDB 4
 .Os
 .Sh NAME
@@ -523,6 +523,16 @@ The optional
 argument limits the search.
 .\
 .Pp
+.It Xo
+.Ic findstack
+.Ar addr
+.Xc
+Prints the thread address for a thread kernel-mode stack of which contains the
+specified address.
+If the thread is not found, search the thread stack cache and prints the
+cached stack address.
+Otherwise, prints nothing.
+.Pp
 .It Ic show Cm all procs Ns Op Li / Ns Cm m
 .It Ic ps Ns Op Li / Ns Cm m
 Display all process information.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228571 - in head: . lib/libc/net sbin/ifconfig share/man/man4 sys/net sys/netinet sys/netinet6 sys/sys

2011-12-16 Thread Gleb Smirnoff
Author: glebius
Date: Fri Dec 16 12:16:56 2011
New Revision: 228571
URL: http://svn.freebsd.org/changeset/base/228571

Log:
  A major overhaul of the CARP implementation. The ip_carp.c was started
  from scratch, copying needed functionality from the old implemenation
  on demand, with a thorough review of all code. The main change is that
  interface layer has been removed from the CARP. Now redundant addresses
  are configured exactly on the interfaces, they run on.
  
  The CARP configuration itself is, as before, configured and read via
  SIOCSVH/SIOCGVH ioctls. A new prefix created with SIOCAIFADDR or
  SIOCAIFADDR_IN6 may now be configured to a particular virtual host id,
  which makes the prefix redundant.
  
  ifconfig(8) semantics has been changed too: now one doesn't need
  to clone carpXX interface, he/she should directly configure a vhid
  on a Ethernet interface.
  
  To supply vhid data from the kernel to an application the getifaddrs(8)
  function had been changed to pass ifam_data with each address. [1]
  
  The new implementation definitely closes all PRs related to carp(4)
  being an interface, and may close several others. It also allows
  to run a single redundant IP per interface.
  
  Big thanks to Bjoern Zeeb for his help with inet6 part of patch, for
  idea on using ifam_data and for several rounds of reviewing!
  
  PR:   kern/117000, kern/126945, kern/126714, kern/120130, kern/117448
  Reviewed by:  bz
  Submitted by: bz [1]

Modified:
  head/UPDATING
  head/lib/libc/net/getifaddrs.c
  head/sbin/ifconfig/af_inet.c
  head/sbin/ifconfig/af_inet6.c
  head/sbin/ifconfig/ifcarp.c
  head/sbin/ifconfig/ifconfig.8
  head/sbin/ifconfig/ifconfig.c
  head/sbin/ifconfig/ifconfig.h
  head/share/man/man4/carp.4
  head/sys/net/if.c
  head/sys/net/if.h
  head/sys/net/if_ethersubr.c
  head/sys/net/if_types.h
  head/sys/net/if_var.h
  head/sys/net/rtsock.c
  head/sys/netinet/if_ether.c
  head/sys/netinet/if_ether.h
  head/sys/netinet/in.c
  head/sys/netinet/in_var.h
  head/sys/netinet/ip_carp.c
  head/sys/netinet/ip_carp.h
  head/sys/netinet6/in6.c
  head/sys/netinet6/in6_ifattach.c
  head/sys/netinet6/in6_var.h
  head/sys/netinet6/nd6.c
  head/sys/netinet6/nd6_nbr.c
  head/sys/sys/param.h

Modified: head/UPDATING
==
--- head/UPDATING   Fri Dec 16 11:52:33 2011(r228570)
+++ head/UPDATING   Fri Dec 16 12:16:56 2011(r228571)
@@ -22,6 +22,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
machines to maximize performance.  (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.)
 
+20111215:
+   The carp(4) facility has been changed significantly. Configuration
+   of the CARP protocol via ifconfig(8) has changed, as well as format
+   of CARP events submitted to devd(8) has changed. See manual pages
+   for more information. The arpbalance feature of carp(4) is currently
+   not supported anymore.
+
+   Size of struct in_aliasreq, struct in6_aliasreq has changed. User
+   utilities using SIOCAIFADDR, SIOCAIFADDR_IN6, e.g. ifconfig(8),
+   need to be recompiled.
+
 2022:
The acpi_wmi(4) status device /dev/wmistat has been renamed to
/dev/wmistat0.

Modified: head/lib/libc/net/getifaddrs.c
==
--- head/lib/libc/net/getifaddrs.c  Fri Dec 16 11:52:33 2011
(r228570)
+++ head/lib/libc/net/getifaddrs.c  Fri Dec 16 12:16:56 2011
(r228571)
@@ -76,7 +76,7 @@ __FBSDID($FreeBSD$);
 #defineHAVE_IFM_DATA
 #endif
 
-#if_BSDI_VERSION = 199802
+#if(_BSDI_VERSION = 199802) || (__FreeBSD_version = 103) 
 /* ifam_data is very specific to recent versions of bsdi */
 #defineHAVE_IFAM_DATA
 #endif

Modified: head/sbin/ifconfig/af_inet.c
==
--- head/sbin/ifconfig/af_inet.cFri Dec 16 11:52:33 2011
(r228570)
+++ head/sbin/ifconfig/af_inet.cFri Dec 16 12:16:56 2011
(r228571)
@@ -84,8 +84,11 @@ in_status(int s __unused, const struct i
if (ifa-ifa_flags  IFF_BROADCAST) {
sin = (struct sockaddr_in *)ifa-ifa_broadaddr;
if (sin != NULL  sin-sin_addr.s_addr != 0)
-   printf(broadcast %s, inet_ntoa(sin-sin_addr));
+   printf(broadcast %s , inet_ntoa(sin-sin_addr));
}
+
+   print_vhid(ifa,  );
+
putchar('\n');
 }
 

Modified: head/sbin/ifconfig/af_inet6.c
==
--- head/sbin/ifconfig/af_inet6.c   Fri Dec 16 11:52:33 2011
(r228570)
+++ head/sbin/ifconfig/af_inet6.c   Fri Dec 16 12:16:56 2011
(r228571)
@@ -307,6 +307,8 @@ in6_status(int s __unused, const struct 
printf(infty );
}
 
+   print_vhid(ifa,  

svn commit: r228572 - head/sys/dev/drm

2011-12-16 Thread Stefan Esser
Author: se
Date: Fri Dec 16 12:42:02 2011
New Revision: 228572
URL: http://svn.freebsd.org/changeset/base/228572

Log:
  Fix format string Z -- z, since the former is a deprecated and (in FreeBSD)
  unsupported form of the latter. This change has been reviewed and accepted
  in the -hackers list.
  
  Submitted by: Alexander Best
  Reviewed by:  David Schulz

Modified:
  head/sys/dev/drm/mga_drv.h

Modified: head/sys/dev/drm/mga_drv.h
==
--- head/sys/dev/drm/mga_drv.h  Fri Dec 16 12:16:56 2011(r228571)
+++ head/sys/dev/drm/mga_drv.h  Fri Dec 16 12:42:02 2011(r228572)
@@ -288,7 +288,7 @@ do {
\
 do {   \
if ( MGA_VERBOSE ) {\
DRM_INFO( BEGIN_DMA( %d )\n, (n) );   \
-   DRM_INFO(space=0x%x req=0x%Zx\n,  \
+   DRM_INFO(space=0x%x req=0x%zx\n,  \
  dev_priv-prim.space, (n) * DMA_BLOCK_SIZE ); \
}   \
prim = dev_priv-prim.start;\
@@ -338,7 +338,7 @@ do {
\
 #define DMA_WRITE( offset, val )   \
 do {   \
if ( MGA_VERBOSE ) {\
-   DRM_INFO(DMA_WRITE( 0x%08x ) at 0x%04Zx\n,\
+   DRM_INFO(DMA_WRITE( 0x%08x ) at 0x%04zx\n,\
  (u32)(val), write + (offset) * sizeof(u32) ); \
}   \
*(volatile u32 *)(prim + write + (offset) * sizeof(u32)) = val; \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228574 - in head: sbin/ifconfig sys/netinet

2011-12-16 Thread Gleb Smirnoff
Author: glebius
Date: Fri Dec 16 13:30:17 2011
New Revision: 228574
URL: http://svn.freebsd.org/changeset/base/228574

Log:
  Since size of struct in_aliasreq has just been changed in r228571,
  and thus ifconfig(8) needs recompile, it is a good chance to make
  parameter checks on SIOCAIFADDR arguments more strict.

Modified:
  head/sbin/ifconfig/af_inet.c
  head/sys/netinet/in.c

Modified: head/sbin/ifconfig/af_inet.c
==
--- head/sbin/ifconfig/af_inet.cFri Dec 16 12:53:15 2011
(r228573)
+++ head/sbin/ifconfig/af_inet.cFri Dec 16 13:30:17 2011
(r228574)
@@ -126,6 +126,7 @@ in_getaddr(const char *s, int which)
*p = '/';
errx(1, %s: bad value (width %s), s, errstr);
}
+   min-sin_family = AF_INET;
min-sin_len = sizeof(*min);
min-sin_addr.s_addr = htonl(~((1LL  (32 - masklen)) 
- 1)  
  0x);

Modified: head/sys/netinet/in.c
==
--- head/sys/netinet/in.c   Fri Dec 16 12:53:15 2011(r228573)
+++ head/sys/netinet/in.c   Fri Dec 16 13:30:17 2011(r228574)
@@ -253,16 +253,10 @@ in_control(struct socket *so, u_long cmd
sizeof(struct sockaddr_in) ||
ifra-ifra_broadaddr.sin_family != AF_INET))
return (EINVAL);
-#if 0
-   /*
-* ifconfig(8) historically doesn't set af_family for mask
-* for unknown reason.
-*/
if (ifra-ifra_mask.sin_len != 0 
(ifra-ifra_mask.sin_len != sizeof(struct sockaddr_in) ||
ifra-ifra_mask.sin_family != AF_INET))
return (EINVAL);
-#endif
break;
case SIOCSIFADDR:
case SIOCSIFBRDADDR:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228575 - head/share/man/man4

2011-12-16 Thread Alexander Motin
Author: mav
Date: Fri Dec 16 14:19:46 2011
New Revision: 228575
URL: http://svn.freebsd.org/changeset/base/228575

Log:
  Some formatting fixes.
  
  Submitted by: ru

Modified:
  head/share/man/man4/eventtimers.4

Modified: head/share/man/man4/eventtimers.4
==
--- head/share/man/man4/eventtimers.4   Fri Dec 16 13:30:17 2011
(r228574)
+++ head/share/man/man4/eventtimers.4   Fri Dec 16 14:19:46 2011
(r228575)
@@ -46,16 +46,22 @@ statistics, time keeping, profiling and 
 .Xr callout 9
 mechanism.
 These purposes now grouped into three main callbacks:
-.Bl -tag
-.It hardclock()
+.Bl -tag -width .Fn hardclock
+.It Fn hardclock
 .Xr callout 9
-and timekeeping events entry. Called with frequency defined by hz variable,
+and timekeeping events entry.
+Called with frequency defined by
+.Va hz
+variable,
 usually 1000Hz.
-.It statclock()
-statistics and scheduler events entry. Called with frequency about 128Hz.
-.It profclock()
-profiler events entry. When enabled, called with frequency about 8KHz.
+.It Fn statclock
+statistics and scheduler events entry.
+Called with frequency about 128Hz.
+.It Fn profclock
+profiler events entry.
+When enabled, called with frequency about 8KHz.
 .El
+.Pp
 Different platforms provide different kinds of timer hardware.
 The goal of the event timers subsystem is to provide unified way to control
 that hardware, and to use it, supplying kernel with all required time-based
@@ -80,11 +86,13 @@ kern.eventtimer.et.HPET.flags: 7
 kern.eventtimer.et.HPET.frequency: 14318180
 kern.eventtimer.et.HPET.quality: 550
 .Ed
-, where:
-.Bl -tag
+.Pp
+where:
+.Bl -inset
 .It Va kern.eventtimer.et. Ns Ar X Ns Va .flags
+is a
 bitmask, defining event timer capabilities:
-.Bl -tag -compact
+.Bl -tag -offset indent -width indent -compact
 .It 1
 periodic mode supported,
 .It 2
@@ -97,8 +105,10 @@ timer may stop when CPU goes to sleep st
 timer supports only power-of-2 divisors.
 .El
 .It Va kern.eventtimer.et. Ns Ar X Ns Va .frequency
+is a
 timer base frequency,
 .It Va kern.eventtimer.et. Ns Ar X Ns Va .quality
+is an
 integral value, defining how good is this timer, comparing to others.
 .El
 .Pp
@@ -107,7 +117,7 @@ Current choice can be read and affected 
 .Va kern.eventtimer.timer
 tunable/sysctl.
 Several other tunables/sysctls are affecting how exactly this timer is used:
-.Bl -tag
+.Bl -inset
 .It Va kern.eventtimer.periodic
 allows to choose periodic and one-shot operation mode.
 In periodic mode, periodic interrupts from timer hardware are taken as the
@@ -119,15 +129,22 @@ Default value depends of chosen timer ca
 preferred, until other is forced by user or hardware.
 .It Va kern.eventtimer.singlemul
 in periodic mode specifies how much times higher timer frequency should be,
-to not strictly alias hardclock() and statclock() events. Default values are
+to not strictly alias
+.Fn hardclock
+and
+.Fn statclock
+events.
+Default values are
 1, 2 or 4, depending on configured HZ value.
 .It Va kern.eventtimer.idletick
 makes each CPU to receive every timer interrupt independently of whether they
-busy or not. By default this options is disabled. If chosen timer is per-CPU
+busy or not.
+By default this options is disabled.
+If chosen timer is per-CPU
 and runs in periodic mode, this option has no effect - all interrupts are
 always generating.
 .El
 .Sh SEE ALSO
-.Xr attimer 4 ,
 .Xr atrtc 4 ,
+.Xr attimer 4 ,
 .Xr hpet 4
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228576 - in head: . sys/boot/forth sys/modules sys/modules/carp sys/modules/if_carp

2011-12-16 Thread Gleb Smirnoff
Author: glebius
Date: Fri Dec 16 14:28:34 2011
New Revision: 228576
URL: http://svn.freebsd.org/changeset/base/228576

Log:
  - Rename if_carp.ko to carp.ko.
  - carp.ko depends on sha1.c

Added:
  head/sys/modules/carp/
 - copied from r228573, head/sys/modules/if_carp/
Deleted:
  head/sys/modules/if_carp/
Modified:
  head/ObsoleteFiles.inc
  head/sys/boot/forth/loader.conf
  head/sys/modules/Makefile
  head/sys/modules/carp/Makefile

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Fri Dec 16 14:19:46 2011(r228575)
+++ head/ObsoleteFiles.inc  Fri Dec 16 14:28:34 2011(r228576)
@@ -38,6 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20111216: carp(4) module renamed
+OLD_FILES+=boot/kernel/if_carp.ko
 # 20111214: eventtimers(7) moved to eventtimers(4)
 OLD_FILES+=usr/share/man/man7/eventtimers.7.gz
 # 2025: amd(4) removed

Modified: head/sys/boot/forth/loader.conf
==
--- head/sys/boot/forth/loader.conf Fri Dec 16 14:19:46 2011
(r228575)
+++ head/sys/boot/forth/loader.conf Fri Dec 16 14:28:34 2011
(r228576)
@@ -260,6 +260,7 @@ pf_load=NO# packet filter
 
 bridgestp_load=NO# if_bridge(4) support
 miibus_load=NO   # miibus support, needed for some drivers
+carp_load=NO # carp(4) protocol
 if_ae_load=NO# Attansic/Atheros L2 FastEthernet
 if_age_load=NO   # Attansic/Atheros L1 Gigabit Ethernet
 if_alc_load=NO   # Atheros AR8131/AR8132 Ethernet
@@ -275,7 +276,6 @@ if_bridge_load=NO # if_bridge(4) devi
 if_bwi_load=NO   # Broadcom BCM53xx IEEE 802.11b/g wireness NICs
 if_bwn_load=NO   # Broadcom BCM43xx IEEE 802.11 wireless NICs
 if_bxe_load=NO   # Broadcom NetXtreme II 10Gb Ethernet
-if_carp_load=NO  # carp(4) devices
 if_cas_load=NO   # Sun Cassini/Cassini+ and NS DP83065 Saturn
 if_cm_load=NO# SMC (90c26, 90c56, 90c66)
 if_cs_load=NO# Crystal Semiconductor CS8920

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Fri Dec 16 14:19:46 2011(r228575)
+++ head/sys/modules/Makefile   Fri Dec 16 14:28:34 2011(r228576)
@@ -50,6 +50,7 @@ SUBDIR=   ${_3dfx} \
${_canbepm} \
${_canbus} \
${_cardbus} \
+   ${_carp} \
cas \
${_cbb} \
cc \
@@ -117,7 +118,6 @@ SUBDIR= ${_3dfx} \
${_ida} \
${_ie} \
if_bridge \
-   ${_if_carp} \
if_disc \
if_edsc \
if_ef \
@@ -374,7 +374,7 @@ _if_gre=if_gre
 
 .if (${MK_INET_SUPPORT} != no || ${MK_INET6_SUPPORT} != no) || \
defined(ALL_MODULES)
-_if_carp=  if_carp
+_carp= carp
 .endif
 
 .if ${MK_IPFILTER} != no || defined(ALL_MODULES)

Modified: head/sys/modules/carp/Makefile
==
--- head/sys/modules/if_carp/Makefile   Fri Dec 16 12:53:15 2011
(r228573)
+++ head/sys/modules/carp/Makefile  Fri Dec 16 14:28:34 2011
(r228576)
@@ -1,12 +1,14 @@
 # $FreeBSD$
 
 .PATH: ${.CURDIR}/../../netinet
+.PATH: ${.CURDIR}/../../crypto
 
 .include bsd.own.mk
 
-KMOD=  if_carp
-SRCS=  ip_carp.c
-SRCS+= opt_carp.h opt_bpf.h opt_inet.h opt_inet6.h vnode_if.h
+KMOD=  carp
+SRCS=  ip_carp.c sha1.c
+SRCS+= device_if.h bus_if.h vnode_if.h
+SRCS+= opt_carp.h opt_bpf.h opt_inet.h opt_inet6.h opt_ofed.h
 
 .if !defined(KERNBUILDDIR)
 .if ${MK_INET_SUPPORT} != no
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228577 - head/sbin/ifconfig

2011-12-16 Thread Gleb Smirnoff
Author: glebius
Date: Fri Dec 16 14:30:58 2011
New Revision: 228577
URL: http://svn.freebsd.org/changeset/base/228577

Log:
  Rename ifcarp.c to carp.c

Added:
  head/sbin/ifconfig/carp.c
 - copied unchanged from r228576, head/sbin/ifconfig/ifcarp.c
Deleted:
  head/sbin/ifconfig/ifcarp.c
Modified:
  head/sbin/ifconfig/Makefile

Modified: head/sbin/ifconfig/Makefile
==
--- head/sbin/ifconfig/Makefile Fri Dec 16 14:28:34 2011(r228576)
+++ head/sbin/ifconfig/Makefile Fri Dec 16 14:30:58 2011(r228577)
@@ -38,7 +38,7 @@ SRCS+=ifieee80211.c regdomain.c # SIOC[
 DPADD+=${LIBBSDXML} ${LIBJAIL} ${LIBSBUF}
 LDADD+=-lbsdxml -ljail -lsbuf
 
-SRCS+= ifcarp.c# SIOC[GS]VH support
+SRCS+= carp.c  # SIOC[GS]VH support
 SRCS+= ifgroup.c   # ...
 SRCS+= ifpfsync.c  # pfsync(4) support
 

Copied: head/sbin/ifconfig/carp.c (from r228576, head/sbin/ifconfig/ifcarp.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sbin/ifconfig/carp.c   Fri Dec 16 14:30:58 2011(r228577, copy 
of r228576, head/sbin/ifconfig/ifcarp.c)
@@ -0,0 +1,228 @@
+/* $FreeBSD$ */
+/* from $OpenBSD: ifconfig.c,v 1.82 2003/10/19 05:43:35 mcbride Exp $ */
+
+/*
+ * Copyright (c) 2002 Michael Shalayeff. All rights reserved.
+ * Copyright (c) 2003 Ryan McBride. 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.
+ */
+
+#include sys/param.h
+#include sys/ioctl.h
+#include sys/socket.h
+#include sys/sockio.h
+
+#include stdlib.h
+#include unistd.h
+
+#include net/if.h
+#include net/if_var.h
+#include netinet/in.h
+#include netinet/in_var.h
+#include netinet/ip_carp.h
+
+#include ctype.h
+#include stdio.h
+#include string.h
+#include stdlib.h
+#include unistd.h
+#include err.h
+#include errno.h
+
+#include ifconfig.h
+
+static const char *carp_states[] = { CARP_STATES };
+
+static void carp_status(int s);
+static void setcarp_vhid(const char *, int, int, const struct afswtch *rafp);
+static void setcarp_callback(int, void *);
+static void setcarp_advbase(const char *,int, int, const struct afswtch *rafp);
+static void setcarp_advskew(const char *, int, int, const struct afswtch 
*rafp);
+static void setcarp_passwd(const char *, int, int, const struct afswtch *rafp);
+
+static int carpr_vhid = -1;
+static int carpr_advskew = -1;
+static int carpr_advbase = -1;
+static int carpr_state = -1;
+static unsigned char const *carpr_key;
+
+static void
+carp_status(int s)
+{
+   struct carpreq carpr[CARP_MAXVHID];
+   int i;
+
+   bzero(carpr, sizeof(struct carpreq) * CARP_MAXVHID);
+   carpr[0].carpr_count = CARP_MAXVHID;
+   ifr.ifr_data = (caddr_t)carpr;
+
+   if (ioctl(s, SIOCGVH, (caddr_t)ifr) == -1)
+   return;
+
+   for (i = 0; i  carpr[0].carpr_count; i++) {
+   printf(\tcarp: %s vhid %d advbase %d advskew %d,
+   carp_states[carpr[i].carpr_state], carpr[i].carpr_vhid,
+   carpr[i].carpr_advbase, carpr[i].carpr_advskew);
+   if (printkeys  carpr[i].carpr_key[0] != '\0')
+   printf( key \%s\\n, carpr[i].carpr_key);
+   else
+   printf(\n);
+   }
+}
+
+static void
+setcarp_vhid(const char *val, int d, int s, const struct afswtch *afp)
+{
+
+   carpr_vhid = atoi(val);
+
+   if (carpr_vhid = 0 || carpr_vhid  CARP_MAXVHID)
+   errx(1, vhid must be greater than 0 and less than %u,
+   CARP_MAXVHID);
+
+   switch (afp-af_af) {
+#ifdef INET
+   

svn commit: r228578 - head/lib/libthread_db

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 15:00:56 2011
New Revision: 228578
URL: http://svn.freebsd.org/changeset/base/228578

Log:
  In lib/libthread_db/arch/i386/libpthread_md.c, clang gives two incorrect
  warnings about alignment, so turn -Wcast-align off for now.
  
  MFC after:1 week

Modified:
  head/lib/libthread_db/Makefile

Modified: head/lib/libthread_db/Makefile
==
--- head/lib/libthread_db/Makefile  Fri Dec 16 14:30:58 2011
(r228577)
+++ head/lib/libthread_db/Makefile  Fri Dec 16 15:00:56 2011
(r228578)
@@ -16,4 +16,10 @@ SYM_MAPS+=${.CURDIR}/Symbol.map
 SYMBOL_MAPS=${SYM_MAPS}
 VERSION_DEF=${.CURDIR}/../libc/Versions.def
 
+.if ${CC:T:Mclang} == clang
+# Unfortunately, clang gives an incorrect warning about alignment in
+# arch/i386/libpthread_md.c, so turn that off for now.
+NO_WCAST_ALIGN=
+.endif
+
 .include bsd.lib.mk
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228579 - head/cddl/contrib/opensolaris/lib/libdtrace/common

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 15:04:47 2011
New Revision: 228579
URL: http://svn.freebsd.org/changeset/base/228579

Log:
  In cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c, some
  uint64_t values are snprintf'd using %llx.  On amd64, uint64_t is
  typedef'd as unsigned long, so cast the values to u_longlong_t, as is
  done similarly in the rest of the file.
  
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Fri Dec 
16 15:00:56 2011(r228578)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Fri Dec 
16 15:04:47 2011(r228579)
@@ -873,7 +873,7 @@ dt_print_stack(dtrace_hdl_t *dtp, FILE *
if (pc  sym.st_value) {
(void) snprintf(c, sizeof (c), %s`%s+0x%llx,
dts.dts_object, dts.dts_name,
-   pc - sym.st_value);
+   (u_longlong_t)(pc - sym.st_value));
} else {
(void) snprintf(c, sizeof (c), %s`%s,
dts.dts_object, dts.dts_name);
@@ -886,9 +886,10 @@ dt_print_stack(dtrace_hdl_t *dtp, FILE *
 */
if (dtrace_lookup_by_addr(dtp, pc, NULL, dts) == 0) {
(void) snprintf(c, sizeof (c), %s`0x%llx,
-   dts.dts_object, pc);
+   dts.dts_object, (u_longlong_t)pc);
} else {
-   (void) snprintf(c, sizeof (c), 0x%llx, pc);
+   (void) snprintf(c, sizeof (c), 0x%llx,
+   (u_longlong_t)pc);
}
}
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228581 - head/libexec/bootpd/bootpgw

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 15:38:11 2011
New Revision: 228581
URL: http://svn.freebsd.org/changeset/base/228581

Log:
  In libexec/bootpd/bootpgw/bootpgw.c, add a cast for the remaining
  minutes of activity, to avoid a warning on platforms where time_t is a
  32-bit integer.
  
  MFC after:1 week

Modified:
  head/libexec/bootpd/bootpgw/bootpgw.c

Modified: head/libexec/bootpd/bootpgw/bootpgw.c
==
--- head/libexec/bootpd/bootpgw/bootpgw.c   Fri Dec 16 15:12:42 2011
(r228580)
+++ head/libexec/bootpd/bootpgw/bootpgw.c   Fri Dec 16 15:38:11 2011
(r228581)
@@ -452,7 +452,7 @@ main(argc, argv)
}
if (!(readfds  (1  s))) {
report(LOG_INFO, exiting after %ld minutes of 
inactivity,
-  actualtimeout.tv_sec / 60);
+  (long)(actualtimeout.tv_sec / 60));
exit(0);
}
ra_len = sizeof(recv_addr);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228582 - head/libexec/getty

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 15:44:12 2011
New Revision: 228582
URL: http://svn.freebsd.org/changeset/base/228582

Log:
  In libexec/getty/chat.c, replace  with  in chat_send().  The intent
  is to test if the CHATDEBUG_SEND bit is set in the chat_debug global.
  
  MFC after:1 week

Modified:
  head/libexec/getty/chat.c

Modified: head/libexec/getty/chat.c
==
--- head/libexec/getty/chat.c   Fri Dec 16 15:38:11 2011(r228581)
+++ head/libexec/getty/chat.c   Fri Dec 16 15:44:12 2011(r228582)
@@ -388,7 +388,7 @@ chat_send(char const *str)
 {
int r = 0;
 
-   if (chat_debug  CHATDEBUG_SEND)
+   if (chat_debug  CHATDEBUG_SEND)
syslog(LOG_DEBUG, chat_send '%s', cleanstr(str, strlen(str)));
 
if (*str) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228583 - head/sys/fs/ext2fs

2011-12-16 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Dec 16 15:47:43 2011
New Revision: 228583
URL: http://svn.freebsd.org/changeset/base/228583

Log:
  Style cleanups by jh@.
  Fix a comment from the previous commit.
  Use M_ZERO instead of bzero() in ext2_vfsops.c
  Add include guards from PR.
  
  PR:   162564
  Approved by:  jhb (mentor)
  MFC after:2 weeks

Modified:
  head/sys/fs/ext2fs/ext2_alloc.c
  head/sys/fs/ext2fs/ext2_balloc.c
  head/sys/fs/ext2fs/ext2_bmap.c
  head/sys/fs/ext2fs/ext2_inode.c
  head/sys/fs/ext2fs/ext2_lookup.c
  head/sys/fs/ext2fs/ext2_vfsops.c
  head/sys/fs/ext2fs/ext2_vnops.c
  head/sys/fs/ext2fs/ext2fs.h
  head/sys/fs/ext2fs/fs.h

Modified: head/sys/fs/ext2fs/ext2_alloc.c
==
--- head/sys/fs/ext2fs/ext2_alloc.c Fri Dec 16 15:44:12 2011
(r228582)
+++ head/sys/fs/ext2fs/ext2_alloc.c Fri Dec 16 15:47:43 2011
(r228583)
@@ -364,7 +364,7 @@ ext2_valloc(pvp, mode, cred, vpp)
 * ext2_dirpref else obtain it using ino_to_cg. The preferred inode is
 * always the next inode.
 */
-   if((mode  IFMT) == IFDIR) {
+   if ((mode  IFMT) == IFDIR) {
cg = ext2_dirpref(pip);
if (fs-e2fs_contigdirs[cg]  255)
fs-e2fs_contigdirs[cg]++;
@@ -557,13 +557,13 @@ ext2_blkpref(ip, lbn, indx, bap, blocknr
/* if the next block is actually what we thought it is,
   then set the goal to what we thought it should be
*/
-   if(ip-i_next_alloc_block == lbn  ip-i_next_alloc_goal != 0)
+   if (ip-i_next_alloc_block == lbn  ip-i_next_alloc_goal != 0)
return ip-i_next_alloc_goal;
 
/* now check whether we were provided with an array that basically
   tells us previous blocks to which we want to stay closeby
*/
-   if(bap) 
+   if (bap) 
 for (tmp = indx - 1; tmp = 0; tmp--) 
if (bap[tmp]) 
return bap[tmp];

Modified: head/sys/fs/ext2fs/ext2_balloc.c
==
--- head/sys/fs/ext2fs/ext2_balloc.cFri Dec 16 15:44:12 2011
(r228582)
+++ head/sys/fs/ext2fs/ext2_balloc.cFri Dec 16 15:47:43 2011
(r228583)
@@ -156,7 +156,7 @@ ext2_balloc(ip, lbn, size, cred, bpp, fl
 */
pref = 0;
if ((error = ext2_getlbns(vp, lbn, indirs, num)) != 0)
-   return(error);
+   return (error);
 #ifdef DIAGNOSTIC
if (num  1)
panic (ext2_balloc: ext2_getlbns returned indirect block);

Modified: head/sys/fs/ext2fs/ext2_bmap.c
==
--- head/sys/fs/ext2fs/ext2_bmap.c  Fri Dec 16 15:44:12 2011
(r228582)
+++ head/sys/fs/ext2fs/ext2_bmap.c  Fri Dec 16 15:47:43 2011
(r228583)
@@ -215,7 +215,7 @@ ext2_bmaparray(vp, bn, bnp, runp, runb)
++bn, ++*runp);
bn = ap-in_off;
if (runb  bn) {
-   for(--bn; bn = 0  *runb  maxrun 
+   for (--bn; bn = 0  *runb  maxrun 
is_sequential(ump, ((int32_t 
*)bp-b_data)[bn],
((int32_t *)bp-b_data)[bn+1]);
--bn, ++*runb);

Modified: head/sys/fs/ext2fs/ext2_inode.c
==
--- head/sys/fs/ext2fs/ext2_inode.c Fri Dec 16 15:44:12 2011
(r228582)
+++ head/sys/fs/ext2fs/ext2_inode.c Fri Dec 16 15:47:43 2011
(r228583)
@@ -229,7 +229,7 @@ ext2_truncate(vp, length, flags, cred, t
 * will be returned to the free list.  lastiblock values are also
 * normalized to -1 for calls to ext2_indirtrunc below.
 */
-   bcopy((caddr_t)oip-i_db[0], (caddr_t)oldblks, sizeof oldblks);
+   bcopy((caddr_t)oip-i_db[0], (caddr_t)oldblks, sizeof(oldblks));
for (level = TRIPLE; level = SINGLE; level--)
if (lastiblock[level]  0) {
oip-i_ib[level] = 0;
@@ -246,8 +246,8 @@ ext2_truncate(vp, length, flags, cred, t
 * Note that we save the new block configuration so we can check it
 * when we are done.
 */
-   bcopy((caddr_t)oip-i_db[0], (caddr_t)newblks, sizeof newblks);
-   bcopy((caddr_t)oldblks, (caddr_t)oip-i_db[0], sizeof oldblks);
+   bcopy((caddr_t)oip-i_db[0], (caddr_t)newblks, sizeof(newblks));
+   bcopy((caddr_t)oldblks, (caddr_t)oip-i_db[0], sizeof(oldblks));
oip-i_size = osize;
error = vtruncbuf(ovp, cred, td, length, (int)fs-e2fs_bsize);
if (error  (allerror == 0))
@@ -418,7 +418,7 @@ ext2_indirtrunc(ip, lbn, dbn, lastbn, le
copy = malloc(fs-e2fs_bsize, M_TEMP, M_WAITOK);

svn commit: r228584 - head/libexec/bootpd/tools/bootptest

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 15:55:43 2011
New Revision: 228584
URL: http://svn.freebsd.org/changeset/base/228584

Log:
  In libexec/bootpd/tools/bootptest/print-bootp.c, use the correct printf
  length modifier for the difference between two pointers.
  
  MFC after:1 week

Modified:
  head/libexec/bootpd/tools/bootptest/print-bootp.c

Modified: head/libexec/bootpd/tools/bootptest/print-bootp.c
==
--- head/libexec/bootpd/tools/bootptest/print-bootp.c   Fri Dec 16 15:47:43 
2011(r228583)
+++ head/libexec/bootpd/tools/bootptest/print-bootp.c   Fri Dec 16 15:55:43 
2011(r228584)
@@ -310,7 +310,7 @@ rfc1048_print(bp, length)
len = *bp++;
if (bp + len  ep) {
/* truncated option */
-   printf( |(%d%d), len, ep - bp);
+   printf( |(%d%td), len, ep - bp);
return;
}
/* Print the option value(s). */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228585 - head/libexec/mail.local

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 15:58:38 2011
New Revision: 228585
URL: http://svn.freebsd.org/changeset/base/228585

Log:
  Unfortunately, clang gives warnings about sendmail code that cannot be
  turned off yet.  Since this is contrib code, and we don't really care
  about the warnings, just turn make them non-fatal for now.
  
  MFC after:1 week

Modified:
  head/libexec/mail.local/Makefile

Modified: head/libexec/mail.local/Makefile
==
--- head/libexec/mail.local/MakefileFri Dec 16 15:55:43 2011
(r228584)
+++ head/libexec/mail.local/MakefileFri Dec 16 15:58:38 2011
(r228585)
@@ -12,6 +12,13 @@ CFLAGS+=-I${SENDMAIL_DIR}/include -I.
 WARNS?=2
 WFORMAT=0
 
+.if ${CC:T:Mclang} == clang
+# Unfortunately, clang gives warnings about sendmail code that cannot
+# be turned off yet.  Since this is contrib code, and we don't really
+# care about the warnings, just turn make them non-fatal for now.
+NO_WERROR=
+.endif
+
 LIBSMDIR=  ${.OBJDIR}/../../lib/libsm
 LIBSM= ${LIBSMDIR}/libsm.a
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228586 - head/libexec/pppoed

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 16:07:39 2011
New Revision: 228586
URL: http://svn.freebsd.org/changeset/base/228586

Log:
  In libexec/pppoed/pppoed.c, use the correct printf length modifier for a
  size_t.
  
  MFC after:1 week

Modified:
  head/libexec/pppoed/pppoed.c

Modified: head/libexec/pppoed/pppoed.c
==
--- head/libexec/pppoed/pppoed.cFri Dec 16 15:58:38 2011
(r228585)
+++ head/libexec/pppoed/pppoed.cFri Dec 16 16:07:39 2011
(r228586)
@@ -570,8 +570,8 @@ main(int argc, char *argv[])
 }
 exec = (char *)alloca(sizeof DEFAULT_EXEC_PREFIX + strlen(label));
 if (exec == NULL) {
-  fprintf(stderr, %s: Cannot allocate %d bytes\n, prog,
-  (int)(sizeof DEFAULT_EXEC_PREFIX) + strlen(label));
+  fprintf(stderr, %s: Cannot allocate %zu bytes\n, prog,
+  sizeof DEFAULT_EXEC_PREFIX + strlen(label));
   return EX_OSERR;
 }
 strcpy(exec, DEFAULT_EXEC_PREFIX);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228587 - head/libexec/rbootd

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 16:29:51 2011
New Revision: 228587
URL: http://svn.freebsd.org/changeset/base/228587

Log:
  In libexec/rbootd/utils.c, use the correct printf length modifiers for
  u_int32_t and size_t.
  
  MFC after:1 week

Modified:
  head/libexec/rbootd/utils.c

Modified: head/libexec/rbootd/utils.c
==
--- head/libexec/rbootd/utils.c Fri Dec 16 16:07:39 2011(r228586)
+++ head/libexec/rbootd/utils.c Fri Dec 16 16:29:51 2011(r228587)
@@ -82,8 +82,8 @@ static const char rcsid[] =
 void
 DispPkt(RMPCONN *rconn, int direct)
 {
-   static const char BootFmt[] = \t\tRetCode:%u SeqNo:%lx SessID:%x 
Vers:%u;
-   static const char ReadFmt[] = \t\tRetCode:%u Offset:%lx SessID:%x\n;
+   static const char BootFmt[] = \t\tRetCode:%u SeqNo:%x SessID:%x 
Vers:%u;
+   static const char ReadFmt[] = \t\tRetCode:%u Offset:%x SessID:%x\n;
 
struct tm *tmp;
struct rmp_packet *rmp;
@@ -166,7 +166,7 @@ DispPkt(RMPCONN *rconn, int direct)
GETWORD(rmp-r_rrpl.rmp_offset, t);
(void) fprintf(DbgFp, ReadFmt, rmp-r_rrpl.rmp_retcode,
t, ntohs(rmp-r_rrpl.rmp_session));
-   (void) fprintf(DbgFp, \t\tNoOfBytesSent: %d\n,
+   (void) fprintf(DbgFp, \t\tNoOfBytesSent: %zu\n,
rconn-rmplen - RMPREADSIZE(0));
break;
case RMP_BOOT_DONE: /* boot complete */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228588 - head/libexec/smrsh

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 16:32:08 2011
New Revision: 228588
URL: http://svn.freebsd.org/changeset/base/228588

Log:
  Unfortunately, clang gives warnings about sendmail code that cannot be
  turned off yet.  Since this is contrib code, and we don't really care
  about the warnings, just turn make them non-fatal for now.
  
  MFC after:1 week

Modified:
  head/libexec/smrsh/Makefile

Modified: head/libexec/smrsh/Makefile
==
--- head/libexec/smrsh/Makefile Fri Dec 16 16:29:51 2011(r228587)
+++ head/libexec/smrsh/Makefile Fri Dec 16 16:32:08 2011(r228588)
@@ -17,6 +17,13 @@ LDADD=   ${LIBSM}
 
 WARNS?=2
 
+.if ${CC:T:Mclang} == clang
+# Unfortunately, clang gives warnings about sendmail code that cannot
+# be turned off yet.  Since this is contrib code, and we don't really
+# care about the warnings, just turn make them non-fatal for now.
+NO_WERROR=
+.endif
+
 SRCS+= sm_os.h
 CLEANFILES+=sm_os.h
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228589 - head/contrib/telnet/telnetd

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 16:53:54 2011
New Revision: 228589
URL: http://svn.freebsd.org/changeset/base/228589

Log:
  In contrib/telnet/telnetd/utility.c, fix a few warnings about format
  strings not being literals.
  
  MFC after:1 week

Modified:
  head/contrib/telnet/telnetd/utility.c

Modified: head/contrib/telnet/telnetd/utility.c
==
--- head/contrib/telnet/telnetd/utility.c   Fri Dec 16 16:32:08 2011
(r228588)
+++ head/contrib/telnet/telnetd/utility.c   Fri Dec 16 16:53:54 2011
(r228589)
@@ -847,22 +847,22 @@ printsub(char direction, unsigned char *
for (i = 2; i  length; i++ ) {
switch (pointer[i]) {
case NEW_ENV_VAR:
-   output_data(\ VAR  + noquote);
+   output_data(%s, \ VAR  + noquote);
noquote = 2;
break;
 
case NEW_ENV_VALUE:
-   output_data(\ VALUE  + noquote);
+   output_data(%s, \ VALUE  + noquote);
noquote = 2;
break;
 
case ENV_ESC:
-   output_data(\ ESC  + noquote);
+   output_data(%s, \ ESC  + noquote);
noquote = 2;
break;
 
case ENV_USERVAR:
-   output_data(\ USERVAR  + noquote);
+   output_data(%s, \ USERVAR  + noquote);
noquote = 2;
break;
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228590 - in head: lib/libsm libexec/mail.local libexec/smrsh

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 17:02:25 2011
New Revision: 228590
URL: http://svn.freebsd.org/changeset/base/228590

Log:
  Fix typos in the comments about clang warnings in several
  sendmail-related Makefiles.
  
  Spotted by:   arundel
  MFC after:1 week

Modified:
  head/lib/libsm/Makefile
  head/libexec/mail.local/Makefile
  head/libexec/smrsh/Makefile

Modified: head/lib/libsm/Makefile
==
--- head/lib/libsm/Makefile Fri Dec 16 16:53:54 2011(r228589)
+++ head/lib/libsm/Makefile Fri Dec 16 17:02:25 2011(r228590)
@@ -19,9 +19,9 @@ CFLAGS+=${SENDMAIL_CFLAGS}
 WARNS?=2
 
 .if ${CC:T:Mclang} == clang
-# Unfortunately, clang gives a warning about sendmail code that cannot
+# Unfortunately, clang gives warnings about sendmail code that cannot
 # be turned off yet.  Since this is contrib code, and we don't really
-# care about the warnings, just turn make them non-fatal for now.
+# care about the warnings, just make them non-fatal for now.
 NO_WERROR=
 .endif
 

Modified: head/libexec/mail.local/Makefile
==
--- head/libexec/mail.local/MakefileFri Dec 16 16:53:54 2011
(r228589)
+++ head/libexec/mail.local/MakefileFri Dec 16 17:02:25 2011
(r228590)
@@ -15,7 +15,7 @@ WFORMAT=0
 .if ${CC:T:Mclang} == clang
 # Unfortunately, clang gives warnings about sendmail code that cannot
 # be turned off yet.  Since this is contrib code, and we don't really
-# care about the warnings, just turn make them non-fatal for now.
+# care about the warnings, just make them non-fatal for now.
 NO_WERROR=
 .endif
 

Modified: head/libexec/smrsh/Makefile
==
--- head/libexec/smrsh/Makefile Fri Dec 16 16:53:54 2011(r228589)
+++ head/libexec/smrsh/Makefile Fri Dec 16 17:02:25 2011(r228590)
@@ -20,7 +20,7 @@ WARNS?=   2
 .if ${CC:T:Mclang} == clang
 # Unfortunately, clang gives warnings about sendmail code that cannot
 # be turned off yet.  Since this is contrib code, and we don't really
-# care about the warnings, just turn make them non-fatal for now.
+# care about the warnings, just make them non-fatal for now.
 NO_WERROR=
 .endif
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r228571 - in head: . lib/libc/net sbin/ifconfig share/man/man4 sys/net sys/netinet sys/netinet6 sys/sys

2011-12-16 Thread Ben Kaduk
On 12/16/11, Gleb Smirnoff gleb...@freebsd.org wrote:
 Author: glebius
 Date: Fri Dec 16 12:16:56 2011
 New Revision: 228571
 URL: http://svn.freebsd.org/changeset/base/228571

 Log:
   A major overhaul of the CARP implementation. The ip_carp.c was started
   from scratch, copying needed functionality from the old implemenation
   on demand, with a thorough review of all code. The main change is that
   interface layer has been removed from the CARP. Now redundant addresses
   are configured exactly on the interfaces, they run on.

   The CARP configuration itself is, as before, configured and read via
   SIOCSVH/SIOCGVH ioctls. A new prefix created with SIOCAIFADDR or
   SIOCAIFADDR_IN6 may now be configured to a particular virtual host id,
   which makes the prefix redundant.

   ifconfig(8) semantics has been changed too: now one doesn't need
   to clone carpXX interface, he/she should directly configure a vhid
   on a Ethernet interface.

   To supply vhid data from the kernel to an application the getifaddrs(8)
   function had been changed to pass ifam_data with each address. [1]

   The new implementation definitely closes all PRs related to carp(4)
   being an interface, and may close several others. It also allows
   to run a single redundant IP per interface.

   Big thanks to Bjoern Zeeb for his help with inet6 part of patch, for
   idea on using ifam_data and for several rounds of reviewing!

   PR: kern/117000, kern/126945, kern/126714, kern/120130, kern/117448
   Reviewed by:bz
   Submitted by:   bz [1]

 Modified:
   head/UPDATING
   head/lib/libc/net/getifaddrs.c
   head/sbin/ifconfig/af_inet.c
   head/sbin/ifconfig/af_inet6.c
   head/sbin/ifconfig/ifcarp.c
   head/sbin/ifconfig/ifconfig.8
   head/sbin/ifconfig/ifconfig.c
   head/sbin/ifconfig/ifconfig.h
   head/share/man/man4/carp.4
   head/sys/net/if.c
   head/sys/net/if.h
   head/sys/net/if_ethersubr.c
   head/sys/net/if_types.h
   head/sys/net/if_var.h
   head/sys/net/rtsock.c
   head/sys/netinet/if_ether.c
   head/sys/netinet/if_ether.h
   head/sys/netinet/in.c
   head/sys/netinet/in_var.h
   head/sys/netinet/ip_carp.c
   head/sys/netinet/ip_carp.h
   head/sys/netinet6/in6.c
   head/sys/netinet6/in6_ifattach.c
   head/sys/netinet6/in6_var.h
   head/sys/netinet6/nd6.c
   head/sys/netinet6/nd6_nbr.c
   head/sys/sys/param.h

 Modified: head/UPDATING
 ==
==
 --- head/share/man/man4/carp.4Fri Dec 16 11:52:33 2011
 (r228570)
 +++ head/share/man/man4/carp.4Fri Dec 16 12:16:56 2011
 (r228571)
 @@ -1,6 +1,7 @@
  .\  $OpenBSD: carp.4,v 1.16 2004/12/07 23:41:35 jmc Exp $
  .\
  .\ Copyright (c) 2003, Ryan McBride.  All rights reserved.
 +.\ Copyright (c) 2011, Gleb Smirnoff gleb...@freebsd.org
  .\
  .\ Redistribution and use in source and binary forms, with or without
  .\ modification, are permitted provided that the following conditions
 @@ -138,36 +131,36 @@ Value of 0 means that preemption is not
  problems are detected.
  Every problem increments suppression counter.
  .El
 -.Sh ARP level load balancing
 -The
 -.Nm
 -has limited abilities for load balancing the incoming connections
 -between hosts in Ethernet network.
 -For load balancing operation, one needs several CARP interfaces that
 -are configured to the same IP address, but to a different VHIDs.
 -Once an ARP request is received, the CARP protocol will use a hashing
 -function against the source IP address in the ARP request to determine
 -which VHID should this request belong to.
 -If the corresponding CARP interface is in master state, the ARP request
 -will be replied, otherwise it will be ignored.
 -See the
 -.Sx EXAMPLES
 -section for a practical example of load balancing.
 -.Pp
 -The ARP load balancing has some limitations.
 -First, ARP balancing only works on the local network segment.
 -It cannot balance traffic that crosses a router, because the
 -router itself will always be balanced to the same virtual host.
 -Second, ARP load balancing can lead to asymmetric routing
 -of incoming and outgoing traffic, and thus combining it with
 -.Xr pfsync 4
 -is dangerous, because this creates a race condition between
 -balanced routers and a host they are serving.
 -Imagine an incoming packet creating state on the first router, being
 -forwarded to its destination, and destination replying faster
 -than the state information is packed and synced with the second router.
 -If the reply would be load balanced to second router, it will be
 -dropped due to no state.
 +.\.Sh ARP level load balancing
 +.\The
 +.\.Nm
 +.\has limited abilities for load balancing the incoming connections
 +.\between hosts in Ethernet network.
 +.\For load balancing operation, one needs several CARP interfaces that
 +.\are configured to the same IP address, but to a different vhids.
 +.\Once an ARP request is received, the CARP protocol will use a hashing
 

svn commit: r228592 - head/libexec/ypxfr

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 19:39:49 2011
New Revision: 228592
URL: http://svn.freebsd.org/changeset/base/228592

Log:
  Attempt to fix the numerous incompatible enum conversions in
  libexec/ypxfr in the least disruptive way.
  
  MFC after:1 week

Modified:
  head/libexec/ypxfr/yp_dbwrite.c
  head/libexec/ypxfr/ypxfr_extern.h
  head/libexec/ypxfr/ypxfr_getmap.c
  head/libexec/ypxfr/ypxfr_main.c

Modified: head/libexec/ypxfr/yp_dbwrite.c
==
--- head/libexec/ypxfr/yp_dbwrite.c Fri Dec 16 19:38:31 2011
(r228591)
+++ head/libexec/ypxfr/yp_dbwrite.c Fri Dec 16 19:39:49 2011
(r228592)
@@ -58,10 +58,10 @@ yp_open_db_rw(const char *domain, const 
char buf[1025];
 
 
-   yp_errno = YP_TRUE;
+   yp_errno = YPXFR_SUCC;
 
if (map[0] == '.' || strchr(map, '/')) {
-   yp_errno = YP_BADARGS;
+   yp_errno = YPXFR_BADARGS;
return (NULL);
}
 
@@ -73,13 +73,13 @@ yp_open_db_rw(const char *domain, const 
if (dbp == NULL) {
switch (errno) {
case ENOENT:
-   yp_errno = YP_NOMAP;
+   yp_errno = YPXFR_NOMAP;
break;
case EFTYPE:
-   yp_errno = YP_BADDB;
+   yp_errno = YPXFR_MADDR;
break;
default:
-   yp_errno = YP_YPERR;
+   yp_errno = YPXFR_YPERR;
break;
}
}

Modified: head/libexec/ypxfr/ypxfr_extern.h
==
--- head/libexec/ypxfr/ypxfr_extern.h   Fri Dec 16 19:38:31 2011
(r228591)
+++ head/libexec/ypxfr/ypxfr_extern.h   Fri Dec 16 19:39:49 2011
(r228592)
@@ -46,7 +46,7 @@ extern BTREEINFO openinfo_b;
 
 extern char*yp_dir;
 extern int debug;
-extern enum ypstat yp_errno;
+extern ypxfrstat yp_errno;
 extern voidyp_error(const char *, ...);
 extern int _yp_check(char **);
 extern const char *ypxfrerr_string(ypxfrstat);

Modified: head/libexec/ypxfr/ypxfr_getmap.c
==
--- head/libexec/ypxfr/ypxfr_getmap.c   Fri Dec 16 19:38:31 2011
(r228591)
+++ head/libexec/ypxfr/ypxfr_getmap.c   Fri Dec 16 19:39:49 2011
(r228592)
@@ -46,7 +46,6 @@ extern bool_t xdr_ypresp_all_seq(XDR *, 
 int (*ypresp_allfn)();
 void *ypresp_data;
 extern DB *specdbp;
-extern enum ypstat yp_errno;
 
 /*
  * This is largely the same as yp_all() except we do the transfer

Modified: head/libexec/ypxfr/ypxfr_main.c
==
--- head/libexec/ypxfr/ypxfr_main.c Fri Dec 16 19:38:31 2011
(r228591)
+++ head/libexec/ypxfr/ypxfr_main.c Fri Dec 16 19:39:49 2011
(r228592)
@@ -88,7 +88,7 @@ ypxfr_exit(ypxfrstat retval, char *temp)
exit(1);
}
 
-   ypxfr_resp.status = retval;
+   ypxfr_resp.status = (yppush_status)retval;
 
if (yppushproc_xfrresp_1(ypxfr_resp, clnt) == NULL) {
yp_error(%s, clnt_sperror(clnt, callback failed));
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228593 - head/sys/kern

2011-12-16 Thread John Baldwin
Author: jhb
Date: Fri Dec 16 20:10:00 2011
New Revision: 228593
URL: http://svn.freebsd.org/changeset/base/228593

Log:
  Fire a kevent if necessary after seeking on a regular file.  This fixes a
  case where a kevent would not fire on a regular file if an application read
  to EOF and then seeked backwards into the file.
  
  Reviewed by:  kib
  MFC after:2 weeks

Modified:
  head/sys/kern/vfs_syscalls.c

Modified: head/sys/kern/vfs_syscalls.c
==
--- head/sys/kern/vfs_syscalls.cFri Dec 16 19:39:49 2011
(r228592)
+++ head/sys/kern/vfs_syscalls.cFri Dec 16 20:10:00 2011
(r228593)
@@ -2050,6 +2050,7 @@ sys_lseek(td, uap)
if (error != 0)
goto drop;
fp-f_offset = offset;
+   VFS_KNOTE_UNLOCKED(vp, 0);
*(off_t *)(td-td_retval) = fp-f_offset;
 drop:
fdrop(fp, td);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228594 - head/tools/tools/cxgbetool

2011-12-16 Thread Navdeep Parhar
Author: np
Date: Fri Dec 16 20:38:22 2011
New Revision: 228594
URL: http://svn.freebsd.org/changeset/base/228594

Log:
  Catch up with new driver ioctls in cxgbe.
  
  MFC after:1 month

Modified:
  head/tools/tools/cxgbetool/cxgbetool.c

Modified: head/tools/tools/cxgbetool/cxgbetool.c
==
--- head/tools/tools/cxgbetool/cxgbetool.c  Fri Dec 16 20:10:00 2011
(r228593)
+++ head/tools/tools/cxgbetool/cxgbetool.c  Fri Dec 16 20:38:22 2011
(r228594)
@@ -30,14 +30,17 @@ __FBSDID($FreeBSD$);
 
 #include stdint.h
 #include stdlib.h
+#include unistd.h
 #include errno.h
 #include err.h
 #include fcntl.h
 #include string.h
 #include stdio.h
 #include sys/ioctl.h
+#include sys/mman.h
 #include sys/types.h
 #include sys/socket.h
+#include sys/stat.h
 #include net/ethernet.h
 #include netinet/in.h
 #include arpa/inet.h
@@ -83,10 +86,13 @@ usage(FILE *fp)
\tfilter idx delete|clear   delete a filter\n
\tfilter list list all filters\n
\tfilter mode [match] ...   get/set global filter mode\n
+   \tloadfw fw-image.bin   install firmware\n
+   \tmemdump addr lendump a memory range\n
\treg address[=val]   read/write register\n
\treg64 address[=val] read/write 64 bit register\n
\tregdump [module] ...  dump registers\n
\tstdio   interactive mode\n
+   \ttcb tid   read TCB\n
);
 }
 
@@ -1353,6 +1359,169 @@ get_sge_context(int argc, const char *ar
 }
 
 static int
+loadfw(int argc, const char *argv[])
+{
+   int rc, fd;
+   struct t4_data data = {0};
+   const char *fname = argv[0];
+   struct stat st = {0};
+
+   if (argc != 1) {
+   warnx(loadfw: incorrect number of arguments.);
+   return (EINVAL);
+   }
+
+   fd = open(fname, O_RDONLY);
+   if (fd  0) {
+   warn(open(%s), fname);
+   return (errno);
+   }
+
+   if (fstat(fd, st)  0) {
+   warn(fstat);
+   close(fd);
+   return (errno);
+   }
+
+   data.len = st.st_size;
+   data.data = mmap(0, data.len, PROT_READ, 0, fd, 0);
+   if (data.data == MAP_FAILED) {
+   warn(mmap);
+   close(fd);
+   return (errno);
+   }
+
+   rc = doit(CHELSIO_T4_LOAD_FW, data);
+   munmap(data.data, data.len);
+   close(fd);
+   return (rc);
+}
+
+static int
+read_mem(uint32_t addr, uint32_t len, void (*output)(uint32_t *, uint32_t))
+{
+   int rc;
+   struct t4_mem_range mr;
+
+   mr.addr = addr;
+   mr.len = len;
+   mr.data = malloc(mr.len);
+
+   if (mr.data == 0) {
+   warn(read_mem: malloc);
+   return (errno);
+   }
+
+   rc = doit(CHELSIO_T4_GET_MEM, mr);
+   if (rc != 0)
+   goto done;
+
+   if (output)
+   (*output)(mr.data, mr.len);
+done:
+   free(mr.data);
+   return (rc);
+}
+
+/*
+ * Display memory as list of 'n' 4-byte values per line.
+ */
+static void
+show_mem(uint32_t *buf, uint32_t len)
+{
+   const char *s;
+   int i, n = 8;
+
+   while (len) {
+   for (i = 0; len  i  n; i++, buf++, len -= 4) {
+   s = i ?   : ;
+   printf(%s%08x, s, htonl(*buf));
+   }
+   printf(\n);
+   }
+}
+
+static int
+memdump(int argc, const char *argv[])
+{
+   char *p;
+   long l;
+   uint32_t addr, len;
+
+   if (argc != 2) {
+   warnx(incorrect number of arguments.);
+   return (EINVAL);
+   }
+
+   p = str_to_number(argv[0], l, NULL);
+   if (*p) {
+   warnx(invalid address \%s\, argv[0]);
+   return (EINVAL);
+   }
+   addr = l;
+
+   p = str_to_number(argv[1], l, NULL);
+   if (*p) {
+   warnx(memdump: invalid length \%s\, argv[1]);
+   return (EINVAL);
+   }
+   len = l;
+
+   return (read_mem(addr, len, show_mem));
+}
+
+/*
+ * Display TCB as list of 'n' 4-byte values per line.
+ */
+static void
+show_tcb(uint32_t *buf, uint32_t len)
+{
+   const char *s;
+   int i, n = 8;
+
+   while (len) {
+   for (i = 0; len  i  n; i++, buf++, len -= 4) {
+   s = i ?   : ;
+   printf(%s%08x, s, htonl(*buf));
+   }
+   printf(\n);
+   }
+}
+
+#define A_TP_CMM_TCB_BASE 0x7d10
+#define TCB_SIZE 128
+static int
+read_tcb(int argc, const char *argv[])
+{
+   char *p;
+   long l;
+   long long val;
+   unsigned int tid;
+   uint32_t addr;
+   int rc;
+
+   if (argc != 1) {
+   warnx(incorrect number of 

svn commit: r228595 - head/bin/ed

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 21:12:23 2011
New Revision: 228595
URL: http://svn.freebsd.org/changeset/base/228595

Log:
  Fix some obtuse fprintf tricks in bin/ed.
  
  MFC after:1 week

Modified:
  head/bin/ed/io.c
  head/bin/ed/main.c

Modified: head/bin/ed/io.c
==
--- head/bin/ed/io.cFri Dec 16 20:38:22 2011(r228594)
+++ head/bin/ed/io.cFri Dec 16 21:12:23 2011(r228595)
@@ -53,7 +53,8 @@ read_file(char *fn, long n)
errmsg = cannot close input file;
return ERR;
}
-   fprintf(stdout, !scripted ? %lu\n : , size);
+   if (!scripted)
+   fprintf(stdout, %lu\n, size);
return current_addr - n;
 }
 
@@ -161,7 +162,8 @@ write_file(char *fn, const char *mode, l
errmsg = cannot close output file;
return ERR;
}
-   fprintf(stdout, !scripted ? %lu\n : , size);
+   if (!scripted)
+   fprintf(stdout, %lu\n, size);
return n ? m - n + 1 : 0;
 }
 

Modified: head/bin/ed/main.c
==
--- head/bin/ed/main.c  Fri Dec 16 20:38:22 2011(r228594)
+++ head/bin/ed/main.c  Fri Dec 16 21:12:23 2011(r228595)
@@ -192,9 +192,10 @@ top:
fputs(?\n, stderr);
errmsg = warning: file modified;
if (!isatty(0)) {
-   fprintf(stderr, garrulous ?
-   script, line %d: %s\n :
-   , lineno, errmsg);
+   if (garrulous)
+   fprintf(stderr,
+   script, line %d: %s\n,
+   lineno, errmsg);
quit(2);
}
clearerr(stdin);
@@ -225,27 +226,26 @@ top:
fputs(?\n, stderr);   /* give warning */
errmsg = warning: file modified;
if (!isatty(0)) {
-   fprintf(stderr, garrulous ?
-   script, line %d: %s\n :
-   , lineno, errmsg);
+   if (garrulous)
+   fprintf(stderr, script, line %d: %s\n,
+   lineno, errmsg);
quit(2);
}
break;
case FATAL:
-   if (!isatty(0))
-   fprintf(stderr, garrulous ?
-   script, line %d: %s\n : ,
-   lineno, errmsg);
-   else
-   fprintf(stderr, garrulous ? %s\n : ,
-   errmsg);
+   if (!isatty(0)) {
+   if (garrulous)
+   fprintf(stderr, script, line %d: %s\n,
+   lineno, errmsg);
+   } else if (garrulous)
+   fprintf(stderr, %s\n, errmsg);
quit(3);
default:
fputs(?\n, stderr);
if (!isatty(0)) {
-   fprintf(stderr, garrulous ?
-   script, line %d: %s\n : ,
-   lineno, errmsg);
+   if (garrulous)
+   fprintf(stderr, script, line %d: %s\n,
+   lineno, errmsg);
quit(2);
}
break;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228596 - head/games/factor

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 21:24:11 2011
New Revision: 228596
URL: http://svn.freebsd.org/changeset/base/228596

Log:
  In games/factor/factor.c, fix a warning about a format string not being
  a literal.
  
  MFC after:1 week

Modified:
  head/games/factor/factor.c

Modified: head/games/factor/factor.c
==
--- head/games/factor/factor.c  Fri Dec 16 21:12:23 2011(r228595)
+++ head/games/factor/factor.c  Fri Dec 16 21:24:11 2011(r228596)
@@ -322,7 +322,7 @@ BN_print_dec_fp(FILE *fp, const BIGNUM *
buf = BN_bn2dec(num);
if (buf == NULL)
return; /* XXX do anything here? */
-   fprintf(fp, buf);
+   fprintf(fp, %s, buf);
free(buf);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228597 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 21:29:46 2011
New Revision: 228597
URL: http://svn.freebsd.org/changeset/base/228597

Log:
  In cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c, a size_t is passed
  to fprintf as a field width.  It should be an int instead, so cast it.
  
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c

Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c
==
--- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c  Fri Dec 16 
21:24:11 2011(r228596)
+++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctfmerge.c  Fri Dec 16 
21:29:46 2011(r228597)
@@ -228,7 +228,7 @@ usage(void)
\n
  Note: if -L labelenv is specified and labelenv is not set in\n
  the environment, a default value is used.\n,
-   progname, progname, strlen(progname),  ,
+   progname, progname, (int)strlen(progname),  ,
progname, progname);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228598 - head/cddl/contrib/opensolaris/cmd/dtrace

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 21:48:09 2011
New Revision: 228598
URL: http://svn.freebsd.org/changeset/base/228598

Log:
  In cddl/contrib/opensolaris/cmd/dtrace/dtrace.c, fix some obtuse
  snprintf tricks.
  
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
==
--- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c   Fri Dec 16 21:29:46 
2011(r228597)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c   Fri Dec 16 21:48:09 
2011(r228598)
@@ -671,9 +671,12 @@ link_prog(dtrace_cmd_t *dcp)
p[0] = '\0'; /* strip .d suffix */
(void) snprintf(dcp-dc_ofile, sizeof (dcp-dc_ofile),
%s.o, basename(dcp-dc_arg));
+   } else if (g_cmdc  1) {
+   (void) snprintf(dcp-dc_ofile, sizeof (dcp-dc_ofile),
+   d.out.%td, dcp - g_cmdv);
} else {
(void) snprintf(dcp-dc_ofile, sizeof (dcp-dc_ofile),
-   g_cmdc  1 ?  %s.%d : %s, d.out, (int)(dcp - g_cmdv));
+   d.out);
}
 
if (dtrace_program_link(g_dtp, dcp-dc_prog, DTRACE_D_PROBES,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228599 - head/libexec/ypxfr

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 21:57:44 2011
New Revision: 228599
URL: http://svn.freebsd.org/changeset/base/228599

Log:
  Revert r228592, as the non-messy way of fixing ypxfr breaks other yp
  programs (e.g. usr.sbin/rpc.yppasswdd).
  
  Spotted by:   np
  MFC after:1 week

Modified:
  head/libexec/ypxfr/yp_dbwrite.c
  head/libexec/ypxfr/ypxfr_extern.h
  head/libexec/ypxfr/ypxfr_getmap.c
  head/libexec/ypxfr/ypxfr_main.c

Modified: head/libexec/ypxfr/yp_dbwrite.c
==
--- head/libexec/ypxfr/yp_dbwrite.c Fri Dec 16 21:48:09 2011
(r228598)
+++ head/libexec/ypxfr/yp_dbwrite.c Fri Dec 16 21:57:44 2011
(r228599)
@@ -58,10 +58,10 @@ yp_open_db_rw(const char *domain, const 
char buf[1025];
 
 
-   yp_errno = YPXFR_SUCC;
+   yp_errno = YP_TRUE;
 
if (map[0] == '.' || strchr(map, '/')) {
-   yp_errno = YPXFR_BADARGS;
+   yp_errno = YP_BADARGS;
return (NULL);
}
 
@@ -73,13 +73,13 @@ yp_open_db_rw(const char *domain, const 
if (dbp == NULL) {
switch (errno) {
case ENOENT:
-   yp_errno = YPXFR_NOMAP;
+   yp_errno = YP_NOMAP;
break;
case EFTYPE:
-   yp_errno = YPXFR_MADDR;
+   yp_errno = YP_BADDB;
break;
default:
-   yp_errno = YPXFR_YPERR;
+   yp_errno = YP_YPERR;
break;
}
}

Modified: head/libexec/ypxfr/ypxfr_extern.h
==
--- head/libexec/ypxfr/ypxfr_extern.h   Fri Dec 16 21:48:09 2011
(r228598)
+++ head/libexec/ypxfr/ypxfr_extern.h   Fri Dec 16 21:57:44 2011
(r228599)
@@ -46,7 +46,7 @@ extern BTREEINFO openinfo_b;
 
 extern char*yp_dir;
 extern int debug;
-extern ypxfrstat yp_errno;
+extern enum ypstat yp_errno;
 extern voidyp_error(const char *, ...);
 extern int _yp_check(char **);
 extern const char *ypxfrerr_string(ypxfrstat);

Modified: head/libexec/ypxfr/ypxfr_getmap.c
==
--- head/libexec/ypxfr/ypxfr_getmap.c   Fri Dec 16 21:48:09 2011
(r228598)
+++ head/libexec/ypxfr/ypxfr_getmap.c   Fri Dec 16 21:57:44 2011
(r228599)
@@ -46,6 +46,7 @@ extern bool_t xdr_ypresp_all_seq(XDR *, 
 int (*ypresp_allfn)();
 void *ypresp_data;
 extern DB *specdbp;
+extern enum ypstat yp_errno;
 
 /*
  * This is largely the same as yp_all() except we do the transfer

Modified: head/libexec/ypxfr/ypxfr_main.c
==
--- head/libexec/ypxfr/ypxfr_main.c Fri Dec 16 21:48:09 2011
(r228598)
+++ head/libexec/ypxfr/ypxfr_main.c Fri Dec 16 21:57:44 2011
(r228599)
@@ -88,7 +88,7 @@ ypxfr_exit(ypxfrstat retval, char *temp)
exit(1);
}
 
-   ypxfr_resp.status = (yppush_status)retval;
+   ypxfr_resp.status = retval;
 
if (yppushproc_xfrresp_1(ypxfr_resp, clnt) == NULL) {
yp_error(%s, clnt_sperror(clnt, callback failed));
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228600 - head/libexec/ypxfr

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 22:05:10 2011
New Revision: 228600
URL: http://svn.freebsd.org/changeset/base/228600

Log:
  Fix the incompatible enum conversions in libexec/ypxfr in another, more
  messy way, so as to not disrupt other yp programs: just add casts to
  convert the incompatible enums, as the numerical values are the same
  (either by accident, design, or the phase of the moon at that time).
  
  MFC after:1 week

Modified:
  head/libexec/ypxfr/ypxfr_getmap.c
  head/libexec/ypxfr/ypxfr_main.c
  head/libexec/ypxfr/ypxfr_misc.c

Modified: head/libexec/ypxfr/ypxfr_getmap.c
==
--- head/libexec/ypxfr/ypxfr_getmap.c   Fri Dec 16 21:57:44 2011
(r228599)
+++ head/libexec/ypxfr/ypxfr_getmap.c   Fri Dec 16 22:05:10 2011
(r228600)
@@ -73,7 +73,7 @@ ypxfr_get_map(char *map, char *domain, c
if ((clnt = clnt_create(host, YPPROG, YPVERS, tcp)) == NULL) {
yp_error(%s, clnt_spcreateerror(failed to \
 create tcp handle));
-   yp_errno = YPXFR_YPERR;
+   yp_errno = (enum ypstat)YPXFR_YPERR;
return(1);
}
 
@@ -91,7 +91,7 @@ create tcp handle));
return(0);
 
if (status != YP_TRUE) {
-   yp_errno = YPXFR_YPERR;
+   yp_errno = (enum ypstat)YPXFR_YPERR;
return(1);
}
 

Modified: head/libexec/ypxfr/ypxfr_main.c
==
--- head/libexec/ypxfr/ypxfr_main.c Fri Dec 16 21:57:44 2011
(r228599)
+++ head/libexec/ypxfr/ypxfr_main.c Fri Dec 16 22:05:10 2011
(r228600)
@@ -88,7 +88,7 @@ ypxfr_exit(ypxfrstat retval, char *temp)
exit(1);
}
 
-   ypxfr_resp.status = retval;
+   ypxfr_resp.status = (yppush_status)retval;
 
if (yppushproc_xfrresp_1(ypxfr_resp, clnt) == NULL) {
yp_error(%s, clnt_sperror(clnt, callback failed));
@@ -329,7 +329,7 @@ the local domain name isn't set);
ypxfr_use_yplib)) == NULL) {
yp_error(failed to find master of %s in domain %s: %s,
  ypxfr_mapname, ypxfr_source_domain,
- ypxfrerr_string(yp_errno));
+ ypxfrerr_string((ypxfrstat)yp_errno));
ypxfr_exit(YPXFR_MADDR,NULL);
}
}
@@ -358,7 +358,8 @@ the local domain name isn't set);
 ypxfr_master, 0)) == 0) {
yp_error(failed to get order number of %s: %s,
ypxfr_mapname, yp_errno == YPXFR_SUCC ?
-   map has order 0 : ypxfrerr_string(yp_errno));
+   map has order 0 :
+   ypxfrerr_string((ypxfrstat)yp_errno));
ypxfr_exit(YPXFR_YPERR,NULL);
}
 
@@ -533,7 +534,8 @@ leave:
 ypxfr_master, 0)) == 0) {
yp_error(failed to get order number of %s: %s,
ypxfr_mapname, yp_errno == YPXFR_SUCC ?
-   map has order 0 : ypxfrerr_string(yp_errno));
+   map has order 0 :
+   ypxfrerr_string((ypxfrstat)yp_errno));
ypxfr_exit(YPXFR_YPERR,ypxfr_temp_map);
}
 

Modified: head/libexec/ypxfr/ypxfr_misc.c
==
--- head/libexec/ypxfr/ypxfr_misc.c Fri Dec 16 21:57:44 2011
(r228599)
+++ head/libexec/ypxfr/ypxfr_misc.c Fri Dec 16 22:05:10 2011
(r228600)
@@ -130,14 +130,14 @@ ypxfr_get_master(char *domain, char *map
if ((res = yp_master(domain, map, master))) {
switch (res) {
case YPERR_DOMAIN:
-   yp_errno = YPXFR_NODOM;
+   yp_errno = (enum ypstat)YPXFR_NODOM;
break;
case YPERR_MAP:
-   yp_errno = YPXFR_NOMAP;
+   yp_errno = (enum ypstat)YPXFR_NOMAP;
break;
case YPERR_YPERR:
default:
-   yp_errno = YPXFR_YPERR;
+   yp_errno = (enum ypstat)YPXFR_YPERR;
break;
}
return(NULL);
@@ -154,7 +154,7 @@ ypxfr_get_master(char *domain, char *map
if ((clnt = clnt_create(source,YPPROG,YPVERS,udp)) == NULL) {
yp_error(%s,clnt_spcreateerror(failed to \
 create udp handle to ypserv));
-   

svn commit: r228601 - head/gnu/usr.bin/binutils/libbinutils

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 22:19:13 2011
New Revision: 228601
URL: http://svn.freebsd.org/changeset/base/228601

Log:
  Define YY_NO_INPUT when building libbinutils, to prevent warnings about
  unused input() functions emitted by lex.
  
  MFC after:1 week

Modified:
  head/gnu/usr.bin/binutils/libbinutils/Makefile

Modified: head/gnu/usr.bin/binutils/libbinutils/Makefile
==
--- head/gnu/usr.bin/binutils/libbinutils/Makefile  Fri Dec 16 22:05:10 
2011(r228600)
+++ head/gnu/usr.bin/binutils/libbinutils/Makefile  Fri Dec 16 22:19:13 
2011(r228601)
@@ -25,6 +25,7 @@ SRCS+=arlex.l \
 CFLAGS+= -DTARGET=\${TARGET_TUPLE}\
 CFLAGS+= -DBFD_VERSION_STRING=\${VERSION}\
 CFLAGS+= -D_GNU_SOURCE
+CFLAGS+= -DYY_NO_INPUT
 CFLAGS+= -I${SRCDIR}/binutils
 CFLAGS+= -I${SRCDIR}/bfd
 INTERNALLIB=
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228602 - head/sbin/camcontrol

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 22:35:19 2011
New Revision: 228602
URL: http://svn.freebsd.org/changeset/base/228602

Log:
  In sbin/camcontrol/camcontrol.c, fix a few warnings about format strings
  not being literals.
  
  MFC after:1 week

Modified:
  head/sbin/camcontrol/camcontrol.c

Modified: head/sbin/camcontrol/camcontrol.c
==
--- head/sbin/camcontrol/camcontrol.c   Fri Dec 16 22:19:13 2011
(r228601)
+++ head/sbin/camcontrol/camcontrol.c   Fri Dec 16 22:35:19 2011
(r228602)
@@ -2506,7 +2506,7 @@ scsicmd(struct cam_device *device, int a
 
if (((retval = cam_send_ccb(device, ccb))  0)
 || ((ccb-ccb_h.status  CAM_STATUS_MASK) != CAM_REQ_CMP)) {
-   const char *warnstr = error sending command;
+   const char warnstr[] = error sending command;
 
if (retval  0)
warn(warnstr);
@@ -4449,7 +4449,7 @@ smpcmd(struct cam_device *device, int ar
 
if (((retval = cam_send_ccb(device, ccb))  0)
 || ((ccb-ccb_h.status  CAM_STATUS_MASK) != CAM_REQ_CMP)) {
-   const char *warnstr = error sending command;
+   const char warnstr[] = error sending command;
 
if (retval  0)
warn(warnstr);
@@ -4567,7 +4567,7 @@ try_long:
 
if (((retval = cam_send_ccb(device, ccb))  0)
 || ((ccb-ccb_h.status  CAM_STATUS_MASK) != CAM_REQ_CMP)) {
-   const char *warnstr = error sending command;
+   const char warnstr[] = error sending command;
 
if (retval  0)
warn(warnstr);
@@ -4872,7 +4872,7 @@ smpphycontrol(struct cam_device *device,
 
if (((retval = cam_send_ccb(device, ccb))  0)
 || ((ccb-ccb_h.status  CAM_STATUS_MASK) != CAM_REQ_CMP)) {
-   const char *warnstr = error sending command;
+   const char warnstr[] = error sending command;
 
if (retval  0)
warn(warnstr);
@@ -4954,7 +4954,7 @@ smpmaninfo(struct cam_device *device, in
 
if (((retval = cam_send_ccb(device, ccb))  0)
 || ((ccb-ccb_h.status  CAM_STATUS_MASK) != CAM_REQ_CMP)) {
-   const char *warnstr = error sending command;
+   const char warnstr[] = error sending command;
 
if (retval  0)
warn(warnstr);
@@ -5351,7 +5351,7 @@ smpphylist(struct cam_device *device, in
 
if (((retval = cam_send_ccb(device, ccb))  0)
 || ((ccb-ccb_h.status  CAM_STATUS_MASK) != CAM_REQ_CMP)) {
-   const char *warnstr = error sending command;
+   const char warnstr[] = error sending command;
 
if (retval  0)
warn(warnstr);
@@ -5431,7 +5431,7 @@ smpphylist(struct cam_device *device, in
if (((retval = cam_send_ccb(device, ccb))  0)
 || (((ccb-ccb_h.status  CAM_STATUS_MASK) != CAM_REQ_CMP)
   (disresponse-function_result != SMP_FR_PHY_VACANT))) {
-   const char *warnstr = error sending command;
+   const char warnstr[] = error sending command;
 
if (retval  0)
warn(warnstr);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228603 - head/sbin/fsdb

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 23:09:31 2011
New Revision: 228603
URL: http://svn.freebsd.org/changeset/base/228603

Log:
  In sbin/fsdb/fsdbutil.c, work around a clang false positive with printf
  format warnings and conditional operators.  (See LLVM PR 11313 for more
  information.)
  
  MFC after:1 week

Modified:
  head/sbin/fsdb/fsdbutil.c

Modified: head/sbin/fsdb/fsdbutil.c
==
--- head/sbin/fsdb/fsdbutil.c   Fri Dec 16 22:35:19 2011(r228602)
+++ head/sbin/fsdb/fsdbutil.c   Fri Dec 16 23:09:31 2011(r228603)
@@ -193,8 +193,9 @@ printstat(const char *cp, ino_t inum, un
 
 blocks = DIP(dp, di_blocks);
 gen = DIP(dp, di_gen);
-printf(LINKCNT=%hd FLAGS=%#x BLKCNT=%jx GEN=%jx\n, DIP(dp, di_nlink),
-   DIP(dp, di_flags), (intmax_t)blocks, (intmax_t)gen);
+printf(LINKCNT=%hd FLAGS=%#x BLKCNT=%jx GEN=%jx\n,
+  (short)DIP(dp, di_nlink), DIP(dp, di_flags), (intmax_t)blocks,
+  (intmax_t)gen);
 }
 
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228604 - head/contrib/gperf/src

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 23:15:11 2011
New Revision: 228604
URL: http://svn.freebsd.org/changeset/base/228604

Log:
  In contrib/gperf/src/output.cc, use the correct printf length modifier
  for a ptrdiff_t.
  
  MFC after:1 week

Modified:
  head/contrib/gperf/src/output.cc

Modified: head/contrib/gperf/src/output.cc
==
--- head/contrib/gperf/src/output.ccFri Dec 16 23:09:31 2011
(r228603)
+++ head/contrib/gperf/src/output.ccFri Dec 16 23:15:11 2011
(r228604)
@@ -1300,7 +1300,7 @@ Output::output_lookup_array () const
 
   if (option[DEBUG])
 fprintf (stderr,
- dup_ptr[%d]: hash_value = %d, index = %d, count = %d\n,
+ dup_ptr[%td]: hash_value = %d, index = %d, count = %d\n,
  dup_ptr - duplicates,
  dup_ptr-hash_value, dup_ptr-index, dup_ptr-count);
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228605 - head/sys/powerpc/aim

2011-12-16 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Fri Dec 16 23:40:56 2011
New Revision: 228605
URL: http://svn.freebsd.org/changeset/base/228605

Log:
  Zero BSS on start, in case the ELF loader that started the kernel did not
  do this for us. This can happen on some embedded systems.
  
  Submitted by: rpaulo

Modified:
  head/sys/powerpc/aim/locore32.S

Modified: head/sys/powerpc/aim/locore32.S
==
--- head/sys/powerpc/aim/locore32.S Fri Dec 16 23:15:11 2011
(r228604)
+++ head/sys/powerpc/aim/locore32.S Fri Dec 16 23:40:56 2011
(r228605)
@@ -128,6 +128,17 @@ __start:
sync
isync
 
+   /* Zero bss, in case we were started by something unhelpful */
+   li  0,0
+   lis 8,_edata@ha
+   addi8,8,_edata@l
+   lis 9,_end@ha
+   addi9,9,_end@l
+2: stw 0,0(8)
+   addi8,8,4
+   cmplw   8,9
+   blt 2b
+   
/* Save the argument pointer and length */
mr  20,6
mr  21,7
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228607 - head/sbin/routed/rtquery

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 23:43:58 2011
New Revision: 228607
URL: http://svn.freebsd.org/changeset/base/228607

Log:
  Use NO_WARRAY_BOUNDS for sbin/routed/rtquery.
  
  MFC after:1 week

Modified:
  head/sbin/routed/rtquery/Makefile

Modified: head/sbin/routed/rtquery/Makefile
==
--- head/sbin/routed/rtquery/Makefile   Fri Dec 16 23:42:25 2011
(r228606)
+++ head/sbin/routed/rtquery/Makefile   Fri Dec 16 23:43:58 2011
(r228607)
@@ -7,5 +7,6 @@ MAN=rtquery.8
 LDADD= -lmd
 DPADD= ${LIBMD}
 WARNS?=3
+NO_WARRAY_BOUNDS=
 
 .include bsd.prog.mk
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228609 - head/sys/powerpc/aim

2011-12-16 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Fri Dec 16 23:46:05 2011
New Revision: 228609
URL: http://svn.freebsd.org/changeset/base/228609

Log:
  Allow this to work on embedded systems without Open Firmware by making
  lack of a /chosen non-fatal, and manually removing memory in use by the
  kernel from the physical memory map.
  
  Submitted by: rpaulo

Modified:
  head/sys/powerpc/aim/mmu_oea.c

Modified: head/sys/powerpc/aim/mmu_oea.c
==
--- head/sys/powerpc/aim/mmu_oea.c  Fri Dec 16 23:44:16 2011
(r228608)
+++ head/sys/powerpc/aim/mmu_oea.c  Fri Dec 16 23:46:05 2011
(r228609)
@@ -153,6 +153,7 @@ __FBSDID($FreeBSD$);
 #include machine/smp.h
 #include machine/sr.h
 #include machine/mmuvar.h
+#include machine/trap_aim.h
 
 #include mmu_if.h
 
@@ -759,6 +760,38 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k
phys_avail_count++;
physsz += regions[i].mr_size;
}
+
+   /* Check for overlap with the kernel and exception vectors */
+   for (j = 0; j  2*phys_avail_count; j+=2) {
+   if (phys_avail[j]  EXC_LAST)
+   phys_avail[j] += EXC_LAST;
+
+   if (kernelstart = phys_avail[j] 
+   kernelstart  phys_avail[j+1]) {
+   if (kernelend  phys_avail[j+1]) {
+   phys_avail[2*phys_avail_count] =
+   (kernelend  ~PAGE_MASK) + PAGE_SIZE;
+   phys_avail[2*phys_avail_count + 1] =
+   phys_avail[j+1];
+   phys_avail_count++;
+   }
+
+   phys_avail[j+1] = kernelstart  ~PAGE_MASK;
+   }
+
+   if (kernelend = phys_avail[j] 
+   kernelend  phys_avail[j+1]) {
+   if (kernelstart  phys_avail[j]) {
+   phys_avail[2*phys_avail_count] = phys_avail[j];
+   phys_avail[2*phys_avail_count + 1] =
+   kernelstart  ~PAGE_MASK;
+   phys_avail_count++;
+   }
+
+   phys_avail[j] = (kernelend  ~PAGE_MASK) + PAGE_SIZE;
+   }
+   }
+
physmem = btoc(physsz);
 
/*
@@ -829,44 +862,43 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k
/*
 * Set up the Open Firmware mappings
 */
-   if ((chosen = OF_finddevice(/chosen)) == -1)
-   panic(moea_bootstrap: can't find /chosen);
-   OF_getprop(chosen, mmu, mmui, 4);
-   if ((mmu = OF_instance_to_package(mmui)) == -1)
-   panic(moea_bootstrap: can't get mmu package);
-   if ((sz = OF_getproplen(mmu, translations)) == -1)
-   panic(moea_bootstrap: can't get ofw translation count);
-   translations = NULL;
-   for (i = 0; phys_avail[i] != 0; i += 2) {
-   if (phys_avail[i + 1] = sz) {
-   translations = (struct ofw_map *)phys_avail[i];
-   break;
+   chosen = OF_finddevice(/chosen);
+   if (chosen != -1  OF_getprop(chosen, mmu, mmui, 4) != -1 
+   (mmu = OF_instance_to_package(mmui)) != -1  
+   (sz = OF_getproplen(mmu, translations)) != -1) {
+   translations = NULL;
+   for (i = 0; phys_avail[i] != 0; i += 2) {
+   if (phys_avail[i + 1] = sz) {
+   translations = (struct ofw_map *)phys_avail[i];
+   break;
+   }
}
-   }
-   if (translations == NULL)
-   panic(moea_bootstrap: no space to copy translations);
-   bzero(translations, sz);
-   if (OF_getprop(mmu, translations, translations, sz) == -1)
-   panic(moea_bootstrap: can't get ofw translations);
-   CTR0(KTR_PMAP, moea_bootstrap: translations);
-   sz /= sizeof(*translations);
-   qsort(translations, sz, sizeof (*translations), om_cmp);
-   for (i = 0; i  sz; i++) {
-   CTR3(KTR_PMAP, translation: pa=%#x va=%#x len=%#x,
-   translations[i].om_pa, translations[i].om_va,
-   translations[i].om_len);
+   if (translations == NULL)
+   panic(moea_bootstrap: no space to copy translations);
+   bzero(translations, sz);
+   if (OF_getprop(mmu, translations, translations, sz) == -1)
+   panic(moea_bootstrap: can't get ofw translations);
+   CTR0(KTR_PMAP, moea_bootstrap: translations);
+   sz /= sizeof(*translations);
+   qsort(translations, sz, sizeof (*translations), om_cmp);
+   for (i = 0; i  sz; i++) {
+   CTR3(KTR_PMAP, translation: pa=%#x va=%#x len=%#x,
+   

svn commit: r228610 - head/sbin/gbde

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Sat Dec 17 00:14:40 2011
New Revision: 228610
URL: http://svn.freebsd.org/changeset/base/228610

Log:
  Use NO_WCAST_ALIGN for sbin/gbde, this is more appropriate to fix the
  alignment warnings than using WARNS=3, and it also works for clang.
  
  MFC after:1 week

Modified:
  head/sbin/gbde/Makefile

Modified: head/sbin/gbde/Makefile
==
--- head/sbin/gbde/Makefile Fri Dec 16 23:46:05 2011(r228609)
+++ head/sbin/gbde/Makefile Sat Dec 17 00:14:40 2011(r228610)
@@ -7,11 +7,9 @@ SRCS+= rijndael-api-fst.c
 SRCS+= sha2.c
 SRCS+= g_bde_lock.c
 
-# rijndael-fst.c does evil casting things which results in warnings on
-# 64 bit machines, the test-vectors check out however, so it works right.
-.if ${MACHINE_CPUARCH} != i386
-WARNS?=3
-.endif
+# rijndael-fst.c does evil casting things which can results in warnings,
+# the test-vectors check out however, so it works right.
+NO_WCAST_ALIGN=
 
 CFLAGS+= -I${.CURDIR}/../../sys
 .PATH: ${.CURDIR}/../../sys/geom/bde \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228612 - head/sbin/ipf

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Sat Dec 17 00:54:09 2011
New Revision: 228612
URL: http://svn.freebsd.org/changeset/base/228612

Log:
  Use both NO_WFORMAT and NO_WARRAY_BOUNDS for sbin/ipf, it would be too
  disruptive to actually fix all the warnings, and the code hasn't been
  maintained for several years.
  
  MFC after:1 week

Modified:
  head/sbin/ipf/Makefile.inc

Modified: head/sbin/ipf/Makefile.inc
==
--- head/sbin/ipf/Makefile.inc  Sat Dec 17 00:26:45 2011(r228611)
+++ head/sbin/ipf/Makefile.inc  Sat Dec 17 00:54:09 2011(r228612)
@@ -1,6 +1,8 @@
 #  $FreeBSD$
 
 WARNS?=2
+NO_WFORMAT=
+NO_WARRAY_BOUNDS=
 
 CFLAGS+=   -I${.CURDIR}/../../../contrib/ipfilter
 CFLAGS+=   -I${.CURDIR}/../../../contrib/ipfilter/tools
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228615 - head/sbin/dhclient

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Sat Dec 17 01:29:46 2011
New Revision: 228615
URL: http://svn.freebsd.org/changeset/base/228615

Log:
  In sbin/dhclient, since we know the size of the source strings anyway,
  we might as well use memcpy; strlcpy is really unnecessary here.
  
  MFC after:1 week

Modified:
  head/sbin/dhclient/clparse.c
  head/sbin/dhclient/parse.c

Modified: head/sbin/dhclient/clparse.c
==
--- head/sbin/dhclient/clparse.cSat Dec 17 01:19:07 2011
(r228614)
+++ head/sbin/dhclient/clparse.cSat Dec 17 01:29:46 2011
(r228615)
@@ -895,7 +895,7 @@ parse_string_list(FILE *cfile, struct st
tmp = new_string_list(valsize);
if (tmp == NULL)
error(no memory for string list entry.);
-   strlcpy(tmp-string, val, valsize);
+   memcpy(tmp-string, val, valsize);
tmp-next = NULL;
 
/* Store this medium at the end of the media list. */

Modified: head/sbin/dhclient/parse.c
==
--- head/sbin/dhclient/parse.c  Sat Dec 17 01:19:07 2011(r228614)
+++ head/sbin/dhclient/parse.c  Sat Dec 17 01:29:46 2011(r228615)
@@ -129,7 +129,7 @@ parse_string(FILE *cfile)
s = malloc(valsize);
if (!s)
error(no memory for string %s., val);
-   strlcpy(s, val, valsize);
+   memcpy(s, val, valsize);
 
if (!parse_semi(cfile))
return (NULL);
@@ -295,7 +295,7 @@ parse_numeric_aggregate(FILE *cfile, uns
t = malloc(valsize);
if (!t)
error(no temp space for number.);
-   strlcpy(t, val, valsize);
+   memcpy(t, val, valsize);
c = cons(t, c);
}
} while (++count != *max);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228616 - head/usr.bin/tar

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Sat Dec 17 01:36:50 2011
New Revision: 228616
URL: http://svn.freebsd.org/changeset/base/228616

Log:
  In usr.bin/tar/tree.c, if you really want to poke to NULL, you must use
  volatile, otherwise the indirection will not be emitted.
  
  MFC after:1 week

Modified:
  head/usr.bin/tar/tree.c

Modified: head/usr.bin/tar/tree.c
==
--- head/usr.bin/tar/tree.c Sat Dec 17 01:29:46 2011(r228615)
+++ head/usr.bin/tar/tree.c Sat Dec 17 01:36:50 2011(r228616)
@@ -315,7 +315,7 @@ tree_next(struct tree *t)
const char *msg = Unable to continue traversing
 directory hierarchy after a fatal error.;
write(2, msg, strlen(msg));
-   *(int *)0 = 1; /* Deliberate SEGV; NULL pointer dereference. */
+   *(volatile int *)0 = 1; /* Deliberate SEGV; NULL pointer 
dereference. */
exit(1); /* In case the SEGV didn't work. */
}
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228617 - head/share/mk

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Sat Dec 17 01:51:12 2011
New Revision: 228617
URL: http://svn.freebsd.org/changeset/base/228617

Log:
  Disable yet another clang warning when WARNS = 3.
  
  MFC after:1 week

Modified:
  head/share/mk/bsd.sys.mk

Modified: head/share/mk/bsd.sys.mk
==
--- head/share/mk/bsd.sys.mkSat Dec 17 01:36:50 2011(r228616)
+++ head/share/mk/bsd.sys.mkSat Dec 17 01:51:12 2011(r228617)
@@ -62,7 +62,7 @@ CWARNFLAGS+=  -Wno-pointer-sign
 .  if ${CC:T:Mclang} == clang
 .   if ${WARNS} = 3
 CWARNFLAGS +=  -Wno-tautological-compare -Wno-unused-value\
-   -Wno-parentheses-equality
+   -Wno-parentheses-equality -Wno-unused-function
 .   endif
 .   if ${WARNS} = 2
 CWARNFLAGS +=  -Wno-switch-enum
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228618 - head/sbin/devd

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Sat Dec 17 01:54:51 2011
New Revision: 228618
URL: http://svn.freebsd.org/changeset/base/228618

Log:
  In sbin/devd/devd.h, 'event_proc' and 'eps' are declared as structs.  In
  devd.hh, there are redeclared as classes.  Fix the inconsistency.
  
  MFC after:1 week

Modified:
  head/sbin/devd/devd.hh

Modified: head/sbin/devd/devd.hh
==
--- head/sbin/devd/devd.hh  Sat Dec 17 01:51:12 2011(r228617)
+++ head/sbin/devd/devd.hh  Sat Dec 17 01:54:51 2011(r228618)
@@ -65,7 +65,7 @@ private:
  * eps is short for event_proc_single.  It is a single entry in an
  * event_proc.  Each keyword needs its own subclass from eps.
  */
-class eps
+struct eps
 {
 public:
eps() {}
@@ -126,7 +126,7 @@ private:
std::string _cmd;
 };
 
-class event_proc
+struct event_proc
 {
 public:
event_proc();
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228619 - head/usr.bin/mt

2011-12-16 Thread Dimitry Andric
Author: dim
Date: Sat Dec 17 02:23:30 2011
New Revision: 228619
URL: http://svn.freebsd.org/changeset/base/228619

Log:
  In usr.bin/mt/mt.c, the c_code member of struct commands should really
  be an unsigned long, since it will contain values of ioctl request
  codes.  On 64-bit arches, these will not fit into an int.
  
  MFC after:1 week

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

Modified: head/usr.bin/mt/mt.c
==
--- head/usr.bin/mt/mt.cSat Dec 17 01:54:51 2011(r228618)
+++ head/usr.bin/mt/mt.cSat Dec 17 02:23:30 2011(r228619)
@@ -75,7 +75,7 @@ __FBSDID($FreeBSD$);
 
 static const struct commands {
const char *c_name;
-   int c_code;
+   unsigned long c_code;
int c_ronly;
int c_flags;
 } com[] = {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r228571 - in head: . lib/libc/net sbin/ifconfig share/man/man4 sys/net sys/netinet sys/netinet6 sys/sys

2011-12-16 Thread Gleb Smirnoff
  Ben,

On Fri, Dec 16, 2011 at 12:08:17PM -0500, Ben Kaduk wrote:
B Hi Gleb,
B 
B Perhaps the man page portions that were commented out should just be
B removed entirely?

They may be resurrected if arpbalancing is implemented again.

-- 
Totus tuus, Glebius.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r228620 - head/share/man/man9

2011-12-16 Thread Ruslan Ermilov
Author: ru
Date: Sat Dec 17 06:57:35 2011
New Revision: 228620
URL: http://svn.freebsd.org/changeset/base/228620

Log:
  Fixed some of markup.
  
  Reviewed by:  jhb

Modified:
  head/share/man/man9/shm_map.9

Modified: head/share/man/man9/shm_map.9
==
--- head/share/man/man9/shm_map.9   Sat Dec 17 02:23:30 2011
(r228619)
+++ head/share/man/man9/shm_map.9   Sat Dec 17 06:57:35 2011
(r228620)
@@ -30,9 +30,8 @@
 .Dt SHM_MAP 9
 .Os
 .Sh NAME
-.Nm shm_map ,
-.Nm shm_unmap
-.Nd map shared memory objects into the kernel's address space
+.Nm shm_map , shm_unmap
+.Nd map shared memory objects into the kernel's address space
 .Sh SYNOPSIS
 .In sys/types.h
 .In sys/mman.h
@@ -42,9 +41,9 @@
 .Fn shm_unmap struct file *fp void *mem size_t size
 .Sh DESCRIPTION
 The
-.Nm shm_map
+.Fn shm_map
 and
-.Nm shm_unmap
+.Fn shm_unmap
 functions provide an API for mapping shared memory objects into the kernel.
 Shared memory objects are created by
 .Xr shm_open 2 .
@@ -57,13 +56,13 @@ Shared memory objects can still be grown
 .Pp
 To simplify the accounting needed to enforce the above requirement,
 callers of this API are required to unmap the entire region mapped by
-.Nm shm_map
+.Fn shm_map
 when calling
-.Nm shm_unmap .
+.Fn shm_unmap .
 Unmapping only a portion of the region is not permitted.
 .Pp
 The
-.Nm shm_map
+.Fn shm_map
 function locates the shared memory object associated with the open file
 .Fa fp .
 It maps the region of that object described by
@@ -77,9 +76,9 @@ will be set to the start of the mapping.
 All pages for the range will be wired into memory upon successful return.
 .Pp
 The
-.Nm shm_unmap
+.Fn shm_unmap
 function unmaps a region previously mapped by
-.Nm shm_map .
+.Fn shm_map .
 The
 .Fa mem
 argument should match the value previously returned in
@@ -87,22 +86,22 @@ argument should match the value previous
 and the
 .Fa size
 argument should match the value passed to
-.Nm shm_map .
+.Fn shm_map .
 .Pp
 Note that
-.Nm shm_map
+.Fn shm_map
 will not hold an extra reference on the open file
 .Fa fp
 for the lifetime of the mapping.
 Instead,
 the calling code is required to do this if it wishes to use
-.Nm shm_unmap
+.Fn shm_unmap
 on the region in the future.
 .Sh RETURN VALUES
 The
-.Nm shm_map
+.Fn shm_map
 and
-.Nm shm_unmap
+.Fn shm_unmap
 functions return zero on success or an error on failure.
 .Sh EXAMPLES
 The following function accepts a file descriptor for a shared memory
@@ -110,7 +109,7 @@ object.
 It maps the first sixteen kilobytes of the object into the kernel,
 performs some work on that address,
 and then unmaps the address before returning.
-.Bd -literal
+.Bd -literal -offset indent
 int
 shm_example(int fd)
 {
@@ -118,7 +117,7 @@ shm_example(int fd)
void *mem;
int error;
 
-   error = fget(curthread, fd, CAP_MMAP, fp)
+   error = fget(curthread, fd, CAP_MMAP, fp);
if (error)
return (error);
error = shm_map(fp, 16384, 0, mem);
@@ -136,7 +135,7 @@ shm_example(int fd)
 .Ed
 .Sh ERRORS
 The
-.Nm shm_map
+.Fn shm_map
 function returns the following errors on failure:
 .Bl -tag -width Er
 .It Bq Er EINVAL
@@ -158,7 +157,7 @@ The shared memory object could not be ma
 .El
 .Pp
 The
-.Nm shm_unmap
+.Fn shm_unmap
 function returns the following errors on failure:
 .Bl -tag -width Er
 .It Bq Er EINVAL
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org