diff options
author | Klemens Nanni <kn@cvs.openbsd.org> | 2023-04-19 20:03:53 +0000 |
---|---|---|
committer | Klemens Nanni <kn@cvs.openbsd.org> | 2023-04-19 20:03:53 +0000 |
commit | f14062f14d6b253cbdabfb28e3ba1317eedde60b (patch) | |
tree | 89ec7eabfa8bed1a177f21ee7302b88b3d3461fd /sys | |
parent | 041c22ecf97e695fd94e7199032360602d21cd04 (diff) |
move kernel lock into multicast ioctl handlers; OK mvs
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/in.c | 4 | ||||
-rw-r--r-- | sys/netinet/ip_mroute.c | 5 | ||||
-rw-r--r-- | sys/netinet6/in6.c | 4 | ||||
-rw-r--r-- | sys/netinet6/ip6_mroute.c | 6 |
4 files changed, 11 insertions, 8 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 498cb2f6bd3..1cbfbef2976 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in.c,v 1.181 2023/04/18 22:20:16 kn Exp $ */ +/* $OpenBSD: in.c,v 1.182 2023/04/19 20:03:51 kn Exp $ */ /* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */ /* @@ -210,9 +210,7 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) #ifdef MROUTING case SIOCGETVIFCNT: case SIOCGETSGCNT: - KERNEL_LOCK(); error = mrt_ioctl(so, cmd, data); - KERNEL_UNLOCK(); break; #endif /* MROUTING */ default: diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 5b27d73fbef..3dd7dab22fe 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_mroute.c,v 1.137 2022/09/08 10:22:06 kn Exp $ */ +/* $OpenBSD: ip_mroute.c,v 1.138 2023/04/19 20:03:51 kn Exp $ */ /* $NetBSD: ip_mroute.c,v 1.85 2004/04/26 01:31:57 matt Exp $ */ /* @@ -261,6 +261,8 @@ mrt_ioctl(struct socket *so, u_long cmd, caddr_t data) if (inp == NULL) return (ENOTCONN); + KERNEL_LOCK(); + if (so != ip_mrouter[inp->inp_rtableid]) error = EINVAL; else @@ -282,6 +284,7 @@ mrt_ioctl(struct socket *so, u_long cmd, caddr_t data) break; } + KERNEL_UNLOCK(); return (error); } diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index a6b9bb72335..ea328b1b782 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.259 2022/12/06 22:19:39 mvs Exp $ */ +/* $OpenBSD: in6.c,v 1.260 2023/04/19 20:03:52 kn Exp $ */ /* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */ /* @@ -207,9 +207,7 @@ in6_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp) #ifdef MROUTING case SIOCGETSGCNT_IN6: case SIOCGETMIFCNT_IN6: - KERNEL_LOCK(); error = mrt6_ioctl(so, cmd, data); - KERNEL_UNLOCK(); break; #endif /* MROUTING */ default: diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index e7078d0c1ad..bb805e50471 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_mroute.c,v 1.135 2022/09/08 10:22:07 kn Exp $ */ +/* $OpenBSD: ip6_mroute.c,v 1.136 2023/04/19 20:03:52 kn Exp $ */ /* $NetBSD: ip6_mroute.c,v 1.59 2003/12/10 09:28:38 itojun Exp $ */ /* $KAME: ip6_mroute.c,v 1.45 2001/03/25 08:38:51 itojun Exp $ */ @@ -245,6 +245,8 @@ mrt6_ioctl(struct socket *so, u_long cmd, caddr_t data) if (inp == NULL) return (ENOTCONN); + KERNEL_LOCK(); + switch (cmd) { case SIOCGETSGCNT_IN6: NET_LOCK_SHARED(); @@ -262,6 +264,8 @@ mrt6_ioctl(struct socket *so, u_long cmd, caddr_t data) error = ENOTTY; break; } + + KERNEL_UNLOCK(); return error; } |