svn commit: r271627 - stable/10/usr.sbin/ctld
Edward Tomasz Napierala
trasz at FreeBSD.org
Mon Sep 15 14:21:58 UTC 2014
Author: trasz
Date: Mon Sep 15 14:21:57 2014
New Revision: 271627
URL: http://svnweb.freebsd.org/changeset/base/271627
Log:
MFC r271169:
Turn two errors, which are possible to trigger only by bugs,
into assertions.
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Modified:
stable/10/usr.sbin/ctld/ctld.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/usr.sbin/ctld/ctld.c
==============================================================================
--- stable/10/usr.sbin/ctld/ctld.c Mon Sep 15 14:04:55 2014 (r271626)
+++ stable/10/usr.sbin/ctld/ctld.c Mon Sep 15 14:21:57 2014 (r271627)
@@ -1760,9 +1760,7 @@ main_loop(struct conf *conf, bool dont_f
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);
More information about the svn-src-all
mailing list