mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-27 12:03:44 +08:00
In the PPP dissector, pass NULL, rather than bogus strings, to
"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.
This commit is contained in:
parent
9f04a5ff81
commit
21666502b4
@ -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));
|
||||
|
15
print-ppp.c
15
print-ppp.c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user