From: Francois-Xavier Le Bail Date: Mon, 10 Jun 2019 12:14:46 +0000 (+0200) Subject: Use nd_ipv4 rather than struct in_addr X-Git-Tag: tcpdump-4.99-bp~754 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/6fc5b4200b5f1dfdca23bdcc4cca696e5e6df49d Use nd_ipv4 rather than struct in_addr --- diff --git a/print-bgp.c b/print-bgp.c index 88ade46d..94de6757 100644 --- a/print-bgp.c +++ b/print-bgp.c @@ -537,7 +537,7 @@ int decode_prefix4(netdissect_options *ndo, const u_char *pptr, u_int itemlen, char *buf, size_t buflen) { - struct in_addr addr; + nd_ipv4 addr; u_int plen, plenbytes; ND_TCHECK_1(pptr); @@ -570,7 +570,7 @@ decode_labeled_prefix4(netdissect_options *ndo, const u_char *pptr, u_int itemlen, char *buf, size_t buflen) { - struct in_addr addr; + nd_ipv4 addr; u_int plen, plenbytes; /* prefix length and label = 4 bytes */ @@ -904,7 +904,7 @@ static int decode_labeled_vpn_prefix4(netdissect_options *ndo, const u_char *pptr, char *buf, size_t buflen) { - struct in_addr addr; + nd_ipv4 addr; u_int plen; ND_TCHECK_1(pptr); diff --git a/print-esp.c b/print-esp.c index c91b04ed..f30563aa 100644 --- a/print-esp.c +++ b/print-esp.c @@ -99,7 +99,7 @@ struct newesp { #ifdef HAVE_LIBCRYPTO union inaddr_u { - struct in_addr in4; + nd_ipv4 in4; struct in6_addr in6; }; struct sa_list { diff --git a/print-hncp.c b/print-hncp.c index 3a3c01ea..60a7ca9b 100644 --- a/print-hncp.c +++ b/print-hncp.c @@ -210,7 +210,7 @@ print_prefix(netdissect_options *ndo, const u_char *prefix, u_int max_length) if (GET_U_1(prefix) >= 96 && max_length >= IPV4_MAPPED_HEADING_LEN + 1 && is_ipv4_mapped_address(prefix + 1)) { - struct in_addr addr; + nd_ipv4 addr; u_int plen; plen = GET_U_1(prefix) - 96; diff --git a/print-isakmp.c b/print-isakmp.c index 18102ebc..66496666 100644 --- a/print-isakmp.c +++ b/print-isakmp.c @@ -635,7 +635,7 @@ ikev1_print(netdissect_options *ndo, #define MAXINITIATORS 20 static int ninitiator = 0; union inaddr_u { - struct in_addr in4; + nd_ipv4 in4; struct in6_addr in6; }; static struct { diff --git a/print-rx.c b/print-rx.c index 1464fa39..49e7a8cb 100644 --- a/print-rx.c +++ b/print-rx.c @@ -480,8 +480,8 @@ static const struct tok rx_ack_reasons[] = { struct rx_cache_entry { uint32_t callnum; /* Call number (net order) */ - struct in_addr client; /* client IP address (net order) */ - struct in_addr server; /* server IP address (net order) */ + nd_ipv4 client; /* client IP address (net order) */ + nd_ipv4 server; /* server IP address (net order) */ u_int dport; /* server port (host order) */ uint16_t serviceId; /* Service identifier (net order) */ uint32_t opcode; /* RX opcode (host order) */ @@ -730,8 +730,8 @@ rx_cache_find(netdissect_options *ndo, const struct rx_header *rxh, do { rxent = &rx_cache[i]; if (rxent->callnum == GET_BE_U_4(rxh->callNumber) && - rxent->client.s_addr == clip && - rxent->server.s_addr == sip && + GET_IPV4_TO_NETWORK_ORDER(rxent->client) == clip && + GET_IPV4_TO_NETWORK_ORDER(rxent->server) == sip && rxent->serviceId == GET_BE_U_2(rxh->serviceId) && rxent->dport == sport) { diff --git a/print-tcp.c b/print-tcp.c index c0a21b98..58e1aef6 100644 --- a/print-tcp.c +++ b/print-tcp.c @@ -68,8 +68,8 @@ static void print_tcp_fastopen_option(netdissect_options *ndo, const u_char *cp, struct tha { - struct in_addr src; - struct in_addr dst; + nd_ipv4 src; + nd_ipv4 dst; u_int port; };