Re: svn commit: r225868 - head/bin/ps

2011-10-09 Thread Ed Schouten
* Alexander Best arun...@freebsd.org, 20111009 03:11:
 is this what you had in mind?

Yes, exactly. :-)

-- 
 Ed Schouten e...@80386.nl
 WWW: http://80386.nl/


pgpZPhIcb06Wi.pgp
Description: PGP signature


Re: svn commit: r225868 - head/bin/ps

2011-10-09 Thread Alexander Best
On Sun Oct  9 11, Ed Schouten wrote:
 * Alexander Best arun...@freebsd.org, 20111009 03:11:
  is this what you had in mind?
 
 Yes, exactly. :-)

here you are. ;)

 
 -- 
  Ed Schouten e...@80386.nl
  WWW: http://80386.nl/


diff --git a/bin/ps/print.c b/bin/ps/print.c
index 45c7823..021415f 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -362,7 +362,7 @@ tdev(KINFO *k, VARENT *ve)
v = ve-var;
dev = k-ki_p-ki_tdev;
if (dev == NODEV)
-   str = strdup(??);
+   str = strdup(-);
else
asprintf(str, %#jx, (uintmax_t)dev);
 
@@ -379,7 +379,7 @@ tname(KINFO *k, VARENT *ve)
v = ve-var;
dev = k-ki_p-ki_tdev;
if (dev == NODEV || (ttname = devname(dev, S_IFCHR)) == NULL)
-   str = strdup(?? );
+   str = strdup(- );
else {
if (strncmp(ttname, tty, 3) == 0 ||
strncmp(ttname, cua, 3) == 0)
@@ -403,7 +403,7 @@ longtname(KINFO *k, VARENT *ve)
v = ve-var;
dev = k-ki_p-ki_tdev;
if (dev == NODEV || (ttname = devname(dev, S_IFCHR)) == NULL)
-   ttname = ??;
+   ttname = -;
 
return (strdup(ttname));
 }
___
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: r225617 - in head/sys: amd64/amd64 amd64/linux32 arm/arm cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/sparc/dtrace compat/freebsd32 compat/linux compat/svr4

2011-10-09 Thread K. Macy
Will do - sorry for the delay.

Thanks,
Kip

On Wed, Oct 5, 2011 at 6:17 PM, David O'Brien obr...@freebsd.org wrote:
 On Fri, Sep 16, 2011 at 01:58:51PM +, Kip Macy wrote:
 Author: kmacy
 Date: Fri Sep 16 13:58:51 2011
 New Revision: 225617
 Log:
   In order to maximize the re-usability of kernel code in user space this
   patch modifies makesyscalls.sh to prefix all of the non-compatibility
   calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel
   entry points and all places in the code that use them. It also

 Hi Kip,
 __FreeBSD_version does not seem to have been bumped for this.
 Unfortunately this change has made a kernel module we use at work
 unbuildable, and I don't have a __FreeBSD_version value to #ifdef
 on.

 If ever there was a change that needed __FreeBSD_version this is one.

 Can you please get __FreeBSD_version bumped in 9-STABLE along with
 9-RELENG?

 thanks,
 --
 -- David  (obr...@freebsd.org)

___
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: r226166 - head/lib/libc/sys

2011-10-09 Thread Dag-Erling Smorgrav
Author: des
Date: Sun Oct  9 10:55:15 2011
New Revision: 226166
URL: http://svn.freebsd.org/changeset/base/226166

Log:
  Document some not-so-recently added trace points.
  
  MFC after:1 week

Modified:
  head/lib/libc/sys/ktrace.2

Modified: head/lib/libc/sys/ktrace.2
==
--- head/lib/libc/sys/ktrace.2  Sat Oct  8 21:15:39 2011(r226165)
+++ head/lib/libc/sys/ktrace.2  Sun Oct  9 10:55:15 2011(r226166)
@@ -28,7 +28,7 @@
 .\ @(#)ktrace.2   8.1 (Berkeley) 6/4/93
 .\ $FreeBSD$
 .\
-.Dd July 13, 2008
+.Dd October 9, 2011
 .Dt KTRACE 2
 .Os
 .Sh NAME
@@ -80,7 +80,7 @@ The
 .Fa trpoints
 argument specifies the trace points of interest.
 The defined trace points are:
-.Bl -column KTRFAC_SYSCALLXXX -offset indent
+.Bl -column KTRFAC_PROCCTORXXX -offset indent
 .It KTRFAC_SYSCALLTrace system calls.
 .It KTRFAC_SYSRET Trace return values from system calls.
 .It KTRFAC_NAMEI  Trace name lookup operations.
@@ -88,6 +88,11 @@ The defined trace points are:
 generate much output).
 .It KTRFAC_PSIG   Trace posted signals.
 .It KTRFAC_CSWTrace context switch points.
+.It KTRFAC_USER   Trace application-specific events.
+.It KTRFAC_STRUCT Trace certain data structures.
+.It KTRFAC_SYSCTL Trace sysctls.
+.It KTRFAC_PROCCTOR   Trace process construction.
+.It KTRFAC_PROCDTOR   Trace process destruction.
 .It KTRFAC_INHERITInherit tracing to future children.
 .El
 .Pp
___
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: r226167 - head/lib/libc/sys

2011-10-09 Thread Dag-Erling Smorgrav
Author: des
Date: Sun Oct  9 10:58:58 2011
New Revision: 226167
URL: http://svn.freebsd.org/changeset/base/226167

Log:
  Line up the struct declaration (yes, I know this isn't what it looks
  like in the header file)

Modified:
  head/lib/libc/sys/ktrace.2

Modified: head/lib/libc/sys/ktrace.2
==
--- head/lib/libc/sys/ktrace.2  Sun Oct  9 10:55:15 2011(r226166)
+++ head/lib/libc/sys/ktrace.2  Sun Oct  9 10:58:58 2011(r226167)
@@ -101,12 +101,12 @@ followed by a trace point specific struc
 The generic header is:
 .Bd -literal
 struct ktr_header {
-   int ktr_len;/* length of buf */
-   short   ktr_type;   /* trace record type */
-   pid_t   ktr_pid;/* process id */
-   charktr_comm[MAXCOMLEN+1];  /* command name */
-   struct  timeval ktr_time;   /* timestamp */
-   intptr_tktr_tid;/* was ktr_buffer */
+   int ktr_len;/* length of buf */
+   short   ktr_type;   /* trace record type */
+   pid_t   ktr_pid;/* process id */
+   charktr_comm[MAXCOMLEN+1];  /* command name */
+   struct timeval  ktr_time;   /* timestamp */
+   intptr_tktr_tid;/* was ktr_buffer */
 };
 .Ed
 .Pp
___
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: r225586 - in head/sys: modules/netgraph/ipfw netgraph

2011-10-09 Thread Gleb Smirnoff
On Sun, Oct 09, 2011 at 03:53:44PM +0400, Alexander V. Chernikov wrote:
A Understood. So can we use more descriptive ENOENT in code below?
A 
A tag = m_tag_locate(m, MTAG_IPFW_RULE, 0, NULL);
A if (tag == NULL) {
A NG_FREE_M(m);
A return (EINVAL);/* XXX: find smth better */
A };

Let you decide that. However, you can first analyze other places in kernel,
where m_tag_locate() really should succeed but fails. After that you probably
would want to have the same error return value in all these places :)

A Please see an attached patch

Patch is ok from my view.

-- 
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: r226168 - head/sys/netinet

2011-10-09 Thread Michael Tuexen
Author: tuexen
Date: Sun Oct  9 14:12:17 2011
New Revision: 226168
URL: http://svn.freebsd.org/changeset/base/226168

Log:
  Update the inp stored in a HB-timer when moving an stcb to a new inp.
  Use only this stored inp when processing a HB timeout.
  This fixes a bug which results in a crash.
  
  MFC after: 3 days.

Modified:
  head/sys/netinet/sctp_pcb.c
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctp_pcb.c
==
--- head/sys/netinet/sctp_pcb.c Sun Oct  9 10:58:58 2011(r226167)
+++ head/sys/netinet/sctp_pcb.c Sun Oct  9 14:12:17 2011(r226168)
@@ -2804,6 +2804,7 @@ sctp_move_pcb_and_assoc(struct sctp_inpc
/* now what about the nets? */
TAILQ_FOREACH(net, stcb-asoc.nets, sctp_next) {
net-pmtu_timer.ep = (void *)new_inp;
+   net-hb_timer.ep = (void *)new_inp;
net-rxt_timer.ep = (void *)new_inp;
}
SCTP_INP_WUNLOCK(new_inp);

Modified: head/sys/netinet/sctputil.c
==
--- head/sys/netinet/sctputil.c Sun Oct  9 10:58:58 2011(r226167)
+++ head/sys/netinet/sctputil.c Sun Oct  9 14:12:17 2011(r226168)
@@ -1661,7 +1661,7 @@ sctp_timeout_handler(void *t)
sctp_auditing(4, inp, stcb, net);
 #endif
if (!(net-dest_state  SCTP_ADDR_NOHB)) {
-   sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, 
stcb-sctp_ep, stcb, net);
+   sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, 
net);
sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_HB_TMR, 
SCTP_SO_NOT_LOCKED);
}
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: r226169 - in head/usr.sbin/makefs: . ffs

2011-10-09 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Oct  9 16:22:31 2011
New Revision: 226169
URL: http://svn.freebsd.org/changeset/base/226169

Log:
  Add support to makefs(8) to add UFS labels to images.
  
  Submitted by: avg
  MFC after:3 days

Modified:
  head/usr.sbin/makefs/ffs.c
  head/usr.sbin/makefs/ffs.h
  head/usr.sbin/makefs/ffs/mkfs.c
  head/usr.sbin/makefs/makefs.8

Modified: head/usr.sbin/makefs/ffs.c
==
--- head/usr.sbin/makefs/ffs.c  Sun Oct  9 14:12:17 2011(r226168)
+++ head/usr.sbin/makefs/ffs.c  Sun Oct  9 16:22:31 2011(r226169)
@@ -236,6 +236,9 @@ ffs_parse_opts(const char *option, fsinf
goto leave_ffs_parse_opts;
}
rv = 1;
+   } else if (strcmp(var, label) == 0) {
+   strlcpy(ffs_opts-label, val, sizeof(ffs_opts-label));
+   rv = 1;
} else
rv = set_option(ffs_options, var, val);
 

Modified: head/usr.sbin/makefs/ffs.h
==
--- head/usr.sbin/makefs/ffs.h  Sun Oct  9 14:12:17 2011(r226168)
+++ head/usr.sbin/makefs/ffs.h  Sun Oct  9 16:22:31 2011(r226169)
@@ -40,7 +40,11 @@
 #ifndef _FFS_H
 #define _FFS_H
 
+#include ufs/ufs/dinode.h
+#include ufs/ffs/fs.h
+
 typedef struct {
+   charlabel[MAXVOLLEN];   /* volume name/label */
int bsize;  /* block size */
int fsize;  /* fragment size */
int cpg;/* cylinders per group */

Modified: head/usr.sbin/makefs/ffs/mkfs.c
==
--- head/usr.sbin/makefs/ffs/mkfs.c Sun Oct  9 14:12:17 2011
(r226168)
+++ head/usr.sbin/makefs/ffs/mkfs.c Sun Oct  9 16:22:31 2011
(r226169)
@@ -139,7 +139,9 @@ ffs_mkfs(const char *fsys, const fsinfo_
avgfpdir =  ffs_opts-avgfpdir;
bbsize =BBSIZE;
sbsize =SBLOCKSIZE;
-   
+
+   strlcpy(sblock.fs_volname, ffs_opts-label, sizeof(sblock.fs_volname));
+
if (Oflag == 0) {
sblock.fs_old_inodefmt = FS_42INODEFMT;
sblock.fs_maxsymlinklen = 0;

Modified: head/usr.sbin/makefs/makefs.8
==
--- head/usr.sbin/makefs/makefs.8   Sun Oct  9 14:12:17 2011
(r226168)
+++ head/usr.sbin/makefs/makefs.8   Sun Oct  9 16:22:31 2011
(r226169)
@@ -242,6 +242,8 @@ Block size.
 Bytes per inode.
 .It Sy fsize
 Fragment size.
+.It Sy label
+Label name of the image.
 .It Sy maxbpg
 Maximum blocks per file in a cylinder group.
 .It Sy minfree
___
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: r226170 - in head/release: amd64 i386

2011-10-09 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Sun Oct  9 16:23:04 2011
New Revision: 226170
URL: http://svn.freebsd.org/changeset/base/226170

Log:
  Use UFS labels and bsdlabels (like the 8.x memsticks) instead of GPT to
  fix problems with some BIOSes.
  
  MFC after:3 days

Modified:
  head/release/amd64/make-memstick.sh
  head/release/i386/make-memstick.sh

Modified: head/release/amd64/make-memstick.sh
==
--- head/release/amd64/make-memstick.sh Sun Oct  9 16:22:31 2011
(r226169)
+++ head/release/amd64/make-memstick.sh Sun Oct  9 16:23:04 2011
(r226170)
@@ -13,15 +13,11 @@
 PATH=/bin:/usr/bin:/sbin:/usr/sbin
 export PATH
 
-BLOCKSIZE=10240
-
 if [ $# -ne 2 ]; then
   echo make-memstick.sh /path/to/directory /path/to/image/file
   exit 1
 fi
 
-tempfile=${2}.$$
-
 if [ ! -d ${1} ]; then
   echo ${1} must be a directory
   exit 1
@@ -32,47 +28,21 @@ if [ -e ${2} ]; then
   exit 1
 fi
 
-echo '/dev/gpt/FreeBSD_Install / ufs ro,noatime 1 1'  ${1}/etc/fstab
-rm -f ${tempfile}
-makefs -B little ${tempfile} ${1}
+echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1'  ${1}/etc/fstab
+makefs -B little -o label=FreeBSD_Install ${2} ${1}
 if [ $? -ne 0 ]; then
   echo makefs failed
   exit 1
 fi
 rm ${1}/etc/fstab
 
-#
-# Use $BLOCKSIZE for transfers to improve efficiency.  When calculating
-# how many blocks to transfer + 2 is to account for truncation in the
-# division and to provide space for the label.
-#
-
-filesize=`stat -f %z ${tempfile}`
-blocks=$(($filesize / ${BLOCKSIZE} + 256))
-dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks}
-if [ $? -ne 0 ]; then
-  echo creation of image file failed
-  exit 1
-fi
-
 unit=`mdconfig -a -t vnode -f ${2}`
 if [ $? -ne 0 ]; then
   echo mdconfig failed
   exit 1
 fi
-
-gpart create -s GPT ${unit}
-gpart add -t freebsd-boot -s 64K ${unit}
-gpart bootcode -b ${1}/boot/pmbr -p ${1}/boot/gptboot -i 1 ${unit}
-gpart add -t freebsd-ufs -l FreeBSD_Install ${unit}
-
-dd if=${tempfile} of=/dev/${unit}p2 bs=$BLOCKSIZE conv=sync
-if [ $? -ne 0 ]; then
-  echo copying filesystem into image file failed
-  exit 1
-fi
-
+gpart create -s BSD ${unit}
+gpart bootcode -b ${1}/boot/boot ${unit}
+gpart add -t freebsd-ufs ${unit}
 mdconfig -d -u ${unit}
 
-rm -f ${tempfile}
-

Modified: head/release/i386/make-memstick.sh
==
--- head/release/i386/make-memstick.sh  Sun Oct  9 16:22:31 2011
(r226169)
+++ head/release/i386/make-memstick.sh  Sun Oct  9 16:23:04 2011
(r226170)
@@ -13,15 +13,11 @@
 PATH=/bin:/usr/bin:/sbin:/usr/sbin
 export PATH
 
-BLOCKSIZE=10240
-
 if [ $# -ne 2 ]; then
   echo make-memstick.sh /path/to/directory /path/to/image/file
   exit 1
 fi
 
-tempfile=${2}.$$
-
 if [ ! -d ${1} ]; then
   echo ${1} must be a directory
   exit 1
@@ -32,47 +28,21 @@ if [ -e ${2} ]; then
   exit 1
 fi
 
-echo '/dev/gpt/FreeBSD_Install / ufs ro,noatime 1 1'  ${1}/etc/fstab
-rm -f ${tempfile}
-makefs -B little ${tempfile} ${1}
+echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1'  ${1}/etc/fstab
+makefs -B little -o label=FreeBSD_Install ${2} ${1}
 if [ $? -ne 0 ]; then
   echo makefs failed
   exit 1
 fi
 rm ${1}/etc/fstab
 
-#
-# Use $BLOCKSIZE for transfers to improve efficiency.  When calculating
-# how many blocks to transfer + 2 is to account for truncation in the
-# division and to provide space for the label.
-#
-
-filesize=`stat -f %z ${tempfile}`
-blocks=$(($filesize / ${BLOCKSIZE} + 256))
-dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks}
-if [ $? -ne 0 ]; then
-  echo creation of image file failed
-  exit 1
-fi
-
 unit=`mdconfig -a -t vnode -f ${2}`
 if [ $? -ne 0 ]; then
   echo mdconfig failed
   exit 1
 fi
-
-gpart create -s GPT ${unit}
-gpart add -t freebsd-boot -s 64K ${unit}
-gpart bootcode -b ${1}/boot/pmbr -p ${1}/boot/gptboot -i 1 ${unit}
-gpart add -t freebsd-ufs -l FreeBSD_Install ${unit}
-
-dd if=${tempfile} of=/dev/${unit}p2 bs=$BLOCKSIZE conv=sync
-if [ $? -ne 0 ]; then
-  echo copying filesystem into image file failed
-  exit 1
-fi
-
+gpart create -s BSD ${unit}
+gpart bootcode -b ${1}/boot/boot ${unit}
+gpart add -t freebsd-ufs ${unit}
 mdconfig -d -u ${unit}
 
-rm -f ${tempfile}
-
___
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: r226162 - head/share/mk

2011-10-09 Thread Garrett Cooper
On Sat, Oct 8, 2011 at 11:25 AM, Chris Rees cr...@freebsd.org wrote:
 Author: crees (ports committer)
 Date: Sat Oct  8 18:25:01 2011
 New Revision: 226162
 URL: http://svn.freebsd.org/changeset/base/226162

 Log:
  Revert unapproved commit to bsd.port.mk.

  This would have had more discussion, but it was explicitly rejected at 
 submission by portmgr:

  http://lists.freebsd.org/pipermail/freebsd-ports/2011-September/070591.html

First off, I'm not advocating commit wars by reverting this change.
What I think happened was a simple misunderstanding, assumptions were
made, and an accidental lapse in communication occurred. It happens..
let's just try not to make the same mistake twice and move on.

I'm not currently blocked by this change if I upgrade to a later
version pending that I unmerge this change via svn merge -c -226162.
That being said, not everyone uses svn to manage /usr/src though
(cv?sup comes to mind), so I think it would be smart to revert this
change primarily for those individuals so they don't have to grow a
new custom system for applying patches, similar to what the FreeNAS
build system's build/do_build.sh script does, and so we can have
greater test coverage with 10-CURRENT in the coming months until all
of the ports breakage from the double digit branding scheme is fully
resolved.

Thanks!
-Garrett
___
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: r225947 - head/sys/netinet

2011-10-09 Thread Gleb Smirnoff
  Qing,

  [cced Bjoern as reviewer]

On Mon, Oct 03, 2011 at 07:51:19PM +, Qing Li wrote:
Q Author: qingli
Q Date: Mon Oct  3 19:51:18 2011
Q New Revision: 225947
Q URL: http://svn.freebsd.org/changeset/base/225947
Q 
Q Log:
Q   A system may have multiple physical interfaces, all of which are on the
Q   same prefix. Since a single route entry is installed for the prefix
Q   (without RADIX_MPATH), incoming packets on the interfaces that are not
Q   associated with the prefix route may trigger an error message about
Q   unable to allocation LLE entry, and fails L2. This patch makes sure a
Q   valid route is present in the system, and allow the aforementioned
Q   condition to exist and treats as valid.
Q   
Q   Reviewed by:   bz
Q   MFC after: 5 days

  this commit together with r225946 makes the in_lltable_rtcheck()
quite difficult to understand.

  What confuses me most, is that in lines 1435-1445 you are
assigning error to a positive value, BUT proceeding further
with function. Well, after third review it is clear, that
next if() case would definitely be true, and you would proceed
with return. But that is difficult to see from first glance.

I'd suggest to remove error variable, return immediately in
all error cases, and also the RTF_GATEWAY check can be shifted up,
since it is the most simple and the most usual to be true.

Also, in this commit you really do not need the __DECONST hacks.

Here is a snap, only compile-tested patch.

-- 
Totus tuus, Glebius.
Index: in.c
===
--- in.c	(revision 226163)
+++ in.c	(working copy)
@@ -1414,8 +1414,6 @@
 in_lltable_rtcheck(struct ifnet *ifp, u_int flags, const struct sockaddr *l3addr)
 {
 	struct rtentry *rt;
-	struct ifnet *xifp;
-	int error = 0;
 
 	KASSERT(l3addr-sa_family == AF_INET,
 	(sin_family %d, l3addr-sa_family));
@@ -1426,25 +1424,22 @@
 	if (rt == NULL)
 		return (EINVAL);
 
+	if (rt-rt_flags  RTF_GATEWAY) {
+		RTFREE_LOCKED(rt);
+		return (EINVAL);
+	}
+
 	/*
 	 * If the gateway for an existing host route matches the target L3
 	 * address, which is a special route inserted by some implementation
 	 * such as MANET, and the interface is of the correct type, then
 	 * allow for ARP to proceed.
 	 */
-	if (rt-rt_flags  (RTF_GATEWAY | RTF_HOST)) {
-		xifp = rt-rt_ifp;
-		
-		if (xifp  (xifp-if_type != IFT_ETHER ||
-		 (xifp-if_flags  (IFF_NOARP | IFF_STATICARP)) != 0))
-			error = EINVAL;
-
-		if (memcmp(rt-rt_gateway-sa_data, l3addr-sa_data,
-		sizeof(in_addr_t)) != 0)
-			error = EINVAL;
-	}
-
-	if (rt-rt_flags  RTF_GATEWAY) {
+	if (rt-rt_flags  RTF_HOST 
+	((rt-rt_ifp  (rt-rt_ifp-if_type != IFT_ETHER ||
+	(rt-rt_ifp-if_flags  (IFF_NOARP | IFF_STATICARP)) != 0)) ||
+	(memcmp(rt-rt_gateway-sa_data, l3addr-sa_data,
+	sizeof(in_addr_t)) != 0))) {
 		RTFREE_LOCKED(rt);
 		return (EINVAL);
 	}
@@ -1455,32 +1450,31 @@
 	 * interfaces have the same prefix. An incoming packet arrives
 	 * on one interface and the corresponding outgoing packet leaves
 	 * another interface.
-	 * 
 	 */
 	if (rt-rt_ifp != ifp) {
-		char *sa, *mask, *addr, *lim;
+		const char *sa, *mask, *addr, *lim;
 		int len;
 
-		sa = (char *)rt_key(rt);
-		mask = (char *)rt_mask(rt);
-		addr = (char *)__DECONST(struct sockaddr *, l3addr);
-		len = ((struct sockaddr_in *)__DECONST(struct sockaddr *, l3addr))-sin_len;
+		sa = (const char *)rt_key(rt);
+		mask = (const char *)rt_mask(rt);
+		addr = (const char *)l3addr;
+		len = ((const struct sockaddr_in *)l3addr)-sin_len;
 		lim = addr + len;
 
 		for ( ; addr  lim; sa++, mask++, addr++) {
 			if ((*sa ^ *addr)  *mask) {
-error = EINVAL;
 #ifdef DIAGNOSTIC
 log(LOG_INFO, IPv4 address: \%s\ is not on the network\n,
 inet_ntoa(((const struct sockaddr_in *)l3addr)-sin_addr));
 #endif
-break;
+RTFREE_LOCKED(rt);
+return (EINVAL);
 			}
 		}
 	}
 
 	RTFREE_LOCKED(rt);
-	return (error);
+	return (0);
 }
 
 /*
___
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: r226171 - head/sys/dev/vr

2011-10-09 Thread Marius Strobl
Author: marius
Date: Sun Oct  9 20:16:51 2011
New Revision: 226171
URL: http://svn.freebsd.org/changeset/base/226171

Log:
  Sprinkle const.

Modified:
  head/sys/dev/vr/if_vr.c

Modified: head/sys/dev/vr/if_vr.c
==
--- head/sys/dev/vr/if_vr.c Sun Oct  9 16:23:04 2011(r226170)
+++ head/sys/dev/vr/if_vr.c Sun Oct  9 20:16:51 2011(r226171)
@@ -114,12 +114,12 @@ MODULE_DEPEND(vr, miibus, 1, 1, 1);
 #define VR_Q_CSUM  (11)
 #define VR_Q_CAM   (12)
 
-static struct vr_type {
+static const struct vr_type {
u_int16_t   vr_vid;
u_int16_t   vr_did;
int vr_quirks;
-   char*vr_name;
-} vr_devs[] = {
+   const char  *vr_name;
+} const vr_devs[] = {
{ VIA_VENDORID, VIA_DEVICEID_RHINE,
VR_Q_NEEDALIGN,
VIA VT3043 Rhine I 10/100BaseTX },
@@ -195,11 +195,11 @@ static void vr_setwol(struct vr_softc *)
 static void vr_clrwol(struct vr_softc *);
 static int vr_sysctl_stats(SYSCTL_HANDLER_ARGS);
 
-static struct vr_tx_threshold_table {
+static const struct vr_tx_threshold_table {
int tx_cfg;
int bcr_cfg;
int value;
-} vr_tx_threshold_tables[] = {
+} const vr_tx_threshold_tables[] = {
{ VR_TXTHRESH_64BYTES, VR_BCR1_TXTHRESH64BYTES, 64 },
{ VR_TXTHRESH_128BYTES, VR_BCR1_TXTHRESH128BYTES, 128 },
{ VR_TXTHRESH_256BYTES, VR_BCR1_TXTHRESH256BYTES, 256 },
@@ -557,10 +557,10 @@ vr_reset(const struct vr_softc *sc)
  * Probe for a VIA Rhine chip. Check the PCI vendor and device
  * IDs against our list and return a match or NULL
  */
-static struct vr_type *
+static const struct vr_type *
 vr_match(device_t dev)
 {
-   struct vr_type  *t = vr_devs;
+   const struct vr_type*t = vr_devs;
 
for (t = vr_devs; t-vr_name != NULL; t++)
if ((pci_get_vendor(dev) == t-vr_vid) 
@@ -576,7 +576,7 @@ vr_match(device_t dev)
 static int
 vr_probe(device_t dev)
 {
-   struct vr_type  *t;
+   const struct vr_type*t;
 
t = vr_match(dev);
if (t != NULL) {
@@ -595,7 +595,7 @@ vr_attach(device_t dev)
 {
struct vr_softc *sc;
struct ifnet*ifp;
-   struct vr_type  *t;
+   const struct vr_type*t;
uint8_t eaddr[ETHER_ADDR_LEN];
int error, rid;
int i, phy, pmc;
___
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: r226172 - head/share/man/man7

2011-10-09 Thread Glen Barber
Author: gjb (doc committer)
Date: Sun Oct  9 20:21:07 2011
New Revision: 226172
URL: http://svn.freebsd.org/changeset/base/226172

Log:
  Bump .Dd to reflect the date of the last content change, so MFC content
  makes sense.
  
  Pointy-hat to:gjb (myself)

Modified:
  head/share/man/man7/build.7

Modified: head/share/man/man7/build.7
==
--- head/share/man/man7/build.7 Sun Oct  9 20:16:51 2011(r226171)
+++ head/share/man/man7/build.7 Sun Oct  9 20:21:07 2011(r226172)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd June 16, 2011
+.Dd September 29, 2011
 .Dt BUILD 7
 .Os
 .Sh NAME
___
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: r226173 - head/sys/dev/stge

2011-10-09 Thread Marius Strobl
Author: marius
Date: Sun Oct  9 20:27:20 2011
New Revision: 226173
URL: http://svn.freebsd.org/changeset/base/226173

Log:
  Prefer KOBJMETHOD_END.

Modified:
  head/sys/dev/stge/if_stge.c

Modified: head/sys/dev/stge/if_stge.c
==
--- head/sys/dev/stge/if_stge.c Sun Oct  9 20:21:07 2011(r226172)
+++ head/sys/dev/stge/if_stge.c Sun Oct  9 20:27:20 2011(r226173)
@@ -199,8 +199,7 @@ static device_method_t stge_methods[] = 
DEVMETHOD(miibus_writereg,  stge_miibus_writereg),
DEVMETHOD(miibus_statchg,   stge_miibus_statchg),
 
-   { 0, 0 }
-
+   KOBJMETHOD_END
 };
 
 static driver_t stge_driver = {
___
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: r226175 - head/sys/kern

2011-10-09 Thread Marius Strobl
Author: marius
Date: Sun Oct  9 21:21:37 2011
New Revision: 226175
URL: http://svn.freebsd.org/changeset/base/226175

Log:
  In device_get_children() avoid malloc(0) in order to increase portability
  to other operating systems.
  
  PR: 154287

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cSun Oct  9 20:58:02 2011(r226174)
+++ head/sys/kern/subr_bus.cSun Oct  9 21:21:37 2011(r226175)
@@ -2140,6 +2140,11 @@ device_get_children(device_t dev, device
TAILQ_FOREACH(child, dev-children, link) {
count++;
}
+   if (count == 0) {
+   *devlistp = NULL;
+   *devcountp = 0;
+   return (0);
+   }
 
list = malloc(count * sizeof(device_t), M_TEMP, M_NOWAIT|M_ZERO);
if (!list)
___
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: r226176 - head/sys/dev/iwn

2011-10-09 Thread Marius Strobl
Author: marius
Date: Sun Oct  9 21:36:14 2011
New Revision: 226176
URL: http://svn.freebsd.org/changeset/base/226176

Log:
  Recognize the Intel(R) Centrino(R) Wireless-N 130.
  
  PR:   161162

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Sun Oct  9 21:21:37 2011(r226175)
+++ head/sys/dev/iwn/if_iwn.c   Sun Oct  9 21:36:14 2011(r226176)
@@ -89,6 +89,7 @@ static const struct iwn_ident iwn_ident_
{ 0x8086, 0x008b, Intel(R) Centrino(R) Wireless-N 1030 },
{ 0x8086, 0x0090, Intel(R) Centrino(R) Advanced-N 6230 },
{ 0x8086, 0x0091, Intel(R) Centrino(R) Advanced-N 6230 },
+   { 0x8086, 0x0896, Intel(R) Centrino(R) Wireless-N 130  },
{ 0x8086, 0x4229, Intel(R) Wireless WiFi Link 4965 },
{ 0x8086, 0x422b, Intel(R) Centrino(R) Ultimate-N 6300 },
{ 0x8086, 0x422c, Intel(R) Centrino(R) Advanced-N 6200 },
___
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: r226179 - in head: sbin/atacontrol sys/dev/ata usr.sbin/burncd

2011-10-09 Thread Craig Rodrigues
Author: rodrigc
Date: Sun Oct  9 21:42:02 2011
New Revision: 226179
URL: http://svn.freebsd.org/changeset/base/226179

Log:
  Add a kern.features.ata_cam sysctl in the kernel when the ATA_CAM kernel
  option is defined.  This sysctl can be queried by feature_present(3).
  
  Query for this feature in /sbin/atacontrol and /usr/sbin/burncd.
  If these utilities detect that ATA_CAM is enabled, then these utilities
  will error out.  These utilities are compatible with the old ATA
  driver, but are incomptible with the new ATA_CAM driver.  By erroring out,
  we give end-users an idea as to what remedies to use, and reduce the need for 
them
  to file PR's.  For atacontrol, camcontrol must be used instead,
  and for burncd, alternative utilties from the ports collection must be used
  such as sysutils/cdrtools.
  
  In future, maybe someone can re-write burncd to work with ATA_CAM,
  but at least for now, we give a somewhat useful error message to end users.
  
  PR:   160979
  Reviewed by:  jh, Arnaud Lacombe lacombar at gmail dot com
  Reported by:  Joe Barbish fbsd8 at a1poweruser dot com
  MFC after:3 days

Modified:
  head/sbin/atacontrol/atacontrol.8
  head/sbin/atacontrol/atacontrol.c
  head/sys/dev/ata/ata-all.c
  head/usr.sbin/burncd/burncd.8
  head/usr.sbin/burncd/burncd.c

Modified: head/sbin/atacontrol/atacontrol.8
==
--- head/sbin/atacontrol/atacontrol.8   Sun Oct  9 21:40:38 2011
(r226178)
+++ head/sbin/atacontrol/atacontrol.8   Sun Oct  9 21:42:02 2011
(r226179)
@@ -25,12 +25,19 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd February 21, 2009
+.Dd October 9, 2011
 .Dt ATACONTROL 8
 .Os
 .Sh NAME
 .Nm atacontrol
 .Nd ATA device driver control program
+.Pp
+This utility was
+.Em deprecated
+in
+.Fx 9.0 .
+See
+.Sx NOTES .
 .Sh SYNOPSIS
 .Nm
 .Aq Ar command
@@ -361,11 +368,17 @@ or syslog logging on it as the disk will
 up all the time.
 .Sh SEE ALSO
 .Xr ata 4
+.Xr cam 4
+.Xr camcontrol 8
 .Sh HISTORY
 The
 .Nm
 utility first appeared in
 .Fx 4.6 .
+.Pp
+.Nm
+was deprecated in
+.Fx 9.0 .
 .Sh AUTHORS
 .An -nosplit
 The
@@ -377,3 +390,16 @@ utility was written by
 This manual page was written by
 .An S\(/oren Schmidt
 .Aq s...@freebsd.org .
+.Sh NOTES
+The
+.Nm
+utility was deprecated in
+.Fx 9.0 .
+When
+.Bd -ragged -offset indent
+.Cd options ATA_CAM
+.Ed
+.Pp
+is compiled into the kernel, then
+.Xr camcontrol 8
+must be used instead.

Modified: head/sbin/atacontrol/atacontrol.c
==
--- head/sbin/atacontrol/atacontrol.c   Sun Oct  9 21:40:38 2011
(r226178)
+++ head/sbin/atacontrol/atacontrol.c   Sun Oct  9 21:42:02 2011
(r226179)
@@ -378,6 +378,11 @@ main(int argc, char **argv)
 {
int fd, mode, channel, array;
 
+   if (feature_present(ata_cam)) {
+   errx(1, \nATA_CAM option is enabled in kernel.\n
+   Please use camcontrol instead.);
+   }
+
if (argc  2)
usage();
 

Modified: head/sys/dev/ata/ata-all.c
==
--- head/sys/dev/ata/ata-all.c  Sun Oct  9 21:40:38 2011(r226178)
+++ head/sys/dev/ata/ata-all.c  Sun Oct  9 21:42:02 2011(r226179)
@@ -120,6 +120,9 @@ SYSCTL_INT(_hw_ata, OID_AUTO, wc, CTLFLA
 TUNABLE_INT(hw.ata.setmax, ata_setmax);
 SYSCTL_INT(_hw_ata, OID_AUTO, setmax, CTLFLAG_RDTUN, ata_setmax, 0,
   ATA disk set max native address);
+#ifdef ATA_CAM
+FEATURE(ata_cam, ATA devices are accessed through the cam(4) driver);
+#endif
 
 /*
  * newbus device interface related functions

Modified: head/usr.sbin/burncd/burncd.8
==
--- head/usr.sbin/burncd/burncd.8   Sun Oct  9 21:40:38 2011
(r226178)
+++ head/usr.sbin/burncd/burncd.8   Sun Oct  9 21:42:02 2011
(r226179)
@@ -27,12 +27,19 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd December 21, 2009
+.Dd October 9, 2011
 .Dt BURNCD 8
 .Os
 .Sh NAME
 .Nm burncd
 .Nd control the ATAPI CD-R/RW driver
+.Pp
+This utility was
+.Em deprecated
+in
+.Fx 9.0 .
+See
+.Sx NOTES .
 .Sh SYNOPSIS
 .Nm
 .Op Fl deFlmnpqtv
@@ -211,6 +218,10 @@ The
 .Nm
 utility appeared in
 .Fx 4.0 .
+.Pp
+.Nm
+was deprecated in
+.Fx 9.0 .
 .Sh AUTHORS
 The
 .Nm
@@ -220,3 +231,19 @@ Denmark
 .Aq s...@freebsd.org .
 .Sh BUGS
 Probably, please report when found.
+.Sh NOTES
+When
+.Bd -ragged -offset indent
+.Cd options ATA_CAM
+.Ed
+.Pp
+is compiled into the kernel, then
+.Xr cdrecord 1 ,
+available in the
+.Fx
+Ports Collection as part of the
+.Pa sysutils/cdrtools
+port, must be used instead.
+Refer to:
+.Pp
+http://www.freebsd.org/doc/handbook/creating-cds.html#CDRECORD

Modified: head/usr.sbin/burncd/burncd.c
==
--- head/usr.sbin/burncd/burncd.c   Sun Oct  9 21:40:38 2011

svn commit: r226181 - head/sys/dev/bwi

2011-10-09 Thread Adrian Chadd
Author: adrian
Date: Mon Oct 10 02:49:21 2011
New Revision: 226181
URL: http://svn.freebsd.org/changeset/base/226181

Log:
  Update from OpenBSD: Include 0x4402 in the bbp id mapping table used on older 
devices.
  
  http://bcm-specs.sipsolutions.net/BackPlane agrees.
  
  Obtained from:OpenBSD, sys/dev/ic/bwi.c r1.88

Modified:
  head/sys/dev/bwi/if_bwi.c

Modified: head/sys/dev/bwi/if_bwi.c
==
--- head/sys/dev/bwi/if_bwi.c   Mon Oct 10 00:37:23 2011(r226180)
+++ head/sys/dev/bwi/if_bwi.c   Mon Oct 10 02:49:21 2011(r226181)
@@ -220,7 +220,7 @@ static const struct {
 } bwi_bbpid_map[] = {
{ 0x4301, 0x4301, 0x4301 },
{ 0x4305, 0x4307, 0x4307 },
-   { 0x4403, 0x4403, 0x4402 },
+   { 0x4402, 0x4403, 0x4402 },
{ 0x4610, 0x4615, 0x4610 },
{ 0x4710, 0x4715, 0x4710 },
{ 0x4720, 0x4725, 0x4309 }
___
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: r226182 - head/sys/dev/bwi

2011-10-09 Thread Adrian Chadd
Author: adrian
Date: Mon Oct 10 02:54:58 2011
New Revision: 226182
URL: http://svn.freebsd.org/changeset/base/226182

Log:
  Fix an incorrect use of sizeof().
  
  Obtained from:OpenBSD sys/dev/ic/bwi.c r1.87

Modified:
  head/sys/dev/bwi/bwiphy.c

Modified: head/sys/dev/bwi/bwiphy.c
==
--- head/sys/dev/bwi/bwiphy.c   Mon Oct 10 02:49:21 2011(r226181)
+++ head/sys/dev/bwi/bwiphy.c   Mon Oct 10 02:54:58 2011(r226182)
@@ -796,7 +796,7 @@ bwi_phy_config_11g(struct bwi_mac *mac)
bwi_tbl_write_2(mac, BWI_PHYTBL_RSSI + i, i);
 
/* Fill noise table */
-   for (i = 0; i  sizeof(bwi_phy_noise_11g); ++i) {
+   for (i = 0; i  N(bwi_phy_noise_11g); ++i) {
bwi_tbl_write_2(mac, BWI_PHYTBL_NOISE + i,
bwi_phy_noise_11g[i]);
}
___
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: r225947 - head/sys/netinet

2011-10-09 Thread Qing Li
Hi Gleb,


 On Mon, Oct 03, 2011 at 07:51:19PM +, Qing Li wrote:
 Q Author: qingli
 Q Date: Mon Oct  3 19:51:18 2011
 Q New Revision: 225947
 Q URL: http://svn.freebsd.org/changeset/base/225947
 Q
 Q Log:
 Q   A system may have multiple physical interfaces, all of which are on the
 Q   same prefix. Since a single route entry is installed for the prefix
 Q   (without RADIX_MPATH), incoming packets on the interfaces that are not
 Q   associated with the prefix route may trigger an error message about
 Q   unable to allocation LLE entry, and fails L2. This patch makes sure a
 Q   valid route is present in the system, and allow the aforementioned
 Q   condition to exist and treats as valid.
 Q
 Q   Reviewed by:       bz
 Q   MFC after: 5 days

  this commit together with r225946 makes the in_lltable_rtcheck()
 quite difficult to understand.

  What confuses me most, is that in lines 1435-1445 you are
 assigning error to a positive value, BUT proceeding further
 with function.


   This is what was there before (meaning returning error immediately),
   but I guess a couple of folks felt it looked a bit cluttered.
   This is mostly due to the fact the RTFREE_LOCKED() operation
   has to be performed before returning.


 Well, after third review it is clear, that
 next if() case would definitely be true, and you would proceed
 with return. But that is difficult to see from first glance.


   Not so, only for an indirect prefix route.


 I'd suggest to remove error variable, return immediately in
 all error cases, and also the RTF_GATEWAY check can be shifted up,
 since it is the most simple and the most usual to be true.


  No, the RTF_GATEWAY check cannot be shifted up because if we did
  that, the (indirect host route, with destination matching the gateway IP)
  would never be executed, if when that set of conditions are true, which is
  allowed and the reason for the patch in the first place.


 Also, in this commit you really do not need the __DECONST hacks.


  Okay, I must had a temporary short circuit. I will fix that.

  Thanks

  --Qing
___
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: r226164 - head/usr.bin/kdump

2011-10-09 Thread Bruce Evans

On Sat, 8 Oct 2011, Dag-Erling Smorgrav wrote:


Author: des
Date: Sat Oct  8 21:02:08 2011
New Revision: 226164
URL: http://svn.freebsd.org/changeset/base/226164

Log:
 Address some of bde@'s concerns with the new code.


Thanks.

Bruce
___
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