diff options
author | guy <guy> | 2000-12-18 05:41:58 +0000 |
---|---|---|
committer | guy <guy> | 2000-12-18 05:41:58 +0000 |
commit | 7c4458eb6a0cd2a617adb9a3bbca44e9f59f3937 (patch) | |
tree | 12eca44caea2ab4878e6693ade5d6ebc65604c53 /print-gre.c | |
parent | 93b36b0a34cd8e08831ca1f6a224c2efda95aa73 (diff) | |
download | tcpdump-7c4458eb6a0cd2a617adb9a3bbca44e9f59f3937.tar.gz |
Making "extracted_ethertype" static to "print-ether.c" broke other
dissectors that expected calls to "llc_print()" to set it. (Thanks and
a tip of the hat to Olaf Kirch <okir@caldera.de> for noticing this.)
Make "ether_encap_print()" and "llc_print()" take a pointer to an
extracted-Ethertype variable as an argument, have "llc_print()" pass it
to "ether_encap_print()", and have "ether_encap_print()" set what it
points to rather than setting a static "extracted_ethertype" variable.
Get rid of said static "extracted_ethertype" variable in favor of one
local to "ether_if_print()", just as other link-layer dissectors have
local "extracted_ethertype" variables.
Diffstat (limited to 'print-gre.c')
-rw-r--r-- | print-gre.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/print-gre.c b/print-gre.c index 1076c7fd..1e801b91 100644 --- a/print-gre.c +++ b/print-gre.c @@ -24,7 +24,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-gre.c,v 1.8 2000-09-29 04:58:39 guy Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-gre.c,v 1.9 2000-12-18 05:41:59 guy Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -86,7 +86,7 @@ gre_print(const u_char *bp, u_int length) { const u_char *cp = bp + 4; const struct gre *gre; - u_short flags, proto; + u_short flags, proto, extracted_ethertype; gre = (const struct gre *)bp; @@ -123,7 +123,8 @@ gre_print(const u_char *bp, u_int length) cp += 4; length -= cp - bp; - if (ether_encap_print(proto, cp, length, length) == 0) + if (ether_encap_print(proto, cp, length, length, + &extracted_ethertype) == 0) printf("gre-proto-0x%04X", proto); return; |