summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-01-30 14:39:15 -0800
committerGuy Harris <guy@alum.mit.edu>2018-01-30 14:39:15 -0800
commit6babce0e173d5ea41d2e58040b71318d2180f032 (patch)
tree47025af209e868520031beb93cad0ec1f277c2a3
parent7755951df76e2d6183005414f6908e5eb5eee335 (diff)
downloadtcpdump-6babce0e173d5ea41d2e58040b71318d2180f032.tar.gz
Use nd_ipv4 rather than struct in_addr.
This ensures that we have no purportedly-aligned-but-not-necessarily- unaligned values that we access; we have to use EXTRACT_ macros/functions to get at IPv4 address values.
-rw-r--r--ospf.h38
-rw-r--r--print-bootp.c46
-rw-r--r--print-cnfp.c55
-rw-r--r--print-ospf.c58
-rw-r--r--print-rx.c8
5 files changed, 110 insertions, 95 deletions
diff --git a/ospf.h b/ospf.h
index ae7d2f94..40d33268 100644
--- a/ospf.h
+++ b/ospf.h
@@ -167,13 +167,13 @@ struct lsa_hdr {
nd_uint8_t ls_options;
nd_uint8_t ls_type;
union {
- struct in_addr lsa_id;
+ nd_ipv4 lsa_id;
struct { /* opaque LSAs change the LSA-ID field */
nd_uint8_t opaque_type;
nd_uint24_t opaque_id;
} opaque_field;
} un_lsa_id;
- struct in_addr ls_router;
+ nd_ipv4 ls_router;
nd_uint32_t ls_seq;
nd_uint16_t ls_chksum;
nd_uint16_t ls_length;
@@ -191,38 +191,38 @@ struct lsa {
nd_byte rla_zero;
nd_uint16_t rla_count;
struct rlalink {
- struct in_addr link_id;
- struct in_addr link_data;
+ nd_ipv4 link_id;
+ nd_ipv4 link_data;
union un_tos un_tos;
} rla_link[1]; /* may repeat */
} un_rla;
/* Network links advertisements */
struct {
- struct in_addr nla_mask;
- struct in_addr nla_router[1]; /* may repeat */
+ nd_ipv4 nla_mask;
+ nd_ipv4 nla_router[1]; /* may repeat */
} un_nla;
/* Summary links advertisements */
struct {
- struct in_addr sla_mask;
+ nd_ipv4 sla_mask;
nd_uint32_t sla_tosmetric[1]; /* may repeat */
} un_sla;
/* AS external links advertisements */
struct {
- struct in_addr asla_mask;
+ nd_ipv4 asla_mask;
struct aslametric {
nd_uint32_t asla_tosmetric;
- struct in_addr asla_forward;
- struct in_addr asla_tag;
+ nd_ipv4 asla_forward;
+ nd_ipv4 asla_tag;
} asla_metric[1]; /* may repeat */
} un_asla;
/* Multicast group membership */
struct mcla {
nd_uint32_t mcla_vtype;
- struct in_addr mcla_vid;
+ nd_ipv4 mcla_vid;
} un_mcla[1];
/* Opaque TE LSA */
@@ -263,8 +263,8 @@ struct ospfhdr {
nd_uint8_t ospf_version;
nd_uint8_t ospf_type;
nd_uint16_t ospf_len;
- struct in_addr ospf_routerid;
- struct in_addr ospf_areaid;
+ nd_ipv4 ospf_routerid;
+ nd_ipv4 ospf_areaid;
nd_uint16_t ospf_chksum;
nd_uint16_t ospf_authtype;
nd_byte ospf_authdata[OSPF_AUTH_SIZE];
@@ -272,14 +272,14 @@ struct ospfhdr {
/* Hello packet */
struct {
- struct in_addr hello_mask;
+ nd_ipv4 hello_mask;
nd_uint16_t hello_helloint;
nd_uint8_t hello_options;
nd_uint8_t hello_priority;
nd_uint32_t hello_deadint;
- struct in_addr hello_dr;
- struct in_addr hello_bdr;
- struct in_addr hello_neighbor[1]; /* may repeat */
+ nd_ipv4 hello_dr;
+ nd_ipv4 hello_bdr;
+ nd_ipv4 hello_neighbor[1]; /* may repeat */
} un_hello;
/* Database Description packet */
@@ -295,13 +295,13 @@ struct ospfhdr {
struct lsr {
nd_uint32_t ls_type;
union {
- struct in_addr ls_stateid;
+ nd_ipv4 ls_stateid;
struct { /* opaque LSAs change the LSA-ID field */
nd_uint8_t opaque_type;
nd_uint24_t opaque_id;
} opaque_field;
} un_ls_stateid;
- struct in_addr ls_router;
+ nd_ipv4 ls_router;
} un_lsr[1]; /* may repeat */
/* Link State Update */
diff --git a/print-bootp.c b/print-bootp.c
index 37a05346..cbbac30d 100644
--- a/print-bootp.c
+++ b/print-bootp.c
@@ -64,10 +64,10 @@ struct bootp {
nd_uint16_t bp_secs; /* seconds since boot began */
nd_uint16_t bp_flags; /* flags - see bootp_flag_values[]
in print-bootp.c */
- struct in_addr bp_ciaddr; /* client IP address */
- struct in_addr bp_yiaddr; /* 'your' IP address */
- struct in_addr bp_siaddr; /* server IP address */
- struct in_addr bp_giaddr; /* gateway IP address */
+ nd_ipv4 bp_ciaddr; /* client IP address */
+ nd_ipv4 bp_yiaddr; /* 'your' IP address */
+ nd_ipv4 bp_siaddr; /* server IP address */
+ nd_ipv4 bp_giaddr; /* gateway IP address */
nd_byte bp_chaddr[16]; /* client hardware address */
nd_byte bp_sname[64]; /* server host name */
nd_byte bp_file[128]; /* boot file name */
@@ -241,11 +241,11 @@ struct bootp {
struct cmu_vend {
nd_byte v_magic[4]; /* magic number */
nd_uint32_t v_flags; /* flags/opcodes, etc. */
- struct in_addr v_smask; /* Subnet mask */
- struct in_addr v_dgate; /* Default gateway */
- struct in_addr v_dns1, v_dns2; /* Domain name servers */
- struct in_addr v_ins1, v_ins2; /* IEN-116 name servers */
- struct in_addr v_ts1, v_ts2; /* Time servers */
+ nd_ipv4 v_smask; /* Subnet mask */
+ nd_ipv4 v_dgate; /* Default gateway */
+ nd_ipv4 v_dns1, v_dns2; /* Domain name servers */
+ nd_ipv4 v_ins1, v_ins2; /* IEN-116 name servers */
+ nd_ipv4 v_ts1, v_ts2; /* Time servers */
nd_byte v_unused[24]; /* currently unused */
} ND_UNALIGNED;
@@ -332,24 +332,24 @@ bootp_print(netdissect_options *ndo,
ND_PRINT(" (0x%04x)", EXTRACT_BE_U_2(bp->bp_flags));
/* Client's ip address */
- ND_TCHECK_4(&bp->bp_ciaddr);
- if (EXTRACT_IPV4_TO_HOST_ORDER(&bp->bp_ciaddr.s_addr))
- ND_PRINT("\n\t Client-IP %s", ipaddr_string(ndo, &bp->bp_ciaddr));
+ ND_TCHECK_4(bp->bp_ciaddr);
+ if (EXTRACT_IPV4_TO_NETWORK_ORDER(bp->bp_ciaddr))
+ ND_PRINT("\n\t Client-IP %s", ipaddr_string(ndo, bp->bp_ciaddr));
/* 'your' ip address (bootp client) */
- ND_TCHECK_4(&bp->bp_yiaddr);
- if (EXTRACT_IPV4_TO_HOST_ORDER(&bp->bp_yiaddr.s_addr))
- ND_PRINT("\n\t Your-IP %s", ipaddr_string(ndo, &bp->bp_yiaddr));
+ ND_TCHECK_4(bp->bp_yiaddr);
+ if (EXTRACT_IPV4_TO_NETWORK_ORDER(bp->bp_yiaddr))
+ ND_PRINT("\n\t Your-IP %s", ipaddr_string(ndo, bp->bp_yiaddr));
/* Server's ip address */
- ND_TCHECK_4(&bp->bp_siaddr);
- if (EXTRACT_IPV4_TO_HOST_ORDER(&bp->bp_siaddr.s_addr))
- ND_PRINT("\n\t Server-IP %s", ipaddr_string(ndo, &bp->bp_siaddr));
+ ND_TCHECK_4(bp->bp_siaddr);
+ if (EXTRACT_IPV4_TO_NETWORK_ORDER(bp->bp_siaddr))
+ ND_PRINT("\n\t Server-IP %s", ipaddr_string(ndo, bp->bp_siaddr));
/* Gateway's ip address */
- ND_TCHECK_4(&bp->bp_giaddr);
- if (EXTRACT_IPV4_TO_HOST_ORDER(&bp->bp_giaddr.s_addr))
- ND_PRINT("\n\t Gateway-IP %s", ipaddr_string(ndo, &bp->bp_giaddr));
+ ND_TCHECK_4(bp->bp_giaddr);
+ if (EXTRACT_IPV4_TO_NETWORK_ORDER(bp->bp_giaddr))
+ ND_PRINT("\n\t Gateway-IP %s", ipaddr_string(ndo, bp->bp_giaddr));
/* Client's Ethernet address */
if (bp_htype == 1 && bp_hlen == 6) {
@@ -1053,8 +1053,8 @@ trunc:
}
#define PRINTCMUADDR(m, s) { ND_TCHECK_4(&cmu->m); \
- if (cmu->m.s_addr != 0) \
- ND_PRINT(" %s:%s", s, ipaddr_string(ndo, &cmu->m.s_addr)); }
+ if (EXTRACT_IPV4_TO_NETWORK_ORDER(cmu->m) != 0) \
+ ND_PRINT(" %s:%s", s, ipaddr_string(ndo, cmu->m)); }
static void
cmu_print(netdissect_options *ndo,
diff --git a/print-cnfp.c b/print-cnfp.c
index badbea96..c1c3e0c9 100644
--- a/print-cnfp.c
+++ b/print-cnfp.c
@@ -65,9 +65,9 @@ struct nfhdr_v1 {
};
struct nfrec_v1 {
- struct in_addr src_ina;
- struct in_addr dst_ina;
- struct in_addr nhop_ina;
+ nd_ipv4 src_ina;
+ nd_ipv4 dst_ina;
+ nd_ipv4 nhop_ina;
nd_uint16_t input; /* SNMP index of input interface */
nd_uint16_t output; /* SNMP index of output interface */
nd_uint32_t packets; /* packets in the flow */
@@ -97,9 +97,9 @@ struct nfhdr_v5 {
};
struct nfrec_v5 {
- struct in_addr src_ina;
- struct in_addr dst_ina;
- struct in_addr nhop_ina;
+ nd_ipv4 src_ina;
+ nd_ipv4 dst_ina;
+ nd_ipv4 nhop_ina;
nd_uint16_t input; /* SNMP index of input interface */
nd_uint16_t output; /* SNMP index of output interface */
nd_uint32_t packets; /* packets in the flow */
@@ -117,7 +117,7 @@ struct nfrec_v5 {
nd_uint8_t src_mask; /* source address mask bits */
nd_uint8_t dst_mask; /* destination address prefix mask bits */
nd_byte pad2[2];
- struct in_addr peer_nexthop; /* v6: IP address of the nexthop within the peer (FIB)*/
+ nd_ipv4 peer_nexthop; /* v6: IP address of the nexthop within the peer (FIB)*/
};
struct nfhdr_v6 {
@@ -131,9 +131,9 @@ struct nfhdr_v6 {
};
struct nfrec_v6 {
- struct in_addr src_ina;
- struct in_addr dst_ina;
- struct in_addr nhop_ina;
+ nd_ipv4 src_ina;
+ nd_ipv4 dst_ina;
+ nd_ipv4 nhop_ina;
nd_uint16_t input; /* SNMP index of input interface */
nd_uint16_t output; /* SNMP index of output interface */
nd_uint32_t packets; /* packets in the flow */
@@ -151,7 +151,7 @@ struct nfrec_v6 {
nd_uint8_t src_mask; /* source address mask bits */
nd_uint8_t dst_mask; /* destination address prefix mask bits */
nd_uint16_t flags;
- struct in_addr peer_nexthop; /* v6: IP address of the nexthop within the peer (FIB)*/
+ nd_ipv4 peer_nexthop; /* v6: IP address of the nexthop within the peer (FIB)*/
};
static void
@@ -204,13 +204,18 @@ cnfp_v1_print(netdissect_options *ndo, const u_char *cp)
EXTRACT_BE_U_4(nr->last_time)%1000);
asbuf[0] = buf[0] = '\0';
- ND_PRINT("\n %s%s%s:%u ", intoa(nr->src_ina.s_addr), buf, asbuf,
+ ND_PRINT("\n %s%s%s:%u ",
+ intoa(EXTRACT_IPV4_TO_NETWORK_ORDER(nr->src_ina)),
+ buf, asbuf,
EXTRACT_BE_U_2(nr->srcport));
- ND_PRINT("> %s%s%s:%u ", intoa(nr->dst_ina.s_addr), buf, asbuf,
+ ND_PRINT("> %s%s%s:%u ",
+ intoa(EXTRACT_IPV4_TO_NETWORK_ORDER(nr->dst_ina)),
+ buf, asbuf,
EXTRACT_BE_U_2(nr->dstport));
- ND_PRINT(">> %s\n ", intoa(nr->nhop_ina.s_addr));
+ ND_PRINT(">> %s\n ",
+ intoa(EXTRACT_IPV4_TO_NETWORK_ORDER(nr->nhop_ina)));
proto = EXTRACT_U_1(nr->proto);
if (!ndo->ndo_nflag && (p_name = netdb_protoname(proto)) != NULL)
@@ -299,16 +304,21 @@ cnfp_v5_print(netdissect_options *ndo, const u_char *cp)
nd_snprintf(buf, sizeof(buf), "/%u", EXTRACT_U_1(nr->src_mask));
nd_snprintf(asbuf, sizeof(asbuf), ":%u",
EXTRACT_BE_U_2(nr->src_as));
- ND_PRINT("\n %s%s%s:%u ", intoa(nr->src_ina.s_addr), buf, asbuf,
+ ND_PRINT("\n %s%s%s:%u ",
+ intoa(EXTRACT_IPV4_TO_NETWORK_ORDER(nr->src_ina)),
+ buf, asbuf,
EXTRACT_BE_U_2(nr->srcport));
nd_snprintf(buf, sizeof(buf), "/%u", EXTRACT_U_1(nr->dst_mask));
nd_snprintf(asbuf, sizeof(asbuf), ":%u",
EXTRACT_BE_U_2(nr->dst_as));
- ND_PRINT("> %s%s%s:%u ", intoa(nr->dst_ina.s_addr), buf, asbuf,
+ ND_PRINT("> %s%s%s:%u ",
+ intoa(EXTRACT_IPV4_TO_NETWORK_ORDER(nr->dst_ina)),
+ buf, asbuf,
EXTRACT_BE_U_2(nr->dstport));
- ND_PRINT(">> %s\n ", intoa(nr->nhop_ina.s_addr));
+ ND_PRINT(">> %s\n ",
+ intoa(EXTRACT_IPV4_TO_NETWORK_ORDER(nr->nhop_ina)));
proto = EXTRACT_U_1(nr->proto);
if (!ndo->ndo_nflag && (p_name = netdb_protoname(proto)) != NULL)
@@ -397,16 +407,21 @@ cnfp_v6_print(netdissect_options *ndo, const u_char *cp)
nd_snprintf(buf, sizeof(buf), "/%u", EXTRACT_U_1(nr->src_mask));
nd_snprintf(asbuf, sizeof(asbuf), ":%u",
EXTRACT_BE_U_2(nr->src_as));
- ND_PRINT("\n %s%s%s:%u ", intoa(nr->src_ina.s_addr), buf, asbuf,
+ ND_PRINT("\n %s%s%s:%u ",
+ intoa(EXTRACT_IPV4_TO_NETWORK_ORDER(nr->src_ina)),
+ buf, asbuf,
EXTRACT_BE_U_2(nr->srcport));
nd_snprintf(buf, sizeof(buf), "/%u", EXTRACT_U_1(nr->dst_mask));
nd_snprintf(asbuf, sizeof(asbuf), ":%u",
EXTRACT_BE_U_2(nr->dst_as));
- ND_PRINT("> %s%s%s:%u ", intoa(nr->dst_ina.s_addr), buf, asbuf,
+ ND_PRINT("> %s%s%s:%u ",
+ intoa(EXTRACT_IPV4_TO_NETWORK_ORDER(nr->dst_ina)),
+ buf, asbuf,
EXTRACT_BE_U_2(nr->dstport));
- ND_PRINT(">> %s\n ", intoa(nr->nhop_ina.s_addr));
+ ND_PRINT(">> %s\n ",
+ intoa(EXTRACT_IPV4_TO_NETWORK_ORDER(nr->nhop_ina)));
proto = EXTRACT_U_1(nr->proto);
if (!ndo->ndo_nflag && (p_name = netdb_protoname(proto)) != NULL)
diff --git a/print-ospf.c b/print-ospf.c
index a37b5b1f..e36f8184 100644
--- a/print-ospf.c
+++ b/print-ospf.c
@@ -620,7 +620,7 @@ ospf_print_lsa(netdissect_options *ndo,
{
const uint8_t *ls_end;
const struct rlalink *rlp;
- const struct in_addr *ap;
+ const nd_ipv4 *ap;
const struct aslametric *almp;
const struct mcla *mcp;
const uint8_t *lp;
@@ -689,10 +689,10 @@ ospf_print_lsa(netdissect_options *ndo,
break;
case LS_TYPE_NETWORK:
- ND_TCHECK_4(&lsap->lsa_un.un_nla.nla_mask);
+ ND_TCHECK_4(lsap->lsa_un.un_nla.nla_mask);
ND_PRINT("\n\t Mask %s\n\t Connected Routers:",
- ipaddr_string(ndo, &lsap->lsa_un.un_nla.nla_mask));
- ap = lsap->lsa_un.un_nla.nla_router;
+ ipaddr_string(ndo, lsap->lsa_un.un_nla.nla_mask));
+ ap = &lsap->lsa_un.un_nla.nla_router[0];
while ((const u_char *)ap < ls_end) {
ND_TCHECK_SIZE(ap);
ND_PRINT("\n\t %s", ipaddr_string(ndo, ap));
@@ -701,9 +701,9 @@ ospf_print_lsa(netdissect_options *ndo,
break;
case LS_TYPE_SUM_IP:
- ND_TCHECK_4(&lsap->lsa_un.un_nla.nla_mask);
+ ND_TCHECK_4(lsap->lsa_un.un_nla.nla_mask);
ND_PRINT("\n\t Mask %s",
- ipaddr_string(ndo, &lsap->lsa_un.un_sla.sla_mask));
+ ipaddr_string(ndo, lsap->lsa_un.un_sla.sla_mask));
ND_TCHECK_SIZE(lsap->lsa_un.un_sla.sla_tosmetric);
lp = (const uint8_t *)lsap->lsa_un.un_sla.sla_tosmetric;
while (lp < ls_end) {
@@ -739,7 +739,7 @@ ospf_print_lsa(netdissect_options *ndo,
case LS_TYPE_ASE:
case LS_TYPE_NSSA: /* fall through - those LSAs share the same format */
- ND_TCHECK_4(&lsap->lsa_un.un_nla.nla_mask);
+ ND_TCHECK_4(lsap->lsa_un.un_nla.nla_mask);
ND_PRINT("\n\t Mask %s",
ipaddr_string(ndo, &lsap->lsa_un.un_asla.asla_mask));
@@ -760,13 +760,13 @@ ospf_print_lsa(netdissect_options *ndo,
else
ND_PRINT(" %u", (ul & ASLA_MASK_METRIC));
- ND_TCHECK_4(&almp->asla_forward);
- if (almp->asla_forward.s_addr) {
- ND_PRINT(", forward %s", ipaddr_string(ndo, &almp->asla_forward));
+ ND_TCHECK_4(almp->asla_forward);
+ if (EXTRACT_IPV4_TO_HOST_ORDER(almp->asla_forward) != 0) {
+ ND_PRINT(", forward %s", ipaddr_string(ndo, almp->asla_forward));
}
- ND_TCHECK_4(&almp->asla_tag);
- if (almp->asla_tag.s_addr) {
- ND_PRINT(", tag %s", ipaddr_string(ndo, &almp->asla_tag));
+ ND_TCHECK_4(almp->asla_tag);
+ if (EXTRACT_IPV4_TO_HOST_ORDER(almp->asla_tag) != 0) {
+ ND_PRINT(", tag %s", ipaddr_string(ndo, almp->asla_tag));
}
++almp;
}
@@ -776,17 +776,17 @@ ospf_print_lsa(netdissect_options *ndo,
/* Multicast extensions as of 23 July 1991 */
mcp = lsap->lsa_un.un_mcla;
while ((const u_char *)mcp < ls_end) {
- ND_TCHECK_4(&mcp->mcla_vid);
+ ND_TCHECK_4(mcp->mcla_vid);
switch (EXTRACT_BE_U_4(mcp->mcla_vtype)) {
case MCLA_VERTEX_ROUTER:
ND_PRINT("\n\t Router Router-ID %s",
- ipaddr_string(ndo, &mcp->mcla_vid));
+ ipaddr_string(ndo, mcp->mcla_vid));
break;
case MCLA_VERTEX_NETWORK:
ND_PRINT("\n\t Network Designated Router %s",
- ipaddr_string(ndo, &mcp->mcla_vid));
+ ipaddr_string(ndo, mcp->mcla_vid));
break;
default:
@@ -983,7 +983,7 @@ static int
ospf_decode_v2(netdissect_options *ndo,
const struct ospfhdr *op, const u_char *dataend)
{
- const struct in_addr *ap;
+ const nd_ipv4 *ap;
const struct lsr *lsrp;
const struct lsa_hdr *lshp;
const struct lsa *lsap;
@@ -1000,18 +1000,18 @@ ospf_decode_v2(netdissect_options *ndo,
ND_PRINT("\n\t Hello Timer %us, Dead Timer %us, Mask %s, Priority %u",
EXTRACT_BE_U_2(op->ospf_hello.hello_helloint),
EXTRACT_BE_U_4(op->ospf_hello.hello_deadint),
- ipaddr_string(ndo, &op->ospf_hello.hello_mask),
+ ipaddr_string(ndo, op->ospf_hello.hello_mask),
EXTRACT_U_1(op->ospf_hello.hello_priority));
- ND_TCHECK_4(&op->ospf_hello.hello_dr);
- if (op->ospf_hello.hello_dr.s_addr != 0)
+ ND_TCHECK_4(op->ospf_hello.hello_dr);
+ if (EXTRACT_IPV4_TO_NETWORK_ORDER(op->ospf_hello.hello_dr) != 0)
ND_PRINT("\n\t Designated Router %s",
- ipaddr_string(ndo, &op->ospf_hello.hello_dr));
+ ipaddr_string(ndo, op->ospf_hello.hello_dr));
- ND_TCHECK_4(&op->ospf_hello.hello_bdr);
- if (op->ospf_hello.hello_bdr.s_addr != 0)
+ ND_TCHECK_4(op->ospf_hello.hello_bdr);
+ if (EXTRACT_IPV4_TO_NETWORK_ORDER(op->ospf_hello.hello_bdr) != 0)
ND_PRINT(", Backup Designated Router %s",
- ipaddr_string(ndo, &op->ospf_hello.hello_bdr));
+ ipaddr_string(ndo, op->ospf_hello.hello_bdr));
ap = op->ospf_hello.hello_neighbor;
if ((const u_char *)ap < dataend)
@@ -1143,12 +1143,12 @@ ospf_print(netdissect_options *ndo,
dataend = bp + length;
}
- ND_TCHECK_4(&op->ospf_routerid);
- ND_PRINT("\n\tRouter-ID %s", ipaddr_string(ndo, &op->ospf_routerid));
+ ND_TCHECK_4(op->ospf_routerid);
+ ND_PRINT("\n\tRouter-ID %s", ipaddr_string(ndo, op->ospf_routerid));
- ND_TCHECK_4(&op->ospf_areaid);
- if (op->ospf_areaid.s_addr != 0)
- ND_PRINT(", Area %s", ipaddr_string(ndo, &op->ospf_areaid));
+ ND_TCHECK_4(op->ospf_areaid);
+ if (EXTRACT_IPV4_TO_HOST_ORDER(op->ospf_areaid) != 0)
+ ND_PRINT(", Area %s", ipaddr_string(ndo, op->ospf_areaid));
else
ND_PRINT(", Backbone Area");
diff --git a/print-rx.c b/print-rx.c
index ca6b4672..6e53bdba 100644
--- a/print-rx.c
+++ b/print-rx.c
@@ -1760,8 +1760,8 @@ vldb_reply_print(netdissect_options *ndo,
ND_TCHECK_4(bp);
if (i < nservers)
ND_PRINT(" %s",
- intoa(((const struct in_addr *) bp)->s_addr));
- bp += sizeof(uint32_t);
+ intoa(EXTRACT_IPV4_TO_NETWORK_ORDER(bp)));
+ bp += sizeof(nd_ipv4);
}
ND_PRINT(" partitions");
for (i = 0; i < 8; i++) {
@@ -1807,8 +1807,8 @@ vldb_reply_print(netdissect_options *ndo,
ND_TCHECK_4(bp);
if (i < nservers)
ND_PRINT(" %s",
- intoa(((const struct in_addr *) bp)->s_addr));
- bp += sizeof(uint32_t);
+ intoa(EXTRACT_IPV4_TO_NETWORK_ORDER(bp)));
+ bp += sizeof(nd_ipv4);
}
ND_PRINT(" partitions");
for (i = 0; i < 13; i++) {