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:
parent
604bf9d37e
commit
17ff561352
@ -23,9 +23,9 @@ printhost(family, addr)
|
|||||||
if ((family == -1) || !*addr)
|
if ((family == -1) || !*addr)
|
||||||
PRINTF("any");
|
PRINTF("any");
|
||||||
else {
|
else {
|
||||||
|
#ifdef USE_INET6
|
||||||
void *ptr = addr;
|
void *ptr = addr;
|
||||||
|
|
||||||
#ifdef USE_INET6
|
|
||||||
PRINTF("%s", inet_ntop(family, ptr, ipbuf, sizeof(ipbuf)));
|
PRINTF("%s", inet_ntop(family, ptr, ipbuf, sizeof(ipbuf)));
|
||||||
#else
|
#else
|
||||||
ipa.s_addr = *addr;
|
ipa.s_addr = *addr;
|
||||||
|
@ -25,9 +25,9 @@ printhostmask(family, addr, mask)
|
|||||||
if ((family == -1) || ((!addr || !*addr) && (!mask || !*mask)))
|
if ((family == -1) || ((!addr || !*addr) && (!mask || !*mask)))
|
||||||
PRINTF("any");
|
PRINTF("any");
|
||||||
else {
|
else {
|
||||||
|
#ifdef USE_INET6
|
||||||
void *ptr = addr;
|
void *ptr = addr;
|
||||||
|
|
||||||
#ifdef USE_INET6
|
|
||||||
PRINTF("%s", inet_ntop(family, ptr, ipbuf, sizeof(ipbuf)));
|
PRINTF("%s", inet_ntop(family, ptr, ipbuf, sizeof(ipbuf)));
|
||||||
#else
|
#else
|
||||||
ipa.s_addr = *addr;
|
ipa.s_addr = *addr;
|
||||||
|
@ -178,7 +178,7 @@ snmpv1_parse(char **strings)
|
|||||||
if (ctx->fd >= 0) {
|
if (ctx->fd >= 0) {
|
||||||
ctx->sin.sin_family = AF_INET;
|
ctx->sin.sin_family = AF_INET;
|
||||||
ctx->sin.sin_port = htons(162);
|
ctx->sin.sin_port = htons(162);
|
||||||
if (connect(ctx->fd, &ctx->sin,
|
if (connect(ctx->fd, (struct sockaddr *)&ctx->sin,
|
||||||
sizeof(ctx->sin)) != 0) {
|
sizeof(ctx->sin)) != 0) {
|
||||||
snmpv1_destroy(ctx);
|
snmpv1_destroy(ctx);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -181,7 +181,7 @@ snmpv2_parse(char **strings)
|
|||||||
if (ctx->fd >= 0) {
|
if (ctx->fd >= 0) {
|
||||||
ctx->sin.sin_family = AF_INET;
|
ctx->sin.sin_family = AF_INET;
|
||||||
ctx->sin.sin_port = htons(162);
|
ctx->sin.sin_port = htons(162);
|
||||||
if (connect(ctx->fd, &ctx->sin,
|
if (connect(ctx->fd, (struct sockaddr *)&ctx->sin,
|
||||||
sizeof(ctx->sin)) != 0) {
|
sizeof(ctx->sin)) != 0) {
|
||||||
snmpv2_destroy(ctx);
|
snmpv2_destroy(ctx);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user