]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Define NETDISSECT_REWORKED and fix the issues it provokes.
authorGuy Harris <[email protected]>
Fri, 4 Apr 2014 07:46:33 +0000 (00:46 -0700)
committerGuy Harris <[email protected]>
Fri, 4 Apr 2014 07:46:33 +0000 (00:46 -0700)
I.e., use the flags from the netdissect_options structure.

addrtoname.c

index ba0397c2325d238ec6b729e6eb59014afc48da0f..f3fabb06566e22956ec52ebee5ffac32685160e3 100644 (file)
@@ -22,6 +22,7 @@
  *  and address to string conversion routines
  */
 
  *  and address to string conversion routines
  */
 
+#define NETDISSECT_REWORKED
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -247,7 +248,7 @@ getname(netdissect_options *ndo, const u_char *ap)
                        char *dotp;
 
                        p->name = strdup(hp->h_name);
                        char *dotp;
 
                        p->name = strdup(hp->h_name);
-                       if (Nflag) {
+                       if (ndo->ndo_Nflag) {
                                /* Remove domain qualifications */
                                dotp = strchr(p->name, '.');
                                if (dotp)
                                /* Remove domain qualifications */
                                dotp = strchr(p->name, '.');
                                if (dotp)
@@ -298,7 +299,7 @@ getname6(netdissect_options *ndo, const u_char *ap)
                        char *dotp;
 
                        p->name = strdup(hp->h_name);
                        char *dotp;
 
                        p->name = strdup(hp->h_name);
-                       if (Nflag) {
+                       if (ndo->ndo_Nflag) {
                                /* Remove domain qualifications */
                                dotp = strchr(p->name, '.');
                                if (dotp)
                                /* Remove domain qualifications */
                                dotp = strchr(p->name, '.');
                                if (dotp)
@@ -1131,14 +1132,14 @@ init_ipxsaparray(void)
 
 /*
  * Initialize the address to name translation machinery.  We map all
 
 /*
  * Initialize the address to name translation machinery.  We map all
- * non-local IP addresses to numeric addresses if fflag is true (i.e.,
- * to prevent blocking on the nameserver).  localnet is the IP address
+ * non-local IP addresses to numeric addresses if ndo->ndo_fflag is true
+ * (i.e., to prevent blocking on the nameserver).  localnet is the IP address
  * of the local network.  mask is its subnet mask.
  */
 void
 init_addrtoname(netdissect_options *ndo, u_int32_t localnet, u_int32_t mask)
 {
  * of the local network.  mask is its subnet mask.
  */
 void
 init_addrtoname(netdissect_options *ndo, u_int32_t localnet, u_int32_t mask)
 {
-       if (fflag) {
+       if (ndo->ndo_fflag) {
                f_localnet = localnet;
                f_netmask = mask;
        }
                f_localnet = localnet;
                f_netmask = mask;
        }