mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 01:22:04 -04:00
Save port numbers in host-byte order.
memset unused areas of isc_sockaddr_t
This commit is contained in:
parent
06f9d6486e
commit
1a9dbcf032
6 changed files with 17 additions and 16 deletions
|
|
@ -261,10 +261,10 @@ dns_c_ctrl_print(isc_log_t *lctx,
|
|||
fprintf(fp, "inet ");
|
||||
dns_c_print_ipaddr(lctx, fp, &ctl->u.inet_v.addr);
|
||||
|
||||
if (port == htons(0)) {
|
||||
if (port == 0) {
|
||||
fprintf(fp, " port *\n");
|
||||
} else {
|
||||
fprintf(fp, " port %d\n", (int)ntohs(port));
|
||||
fprintf(fp, " port %d\n", port);
|
||||
}
|
||||
|
||||
dns_c_printtabs(lctx, fp, indent + 1);
|
||||
|
|
|
|||
|
|
@ -3200,11 +3200,10 @@ dns_c_ctx_optionsprint(isc_log_t *lctx,
|
|||
fprintf(fp, "query-source address ");
|
||||
dns_c_print_ipaddr(lctx, fp, &options->query_source_addr);
|
||||
|
||||
if (options->query_source_port == htons(0)) {
|
||||
if (options->query_source_port == 0) {
|
||||
fprintf(fp, " port *");
|
||||
} else {
|
||||
fprintf(fp, " port %d",
|
||||
(int)ntohs(options->query_source_port));
|
||||
fprintf(fp, " port %d", options->query_source_port);
|
||||
}
|
||||
fprintf(fp, " ;\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -946,6 +946,7 @@ dns_c_iplist_append(isc_log_t *lctx,
|
|||
return (ISC_R_NOMEMORY);
|
||||
}
|
||||
|
||||
memset(newlist, 0x0, newbytes);
|
||||
memcpy(newlist, list->ips, oldbytes);
|
||||
|
||||
isc_mem_put(list->mem, list->ips, oldbytes);
|
||||
|
|
|
|||
|
|
@ -211,8 +211,8 @@ dns_c_lstnon_print(isc_log_t *lctx, FILE *fp, int indent, dns_c_lstnon_t *lo)
|
|||
CHECK_LISTEN(lo);
|
||||
|
||||
fprintf(fp, "listen-on ");
|
||||
if (lo->port != htons(DNS_C_DEFAULTPORT)) {
|
||||
fprintf(fp, "port %d ", (int)ntohs(lo->port));
|
||||
if (lo->port != DNS_C_DEFAULTPORT) {
|
||||
fprintf(fp, "port %d ", lo->port);
|
||||
}
|
||||
|
||||
dns_c_ipmatchlist_print(lctx, fp, indent + 1, lo->iml);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
*/
|
||||
|
||||
#if !defined(lint) && !defined(SABER)
|
||||
static char rcsid[] = "$Id: confparser.y,v 1.15 1999/10/28 02:25:22 halley Exp $";
|
||||
static char rcsid[] = "$Id: confparser.y,v 1.16 1999/10/28 17:53:15 brister Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <config.h>
|
||||
|
|
@ -1067,7 +1067,7 @@ maybe_wild_port: in_port
|
|||
}
|
||||
| L_STRING
|
||||
{
|
||||
$$ = htons(0);
|
||||
$$ = 0;
|
||||
|
||||
if (strcmp ($1, "*") != 0) {
|
||||
parser_error(ISC_TRUE,
|
||||
|
|
@ -1114,7 +1114,7 @@ query_source: query_source_address
|
|||
|
||||
maybe_port: /* nothing */
|
||||
{
|
||||
$$ = htons(DNS_C_DEFAULTPORT);
|
||||
$$ = DNS_C_DEFAULTPORT;
|
||||
}
|
||||
| L_PORT in_port
|
||||
{
|
||||
|
|
@ -1124,7 +1124,7 @@ maybe_port: /* nothing */
|
|||
|
||||
maybe_zero_port : /* nothing */
|
||||
{
|
||||
$$ = htons(0);
|
||||
$$ = 0;
|
||||
}
|
||||
| L_PORT in_port
|
||||
{
|
||||
|
|
@ -2132,6 +2132,7 @@ address_match_simple: ip_address
|
|||
} else {
|
||||
ia.s_addr = htonl(($1 & 0xff) << 24);
|
||||
|
||||
memset(&address, 0x0, sizeof address);
|
||||
address.type.sin.sin_family = AF_INET;
|
||||
address.type.sin.sin_addr = ia;
|
||||
|
||||
|
|
@ -3235,7 +3236,7 @@ in_port: L_INTEGER
|
|||
(int)$1);
|
||||
$1 = 0;
|
||||
} else {
|
||||
$$ = htons((isc_uint16_t)$1);
|
||||
$$ = $1;
|
||||
}
|
||||
}
|
||||
;
|
||||
|
|
|
|||
|
|
@ -2594,8 +2594,8 @@ slave_zone_print(isc_log_t *lctx, FILE *fp, int indent,
|
|||
dns_c_printtabs(lctx, fp, indent);
|
||||
fprintf(fp, "masters ");
|
||||
if (DNS_C_CHECKBIT(SZ_MASTER_PORT_BIT, &szone->setflags)) {
|
||||
if (ntohs(szone->master_port) != 0) {
|
||||
fprintf(fp, "port %d ", ntohs(szone->master_port));
|
||||
if (szone->master_port != 0) {
|
||||
fprintf(fp, "port %d ", szone->master_port);
|
||||
}
|
||||
}
|
||||
if (szone->master_ips == NULL ||
|
||||
|
|
@ -2683,8 +2683,8 @@ stub_zone_print(isc_log_t *lctx, FILE *fp, int indent, dns_c_stubzone_t *szone)
|
|||
dns_c_printtabs(lctx, fp, indent);
|
||||
fprintf(fp, "masters ");
|
||||
if (DNS_C_CHECKBIT(TZ_MASTER_PORT_BIT, &szone->setflags)) {
|
||||
if (ntohs(szone->master_port) != 0) {
|
||||
fprintf(fp, "port %d ", ntohs(szone->master_port));
|
||||
if (szone->master_port != 0) {
|
||||
fprintf(fp, "port %d ", szone->master_port);
|
||||
}
|
||||
}
|
||||
if (szone->master_ips == NULL ||
|
||||
|
|
|
|||
Loading…
Reference in a new issue