1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00

reclaim sbuf and clear lock on error in ifconf

Submitted by:	Ted Unangst
Reviewed by:	rwatson
MFC after:	3 days
This commit is contained in:
Sam Leffler 2005-09-04 17:32:47 +00:00
parent afb2e8b616
commit 62313e4c3f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=149782

View File

@ -1728,8 +1728,11 @@ ifconf(u_long cmd, caddr_t data)
memset(ifr.ifr_name, 0, sizeof(ifr.ifr_name));
if (strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name))
>= sizeof(ifr.ifr_name))
>= sizeof(ifr.ifr_name)) {
sbuf_delete(sb);
IFNET_RUNLOCK();
return (ENAMETOOLONG);
}
addrs = 0;
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {