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
This commit is contained in:
parent
1c64231eac
commit
0488e848d9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271169
@ -1760,9 +1760,7 @@ main_loop(struct conf *conf, bool dont_fork)
|
|||||||
client_salen = sizeof(client_sa);
|
client_salen = sizeof(client_sa);
|
||||||
kernel_accept(&connection_id, &portal_id,
|
kernel_accept(&connection_id, &portal_id,
|
||||||
(struct sockaddr *)&client_sa, &client_salen);
|
(struct sockaddr *)&client_sa, &client_salen);
|
||||||
if (client_salen < client_sa.ss_len)
|
assert(client_salen >= client_sa.ss_len);
|
||||||
log_errx(1, "salen %u < %u",
|
|
||||||
client_salen, client_sa.ss_len);
|
|
||||||
|
|
||||||
log_debugx("incoming connection, id %d, portal id %d",
|
log_debugx("incoming connection, id %d, portal id %d",
|
||||||
connection_id, portal_id);
|
connection_id, portal_id);
|
||||||
@ -1806,10 +1804,8 @@ main_loop(struct conf *conf, bool dont_fork)
|
|||||||
&client_salen);
|
&client_salen);
|
||||||
if (client_fd < 0)
|
if (client_fd < 0)
|
||||||
log_err(1, "accept");
|
log_err(1, "accept");
|
||||||
if (client_salen < client_sa.ss_len)
|
assert(client_salen >= client_sa.ss_len);
|
||||||
log_errx(1, "salen %u < %u",
|
|
||||||
client_salen,
|
|
||||||
client_sa.ss_len);
|
|
||||||
handle_connection(portal, client_fd,
|
handle_connection(portal, client_fd,
|
||||||
(struct sockaddr *)&client_sa,
|
(struct sockaddr *)&client_sa,
|
||||||
dont_fork);
|
dont_fork);
|
||||||
|
Loading…
Reference in New Issue
Block a user