diff options
author | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2014-01-07 15:59:33 +0000 |
---|---|---|
committer | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2014-01-07 15:59:33 +0000 |
commit | 50da3e886ddff447655ed582d9a68ef861890125 (patch) | |
tree | efc014a0ef02ce8ce0cdc44797ad3f3207a73316 /sys/net/if_tap.c | |
parent | fdac1e8bdc6e78698e1e22b975d338f2c6316547 (diff) | |
download | src-test2-50da3e886ddff447655ed582d9a68ef861890125.tar.gz src-test2-50da3e886ddff447655ed582d9a68ef861890125.zip |
Notes
Diffstat (limited to 'sys/net/if_tap.c')
-rw-r--r-- | sys/net/if_tap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c index 5153b2adbc4d..d788635a59e1 100644 --- a/sys/net/if_tap.c +++ b/sys/net/if_tap.c @@ -636,12 +636,12 @@ tapifioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCGIFSTATUS: ifs = (struct ifstat *)data; - dummy = strlen(ifs->ascii); mtx_lock(&tp->tap_mtx); - if (tp->tap_pid != 0 && dummy < sizeof(ifs->ascii)) - snprintf(ifs->ascii + dummy, - sizeof(ifs->ascii) - dummy, + if (tp->tap_pid != 0) + snprintf(ifs->ascii, sizeof(ifs->ascii), "\tOpened by PID %d\n", tp->tap_pid); + else + ifs->ascii[0] = '\0'; mtx_unlock(&tp->tap_mtx); break; |