diff options
| author | Oleg Bulyzhin <oleg@FreeBSD.org> | 2006-10-05 09:48:25 +0000 |
|---|---|---|
| committer | Oleg Bulyzhin <oleg@FreeBSD.org> | 2006-10-05 09:48:25 +0000 |
| commit | 29453026ea29f291ede4aac2d4bf8a7e87f872d4 (patch) | |
| tree | 6c591b9ea5bd06cedc100b5a5c45332188540ff1 /sys/contrib/ipfilter | |
| parent | 32d5d9ffc9dc72836db4595b6c07c0d44129399b (diff) | |
Notes
Diffstat (limited to 'sys/contrib/ipfilter')
| -rw-r--r-- | sys/contrib/ipfilter/netinet/ip_fil_freebsd.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c index d27878158cd0..64421e01f3a6 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c +++ b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c @@ -481,7 +481,8 @@ int mode; } SPL_NET(s); - READ_ENTER(&ipf_global); + if (fr_running > 0) + READ_ENTER(&ipf_global); error = fr_ioctlswitch(unit, data, cmd, mode); if (error != -1) { @@ -514,7 +515,10 @@ int mode; else (void) ipldetach(); } else { - error = ipldetach(); + if (fr_running <= 0) + error = 0; + else + error = ipldetach(); if (error == 0) fr_running = -1; } @@ -627,7 +631,9 @@ int mode; break; } - RWLOCK_EXIT(&ipf_global); + if (fr_running > 0) + if (mtx_owned(&(&ipf_global)->ipf_lk)) + RWLOCK_EXIT(&ipf_global); SPL_X(s); return error; |
