1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

dirmngr: Add annotation for fallthrough.

* dirmngr/dns.c: Add /* FALL THROUGH */ to clarify.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2017-07-25 11:49:23 +09:00
parent aa358ac78c
commit d40b4a41a8

View File

@ -7617,14 +7617,14 @@ retry:
goto error; goto error;
} }
so->state++; so->state++; /* FALL THROUGH */
case DNS_SO_UDP_CONN: case DNS_SO_UDP_CONN:
error = dns_connect(so->udp, (struct sockaddr *)&so->remote, dns_sa_len(&so->remote)); error = dns_connect(so->udp, (struct sockaddr *)&so->remote, dns_sa_len(&so->remote));
dns_trace_sys_connect(so->trace, so->udp, SOCK_DGRAM, (struct sockaddr *)&so->remote, error); dns_trace_sys_connect(so->trace, so->udp, SOCK_DGRAM, (struct sockaddr *)&so->remote, error);
if (error) if (error)
goto error; goto error;
so->state++; so->state++; /* FALL THROUGH */
case DNS_SO_UDP_SEND: case DNS_SO_UDP_SEND:
n = dns_send(so->udp, (void *)so->query->data, so->query->end, 0, &error); n = dns_send(so->udp, (void *)so->query->data, so->query->end, 0, &error);
dns_trace_sys_send(so->trace, so->udp, SOCK_DGRAM, so->query->data, n, error); dns_trace_sys_send(so->trace, so->udp, SOCK_DGRAM, so->query->data, n, error);
@ -7634,7 +7634,7 @@ retry:
so->stat.udp.sent.bytes += n; so->stat.udp.sent.bytes += n;
so->stat.udp.sent.count++; so->stat.udp.sent.count++;
so->state++; so->state++; /* FALL THROUGH */
case DNS_SO_UDP_RECV: case DNS_SO_UDP_RECV:
n = dns_recv(so->udp, (void *)so->answer->data, so->answer->size, 0, &error); n = dns_recv(so->udp, (void *)so->answer->data, so->answer->size, 0, &error);
dns_trace_sys_recv(so->trace, so->udp, SOCK_DGRAM, so->answer->data, n, error); dns_trace_sys_recv(so->trace, so->udp, SOCK_DGRAM, so->answer->data, n, error);
@ -7648,12 +7648,12 @@ retry:
if ((error = dns_so_verify(so, so->answer))) if ((error = dns_so_verify(so, so->answer)))
goto trash; goto trash;
so->state++; so->state++; /* FALL THROUGH */
case DNS_SO_UDP_DONE: case DNS_SO_UDP_DONE:
if (!dns_header(so->answer)->tc || so->type == SOCK_DGRAM) if (!dns_header(so->answer)->tc || so->type == SOCK_DGRAM)
return 0; return 0;
so->state++; so->state++; /* FALL THROUGH */
case DNS_SO_TCP_INIT: case DNS_SO_TCP_INIT:
if (so->remote.ss_family != so->local.ss_family) { if (so->remote.ss_family != so->local.ss_family) {
/* Family mismatch. Reinitialize. */ /* Family mismatch. Reinitialize. */
@ -7680,24 +7680,24 @@ retry:
if (-1 == (so->tcp = dns_socket((struct sockaddr *)&so->local, SOCK_STREAM, &error))) if (-1 == (so->tcp = dns_socket((struct sockaddr *)&so->local, SOCK_STREAM, &error)))
goto error; goto error;
so->state++; so->state++; /* FALL THROUGH */
case DNS_SO_TCP_CONN: case DNS_SO_TCP_CONN:
error = dns_connect(so->tcp, (struct sockaddr *)&so->remote, dns_sa_len(&so->remote)); error = dns_connect(so->tcp, (struct sockaddr *)&so->remote, dns_sa_len(&so->remote));
dns_trace_sys_connect(so->trace, so->tcp, SOCK_STREAM, (struct sockaddr *)&so->remote, error); dns_trace_sys_connect(so->trace, so->tcp, SOCK_STREAM, (struct sockaddr *)&so->remote, error);
if (error && error != DNS_EISCONN) if (error && error != DNS_EISCONN)
goto error; goto error;
so->state++; so->state++; /* FALL THROUGH */
case DNS_SO_TCP_SEND: case DNS_SO_TCP_SEND:
if ((error = dns_so_tcp_send(so))) if ((error = dns_so_tcp_send(so)))
goto error; goto error;
so->state++; so->state++; /* FALL THROUGH */
case DNS_SO_TCP_RECV: case DNS_SO_TCP_RECV:
if ((error = dns_so_tcp_recv(so))) if ((error = dns_so_tcp_recv(so)))
goto error; goto error;
so->state++; so->state++; /* FALL THROUGH */
case DNS_SO_TCP_DONE: case DNS_SO_TCP_DONE:
/* close unless DNS_RESCONF_TCP_ONLY (see dns_res_tcp2type) */ /* close unless DNS_RESCONF_TCP_ONLY (see dns_res_tcp2type) */
if (so->type != SOCK_STREAM) { if (so->type != SOCK_STREAM) {
@ -7716,7 +7716,7 @@ retry:
if (-1 == (so->tcp = dns_socket((struct sockaddr *)&so->local, SOCK_STREAM, &error))) if (-1 == (so->tcp = dns_socket((struct sockaddr *)&so->local, SOCK_STREAM, &error)))
goto error; goto error;
so->state++; so->state++; /* FALL THROUGH */
case DNS_SO_SOCKS_CONN: { case DNS_SO_SOCKS_CONN: {
unsigned char method; unsigned char method;
@ -7744,13 +7744,13 @@ retry:
buffer[2] = method; buffer[2] = method;
so->state++; so->state++;
} } /* FALL THROUGH */
case DNS_SO_SOCKS_HELLO_SEND: case DNS_SO_SOCKS_HELLO_SEND:
if ((error = dns_so_tcp_send(so))) if ((error = dns_so_tcp_send(so)))
goto error; goto error;
dns_so_tcp_recv_expect(so, 2); dns_so_tcp_recv_expect(so, 2);
so->state++; so->state++; /* FALL THROUGH */
case DNS_SO_SOCKS_HELLO_RECV: { case DNS_SO_SOCKS_HELLO_RECV: {
unsigned char method; unsigned char method;
@ -7798,7 +7798,7 @@ retry:
} }
so->state++; so->state++;
} } /* FALL THROUGH */
case DNS_SO_SOCKS_AUTH_SEND: case DNS_SO_SOCKS_AUTH_SEND:
if ((error = dns_so_tcp_send(so))) if ((error = dns_so_tcp_send(so)))
goto error; goto error;
@ -7806,7 +7806,7 @@ retry:
/* Skip the two length octets, and receive two octets. */ /* Skip the two length octets, and receive two octets. */
dns_so_tcp_recv_expect(so, 2); dns_so_tcp_recv_expect(so, 2);
so->state++; so->state++; /* FALL THROUGH */
case DNS_SO_SOCKS_AUTH_RECV: case DNS_SO_SOCKS_AUTH_RECV:
if ((error = dns_so_tcp_recv(so))) if ((error = dns_so_tcp_recv(so)))
goto error; goto error;
@ -7823,7 +7823,7 @@ retry:
goto error; goto error;
} }
so->state++; so->state++; /* FALL THROUGH */
case DNS_SO_SOCKS_REQUEST_PREPARE: case DNS_SO_SOCKS_REQUEST_PREPARE:
/* Send request details (rfc-1928, 4). */ /* Send request details (rfc-1928, 4). */
buffer = dns_so_tcp_send_buffer(so, so->remote.ss_family == AF_INET6 ? 22 : 10); buffer = dns_so_tcp_send_buffer(so, so->remote.ss_family == AF_INET6 ? 22 : 10);
@ -7844,7 +7844,7 @@ retry:
memcpy (buffer+8, &addr_in->sin_port, 2); /* DST.PORT */ memcpy (buffer+8, &addr_in->sin_port, 2); /* DST.PORT */
} }
so->state++; so->state++; /* FALL THROUGH */
case DNS_SO_SOCKS_REQUEST_SEND: case DNS_SO_SOCKS_REQUEST_SEND:
if ((error = dns_so_tcp_send(so))) if ((error = dns_so_tcp_send(so)))
goto error; goto error;
@ -7852,7 +7852,7 @@ retry:
/* Expect ten octets. This is the length of the /* Expect ten octets. This is the length of the
* response assuming a IPv4 address is used. */ * response assuming a IPv4 address is used. */
dns_so_tcp_recv_expect(so, 10); dns_so_tcp_recv_expect(so, 10);
so->state++; so->state++; /* FALL THROUGH */
case DNS_SO_SOCKS_REQUEST_RECV: case DNS_SO_SOCKS_REQUEST_RECV:
if ((error = dns_so_tcp_recv(so))) if ((error = dns_so_tcp_recv(so)))
goto error; goto error;
@ -7910,12 +7910,12 @@ retry:
* the remaining bytes assuming an IPv6 address is * the remaining bytes assuming an IPv6 address is
* used. */ * used. */
dns_so_tcp_recv_expect(so, 12); dns_so_tcp_recv_expect(so, 12);
so->state++; so->state++; /* FALL THROUGH */
case DNS_SO_SOCKS_REQUEST_RECV_V6: case DNS_SO_SOCKS_REQUEST_RECV_V6:
if ((error = dns_so_tcp_recv(so))) if ((error = dns_so_tcp_recv(so)))
goto error; goto error;
so->state++; so->state++; /* FALL THROUGH */
case DNS_SO_SOCKS_HANDSHAKE_DONE: case DNS_SO_SOCKS_HANDSHAKE_DONE:
/* We have not way to store the actual address used by /* We have not way to store the actual address used by
* the server. Then again, we don't really care. */ * the server. Then again, we don't really care. */
@ -8543,7 +8543,7 @@ exec:
switch (F->state) { switch (F->state) {
case DNS_R_INIT: case DNS_R_INIT:
F->state++; F->state++; /* FALL THROUGH */
case DNS_R_GLUE: case DNS_R_GLUE:
if (R->sp == 0) if (R->sp == 0)
dgoto(R->sp, DNS_R_SWITCH); dgoto(R->sp, DNS_R_SWITCH);
@ -8657,17 +8657,17 @@ exec:
} else if (error) } else if (error)
goto error; goto error;
F->state++; F->state++; /* FALL THROUGH */
case DNS_R_SUBMIT: case DNS_R_SUBMIT:
if ((error = R->cache->submit(F->query, R->cache))) if ((error = R->cache->submit(F->query, R->cache)))
goto error; goto error;
F->state++; F->state++; /* FALL THROUGH */
case DNS_R_CHECK: case DNS_R_CHECK:
if ((error = R->cache->check(R->cache))) if ((error = R->cache->check(R->cache)))
goto error; goto error;
F->state++; F->state++; /* FALL THROUGH */
case DNS_R_FETCH: case DNS_R_FETCH:
error = 0; error = 0;
@ -8692,7 +8692,7 @@ exec:
R->search = 0; R->search = 0;
F->state++; F->state++; /* FALL THROUGH */
case DNS_R_SEARCH: case DNS_R_SEARCH:
/* /*
* XXX: We probably should only apply the domain search * XXX: We probably should only apply the domain search
@ -8704,12 +8704,12 @@ exec:
if ((error = dns_q_make2(&F->query, u.name, len, R->qtype, R->qclass, F->qflags))) if ((error = dns_q_make2(&F->query, u.name, len, R->qtype, R->qclass, F->qflags)))
goto error; goto error;
F->state++; F->state++; /* FALL THROUGH */
case DNS_R_HINTS: case DNS_R_HINTS:
if (!dns_p_setptr(&F->hints, dns_hints_query(R->hints, F->query, &error))) if (!dns_p_setptr(&F->hints, dns_hints_query(R->hints, F->query, &error)))
goto error; goto error;
F->state++; F->state++; /* FALL THROUGH */
case DNS_R_ITERATE: case DNS_R_ITERATE:
dns_rr_i_init(&F->hints_i, F->hints); dns_rr_i_init(&F->hints_i, F->hints);
@ -8718,7 +8718,7 @@ exec:
F->hints_i.sort = &dns_res_nameserv_cmp; F->hints_i.sort = &dns_res_nameserv_cmp;
F->hints_i.args[0] = F->hints->end; F->hints_i.args[0] = F->hints->end;
F->state++; F->state++; /* FALL THROUGH */
case DNS_R_FOREACH_NS: case DNS_R_FOREACH_NS:
dns_rr_i_save(&F->hints_i); dns_rr_i_save(&F->hints_i);
@ -8824,7 +8824,7 @@ exec:
goto error; goto error;
F->state++; F->state++;
} } /* FALL THROUGH */
case DNS_R_QUERY_A: case DNS_R_QUERY_A:
if (dns_so_elapsed(&R->so) >= dns_resconf_timeout(R->resconf)) if (dns_so_elapsed(&R->so) >= dns_resconf_timeout(R->resconf))
dgoto(R->sp, DNS_R_FOREACH_A); dgoto(R->sp, DNS_R_FOREACH_A);
@ -8957,7 +8957,7 @@ exec:
goto error; goto error;
F->state++; F->state++;
} } /* FALL THROUGH */
case DNS_R_QUERY_AAAA: case DNS_R_QUERY_AAAA:
if (dns_so_elapsed(&R->so) >= dns_resconf_timeout(R->resconf)) if (dns_so_elapsed(&R->so) >= dns_resconf_timeout(R->resconf))
dgoto(R->sp, DNS_R_FOREACH_AAAA); dgoto(R->sp, DNS_R_FOREACH_AAAA);
@ -9060,7 +9060,7 @@ exec:
dns_rr_i_init(&R->smart, F->answer); dns_rr_i_init(&R->smart, F->answer);
F->state++; F->state++; /* FALL THROUGH */
case DNS_R_SMART0_A: case DNS_R_SMART0_A:
if (&F[1] >= endof(R->stack)) if (&F[1] >= endof(R->stack))
dgoto(R->sp, DNS_R_DONE); dgoto(R->sp, DNS_R_DONE);
@ -9745,12 +9745,12 @@ exec:
switch (ai->state) { switch (ai->state) {
case DNS_AI_S_INIT: case DNS_AI_S_INIT:
ai->state++; ai->state++; /* FALL THROUGH */
case DNS_AI_S_NEXTAF: case DNS_AI_S_NEXTAF:
if (!dns_ai_nextaf(ai)) if (!dns_ai_nextaf(ai))
dns_ai_goto(DNS_AI_S_DONE); dns_ai_goto(DNS_AI_S_DONE);
ai->state++; ai->state++; /* FALL THROUGH */
case DNS_AI_S_NUMERIC: case DNS_AI_S_NUMERIC:
if (1 == dns_inet_pton(AF_INET, ai->qname, &any.a)) { if (1 == dns_inet_pton(AF_INET, ai->qname, &any.a)) {
if (ai->af.atype == AF_INET) { if (ai->af.atype == AF_INET) {
@ -9773,19 +9773,19 @@ exec:
if (ai->hints.ai_flags & AI_NUMERICHOST) if (ai->hints.ai_flags & AI_NUMERICHOST)
dns_ai_goto(DNS_AI_S_NEXTAF); dns_ai_goto(DNS_AI_S_NEXTAF);
ai->state++; ai->state++; /* FALL THROUGH */
case DNS_AI_S_SUBMIT: case DNS_AI_S_SUBMIT:
assert(ai->res); assert(ai->res);
if ((error = dns_res_submit(ai->res, ai->qname, dns_ai_qtype(ai), DNS_C_IN))) if ((error = dns_res_submit(ai->res, ai->qname, dns_ai_qtype(ai), DNS_C_IN)))
return error; return error;
ai->state++; ai->state++; /* FALL THROUGH */
case DNS_AI_S_CHECK: case DNS_AI_S_CHECK:
if ((error = dns_res_check(ai->res))) if ((error = dns_res_check(ai->res)))
return error; return error;
ai->state++; ai->state++; /* FALL THROUGH */
case DNS_AI_S_FETCH: case DNS_AI_S_FETCH:
if (!(ans = dns_res_fetch_and_study(ai->res, &error))) if (!(ans = dns_res_fetch_and_study(ai->res, &error)))
return error; return error;
@ -9808,7 +9808,7 @@ exec:
ai->i.type = dns_ai_qtype(ai); ai->i.type = dns_ai_qtype(ai);
ai->i.sort = &dns_rr_i_order; ai->i.sort = &dns_rr_i_order;
ai->state++; ai->state++; /* FALL THROUGH */
case DNS_AI_S_FOREACH_I: case DNS_AI_S_FOREACH_I:
if (!dns_rr_grep(&rr, 1, &ai->i, ai->answer, &error)) if (!dns_rr_grep(&rr, 1, &ai->i, ai->answer, &error))
dns_ai_goto(DNS_AI_S_NEXTAF); dns_ai_goto(DNS_AI_S_NEXTAF);
@ -9842,11 +9842,11 @@ exec:
break; break;
} /* switch() */ } /* switch() */
ai->state++; ai->state++; /* FALL THROUGH */
case DNS_AI_S_INIT_G: case DNS_AI_S_INIT_G:
ai->g_depth = 0; ai->g_depth = 0;
ai->state++; ai->state++; /* FALL THROUGH */
case DNS_AI_S_ITERATE_G: case DNS_AI_S_ITERATE_G:
dns_strlcpy(ai->g_cname, ai->cname, sizeof ai->g_cname); dns_strlcpy(ai->g_cname, ai->cname, sizeof ai->g_cname);
dns_rr_i_init(&ai->g, ai->glue); dns_rr_i_init(&ai->g, ai->glue);
@ -9854,7 +9854,7 @@ exec:
ai->g.name = ai->g_cname; ai->g.name = ai->g_cname;
ai->g.type = ai->af.qtype; ai->g.type = ai->af.qtype;
ai->state++; ai->state++; /* FALL THROUGH */
case DNS_AI_S_FOREACH_G: case DNS_AI_S_FOREACH_G:
if (!dns_rr_grep(&rr, 1, &ai->g, ai->glue, &error)) { if (!dns_rr_grep(&rr, 1, &ai->g, ai->glue, &error)) {
if (dns_rr_i_count(&ai->g) > 0) if (dns_rr_i_count(&ai->g) > 0)
@ -9878,12 +9878,12 @@ exec:
if ((error = dns_res_submit(ai->res, ai->g.name, ai->g.type, DNS_C_IN))) if ((error = dns_res_submit(ai->res, ai->g.name, ai->g.type, DNS_C_IN)))
return error; return error;
ai->state++; ai->state++; /* FALL THROUGH */
case DNS_AI_S_CHECK_G: case DNS_AI_S_CHECK_G:
if ((error = dns_res_check(ai->res))) if ((error = dns_res_check(ai->res)))
return error; return error;
ai->state++; ai->state++; /* FALL THROUGH */
case DNS_AI_S_FETCH_G: case DNS_AI_S_FETCH_G:
if (!(ans = dns_res_fetch_and_study(ai->res, &error))) if (!(ans = dns_res_fetch_and_study(ai->res, &error)))
return error; return error;