summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/in6.c
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2005-06-02 00:04:08 +0000
committeriedowse <iedowse@FreeBSD.org>2005-06-02 00:04:08 +0000
commit7de9a3957f49a3d2defeb896784a44358d279dd0 (patch)
tree32aeb891654c057245ca73c42be4699204111c11 /sys/netinet6/in6.c
parent4587fc275c58e748bcd2067eed3c716c7c7ca467 (diff)
downloadFreeBSD-src-7de9a3957f49a3d2defeb896784a44358d279dd0.zip
FreeBSD-src-7de9a3957f49a3d2defeb896784a44358d279dd0.tar.gz
Use IFF_LOCKGIANT/IFF_UNLOCKGIANT around calls to the interface
if_ioctl routine. This should fix a number of code paths through soo_ioctl() that could call into Giant-locked network drivers without first acquiring Giant.
Diffstat (limited to 'sys/netinet6/in6.c')
-rw-r--r--sys/netinet6/in6.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index 7bd5e64..1dc7516 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -1507,10 +1507,14 @@ in6_ifinit(ifp, ia, sin6, newhost)
ia->ia_addr = *sin6;
- if (ifacount <= 1 && ifp->if_ioctl &&
- (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia))) {
- splx(s);
- return (error);
+ if (ifacount <= 1 && ifp->if_ioctl) {
+ IFF_LOCKGIANT(ifp);
+ error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia);
+ IFF_UNLOCKGIANT(ifp);
+ if (error) {
+ splx(s);
+ return (error);
+ }
}
splx(s);
OpenPOWER on IntegriCloud