]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Rx: Make UDP ports 16-bit to compile (GH #868).
authorDenis Ovsienko <[email protected]>
Wed, 12 Aug 2020 23:59:44 +0000 (00:59 +0100)
committerDenis Ovsienko <[email protected]>
Thu, 13 Aug 2020 00:02:52 +0000 (01:02 +0100)
Gisle Vanem reported that GCC 7.1 for DJGPP sees u_int and uint32_t as
two different types, hence the forward declaration for rx_cache_find()
was different from the actual function. UDP port numbers are 16-bit and
udp_print() appropriately uses uint16_t for them. Use the same type in
the downstream Rx-specific code to make things simpler and consistent.

netdissect.h
print-rx.c

index d73d3f784aad6d1ac18b63b1aa9c8509dc4ea61c..546d38b056a98218737dd85899c8e6bb655c152c 100644 (file)
@@ -668,7 +668,7 @@ extern void rrcp_print(netdissect_options *, const u_char *, u_int, const struct
 extern void rsvp_print(netdissect_options *, const u_char *, u_int);
 extern int rt6_print(netdissect_options *, const u_char *, const u_char *);
 extern void rtsp_print(netdissect_options *, const u_char *, u_int);
-extern void rx_print(netdissect_options *, const u_char *, u_int, u_int, u_int, const u_char *);
+extern void rx_print(netdissect_options *, const u_char *, u_int, uint16_t, uint16_t, const u_char *);
 extern void sctp_print(netdissect_options *, const u_char *, const u_char *, u_int);
 extern void sflow_print(netdissect_options *, const u_char *, u_int);
 extern void ssh_print(netdissect_options *, const u_char *, u_int);
index 56ce2464c71f33dfafa743f04467a4a0dd9add37..6c4ce85879919fe11fa020b37385a645bb95ce69 100644 (file)
@@ -483,7 +483,7 @@ struct rx_cache_entry {
        uint32_t        callnum;        /* Call number (net order) */
        uint32_t        client;         /* client IP address (net order) */
        uint32_t        server;         /* server IP address (net order) */
-       u_int           dport;          /* server port (host order) */
+       uint16_t        dport;          /* server UDP port (host order) */
        uint16_t        serviceId;      /* Service identifier (net order) */
        uint32_t        opcode;         /* RX opcode (host order) */
 };
@@ -494,9 +494,9 @@ static struct rx_cache_entry        rx_cache[RX_CACHE_SIZE];
 
 static uint32_t        rx_cache_next = 0;
 static uint32_t        rx_cache_hint = 0;
-static void    rx_cache_insert(netdissect_options *, const u_char *, const struct ip *, u_int);
+static void    rx_cache_insert(netdissect_options *, const u_char *, const struct ip *, uint16_t);
 static int     rx_cache_find(netdissect_options *, const struct rx_header *,
-                             const struct ip *, uint32_t, uint32_t *);
+                             const struct ip *, uint16_t, uint32_t *);
 
 static void fs_print(netdissect_options *, const u_char *, u_int);
 static void fs_reply_print(netdissect_options *, const u_char *, u_int, uint32_t);
@@ -527,7 +527,7 @@ static int is_ubik(uint32_t);
 
 void
 rx_print(netdissect_options *ndo,
-         const u_char *bp, u_int length, u_int sport, u_int dport,
+         const u_char *bp, u_int length, uint16_t sport, uint16_t dport,
          const u_char *bp2)
 {
        const struct rx_header *rxh;
@@ -685,7 +685,7 @@ rx_print(netdissect_options *ndo,
 
 static void
 rx_cache_insert(netdissect_options *ndo,
-                const u_char *bp, const struct ip *ip, u_int dport)
+                const u_char *bp, const struct ip *ip, uint16_t dport)
 {
        struct rx_cache_entry *rxent;
        const struct rx_header *rxh = (const struct rx_header *) bp;
@@ -715,7 +715,7 @@ rx_cache_insert(netdissect_options *ndo,
 
 static int
 rx_cache_find(netdissect_options *ndo, const struct rx_header *rxh,
-             const struct ip *ip, u_int sport, uint32_t *opcode)
+             const struct ip *ip, uint16_t sport, uint32_t *opcode)
 {
        uint32_t i;
        struct rx_cache_entry *rxent;