Fix compile-time errors when NO_WERROR and WITHOUT_INET6_SUPPORT

(NO_INET6) are specified.

Approved by:	glebius
MFC after:	1 week
This commit is contained in:
Cy Schubert 2014-07-05 07:15:19 +00:00
parent 604bf9d37e
commit 17ff561352
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=268286
4 changed files with 4 additions and 4 deletions

View File

@ -23,9 +23,9 @@ printhost(family, addr)
if ((family == -1) || !*addr)
PRINTF("any");
else {
#ifdef USE_INET6
void *ptr = addr;
#ifdef USE_INET6
PRINTF("%s", inet_ntop(family, ptr, ipbuf, sizeof(ipbuf)));
#else
ipa.s_addr = *addr;

View File

@ -25,9 +25,9 @@ printhostmask(family, addr, mask)
if ((family == -1) || ((!addr || !*addr) && (!mask || !*mask)))
PRINTF("any");
else {
#ifdef USE_INET6
void *ptr = addr;
#ifdef USE_INET6
PRINTF("%s", inet_ntop(family, ptr, ipbuf, sizeof(ipbuf)));
#else
ipa.s_addr = *addr;

View File

@ -178,7 +178,7 @@ snmpv1_parse(char **strings)
if (ctx->fd >= 0) {
ctx->sin.sin_family = AF_INET;
ctx->sin.sin_port = htons(162);
if (connect(ctx->fd, &ctx->sin,
if (connect(ctx->fd, (struct sockaddr *)&ctx->sin,
sizeof(ctx->sin)) != 0) {
snmpv1_destroy(ctx);
return NULL;

View File

@ -181,7 +181,7 @@ snmpv2_parse(char **strings)
if (ctx->fd >= 0) {
ctx->sin.sin_family = AF_INET;
ctx->sin.sin_port = htons(162);
if (connect(ctx->fd, &ctx->sin,
if (connect(ctx->fd, (struct sockaddr *)&ctx->sin,
sizeof(ctx->sin)) != 0) {
snmpv2_destroy(ctx);
return NULL;