Date: Mon, 15 Sep 2014 14:21:57 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r271627 - stable/10/usr.sbin/ctld Message-ID: <201409151421.s8FELviL018261@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409151421.s8FELviL018261>