Put multiple instructions into a block when iterating; unbreaks

NET_RT_DUMP, which otherwise only returned information of AF_MAX.
This was broken in r193232 (save your time - my bug, my fix).

PR:		kern/137700
Reported by:	Larry Baird (lab gta.com)
Tested by:	Larry Baird (lab gta.com)
Reviewed by:	zec, lstewart, qing
Approved by:	re (kib)
This commit is contained in:
Bjoern A. Zeeb 2009-08-13 09:29:52 +00:00
parent e7fba5c772
commit 20b0cdb749
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=196174

View File

@ -1473,7 +1473,7 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS)
/*
* take care of routing entries
*/
for (error = 0; error == 0 && i <= lim; i++)
for (error = 0; error == 0 && i <= lim; i++) {
rnh = rt_tables_get_rnh(req->td->td_proc->p_fibnum, i);
if (rnh != NULL) {
RADIX_NODE_HEAD_LOCK(rnh);
@ -1482,6 +1482,7 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS)
RADIX_NODE_HEAD_UNLOCK(rnh);
} else if (af != 0)
error = EAFNOSUPPORT;
}
break;
case NET_RT_IFLIST: