diff options
author | trasz <trasz@FreeBSD.org> | 2014-09-05 14:48:06 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2014-09-05 14:48:06 +0000 |
commit | 81a94cc5e93c3806b9d83fabc04996fc5dacdbd0 (patch) | |
tree | 15e931f81a5de236692c367caff39a8eac5972ef /usr.sbin | |
parent | 212d5d739c1bb7dacef64e9f7888130884f44aae (diff) | |
download | FreeBSD-src-81a94cc5e93c3806b9d83fabc04996fc5dacdbd0.zip FreeBSD-src-81a94cc5e93c3806b9d83fabc04996fc5dacdbd0.tar.gz |
Turn two errors, which are possible to trigger only by bugs,
into assertions.
Discussed with: mav@
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ctld/ctld.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index c1593c2..dde0330 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -1760,9 +1760,7 @@ main_loop(struct conf *conf, bool dont_fork) client_salen = sizeof(client_sa); kernel_accept(&connection_id, &portal_id, (struct sockaddr *)&client_sa, &client_salen); - if (client_salen < client_sa.ss_len) - log_errx(1, "salen %u < %u", - client_salen, client_sa.ss_len); + assert(client_salen >= client_sa.ss_len); log_debugx("incoming connection, id %d, portal id %d", connection_id, portal_id); @@ -1806,10 +1804,8 @@ found: &client_salen); if (client_fd < 0) log_err(1, "accept"); - if (client_salen < client_sa.ss_len) - log_errx(1, "salen %u < %u", - client_salen, - client_sa.ss_len); + assert(client_salen >= client_sa.ss_len); + handle_connection(portal, client_fd, (struct sockaddr *)&client_sa, dont_fork); |