diff options
Diffstat (limited to 'sys/netinet6/ip6_mroute.c')
-rw-r--r-- | sys/netinet6/ip6_mroute.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 6bcd205fc65..35459945aa7 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -242,17 +242,26 @@ int mrt6_ioctl(struct socket *so, u_long cmd, caddr_t data) { struct inpcb *inp = sotoinpcb(so); + int error; switch (cmd) { case SIOCGETSGCNT_IN6: - return (get_sg6_cnt((struct sioc_sg_req6 *)data, - inp->inp_rtableid)); + NET_RLOCK(); + error = get_sg6_cnt((struct sioc_sg_req6 *)data, + inp->inp_rtableid); + NET_RUNLOCK(); + break; case SIOCGETMIFCNT_IN6: - return (get_mif6_cnt((struct sioc_mif_req6 *)data, - inp->inp_rtableid)); + NET_RLOCK(); + error = get_mif6_cnt((struct sioc_mif_req6 *)data, + inp->inp_rtableid); + NET_RUNLOCK(); + break; default: - return (ENOTTY); + error = ENOTTY; + break; } + return error; } /* |