]> The Tcpdump Group git mirrors - tcpdump/commitdiff
In the PPP dissector, pass NULL, rather than bogus strings, to
authorguy <guy>
Sun, 9 Sep 2001 02:04:18 +0000 (02:04 +0000)
committerguy <guy>
Sun, 9 Sep 2001 02:04:18 +0000 (02:04 +0000)
"isoclns_print()", for the MAC source and destination addresses, and
have "isoclns_print()" print the MAC addresses only if they're both
non-null, rather than having the PPP print routine tweak "eflag" to
suppress the printing.

print-isoclns.c
print-ppp.c

index 6eff60775fb1812217316d700e6f95e544f6658a..591dd0ae893f0f830ac4692c343a4d73d6fc6965 100644 (file)
@@ -23,7 +23,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.22 2000-10-11 04:04:33 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.23 2001-09-09 02:04:18 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -180,7 +180,7 @@ isoclns_print(const u_char *p, u_int length, u_int caplen,
 
        if (caplen < 1) {
                printf("[|iso-clns] ");
-               if (!eflag)
+               if (!eflag && esrc != NULL && edst != NULL)
                        printf("%s > %s",
                               etheraddr_string(esrc),
                               etheraddr_string(edst));
@@ -191,7 +191,7 @@ isoclns_print(const u_char *p, u_int length, u_int caplen,
 
        case NLPID_CLNS:
                printf("iso clns");
-               if (!eflag)
+               if (!eflag && esrc != NULL && edst != NULL)
                        (void)printf(" %s > %s",
                                     etheraddr_string(esrc),
                                     etheraddr_string(edst));
@@ -199,7 +199,7 @@ isoclns_print(const u_char *p, u_int length, u_int caplen,
 
        case NLPID_ESIS:
                printf("iso esis");
-               if (!eflag)
+               if (!eflag && esrc != NULL && edst != NULL)
                        (void)printf(" %s > %s",
                                     etheraddr_string(esrc),
                                     etheraddr_string(edst));
@@ -208,7 +208,7 @@ isoclns_print(const u_char *p, u_int length, u_int caplen,
 
        case NLPID_ISIS:
                printf("iso isis");
-               if (!eflag) {
+               if (!eflag && esrc != NULL && edst != NULL) {
                        if(pdu_type != PTP_IIH)
                                (void)printf(" %s > %s",
                                     etheraddr_string(esrc),
@@ -221,7 +221,7 @@ isoclns_print(const u_char *p, u_int length, u_int caplen,
 
        case NLPID_NULLNS:
                printf("iso nullns");
-               if (!eflag)
+               if (!eflag && esrc != NULL && edst != NULL)
                        (void)printf(" %s > %s",
                                     etheraddr_string(esrc),
                                     etheraddr_string(edst));
@@ -229,7 +229,7 @@ isoclns_print(const u_char *p, u_int length, u_int caplen,
 
        default:
                printf("iso clns %02x", p[0]);
-               if (!eflag)
+               if (!eflag && esrc != NULL && edst != NULL)
                        (void)printf(" %s > %s",
                                     etheraddr_string(esrc),
                                     etheraddr_string(edst));
index ebfb9059614cf3475d52bbaa92129d83670d04d2..0739076aa7985f6c5626408a7285eec9fff6a272 100644 (file)
@@ -31,7 +31,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.63 2001-09-09 01:38:32 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.64 2001-09-09 02:04:19 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -951,8 +951,6 @@ print_bacp_config_options(const u_char *p, int length)
 static void
 handle_ppp(u_int proto, const u_char *p, int length)
 {
-       int save_eflag;
-
        switch (proto) {
        case PPP_LCP:
        case PPP_IPCP:
@@ -984,16 +982,7 @@ handle_ppp(u_int proto, const u_char *p, int length)
                ipx_print(p, length);
                break;
        case PPP_OSI:
-               save_eflag = eflag;
-               eflag = 1;      /* set the eflag indicating to isoclns_print()
-                                  that this packet was _not_ captured over an
-                                  ethernet circuit - hence no need to print
-                                  mac-addresses - send bogus addresses for
-                                  source & dest mac
-
-                                  XXX - this needs to be handled better. */
-               isoclns_print(p, length, length, "000000", "000000");
-               eflag = save_eflag;
+               isoclns_print(p, length, length, NULL, NULL);
                break;
        default:
                break;