summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2014-09-15 14:21:57 +0000
committertrasz <trasz@FreeBSD.org>2014-09-15 14:21:57 +0000
commit0c1d52f3f7075ef122270f8a41ff0f50fcc16925 (patch)
tree1d886812fefab4ed6ddf9a4989ac3429b2e62a26 /usr.sbin
parent17ea2e1bc5b2911f86e37eadaa404c63214951a2 (diff)
downloadFreeBSD-src-0c1d52f3f7075ef122270f8a41ff0f50fcc16925.zip
FreeBSD-src-0c1d52f3f7075ef122270f8a41ff0f50fcc16925.tar.gz
MFC r271169:
Turn two errors, which are possible to trigger only by bugs, into assertions. Approved by: re (gjb) Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ctld/ctld.c10
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);
OpenPOWER on IntegriCloud