Hi,
Checked in.
Thanx,
Jaap
On Fri, 6 Oct 2006, Aaron Campbell wrote:
> The expression (BGP_OSPF_RTYPE_EXT ||BGP_OSPF_RTYPE_NSSA) will always
> evaluate to 1. As well, neither of these constants are defined as flag
> values, so a bitwise op was probably not intended either.
>
> Commit log for packet-bgp.c in Ethereal shows that this code originated
> from Aamer Akhter, and was later ported to tcpdump by Hannes Gredler. I
> have already received notice from Hannes that he has committed a fix:
>
> http://cvs.tcpdump.org/cgi-bin/cvsweb/tcpdump/print-bgp.c
>
> Below is my attempt to fix the code in Ethereal. Is it correct? (This is
> untested, I don't have a trace to test with.)
>
> --- packet-bgp.c.orig Thu Oct 5 19:59:25 2006
> +++ packet-bgp.c Thu Oct 5 20:00:40 2006
> @@ -2268,7 +2268,7 @@
> /* always print E2 even if not external route -- receiving router should ignore */
> if ( (tvb_get_guint8(tvb,q+7)) & BGP_OSPF_RTYPE_METRIC_TYPE ) {
> junk_gbuf_ptr += g_snprintf(junk_gbuf_ptr, MAX_STR_LEN-(junk_gbuf_ptr-junk_gbuf), " E2");
> - } else if (tvb_get_guint8(tvb,q+6)==(BGP_OSPF_RTYPE_EXT ||BGP_OSPF_RTYPE_NSSA ) ) {
> + } else if ( (tvb_get_guint8(tvb,q+6)==BGP_OSPF_RTYPE_EXT) || (tvb_get_guint8(tvb,q+6)==BGP_OSPF_RTYPE_NSSA) ) {
> junk_gbuf_ptr += g_snprintf(junk_gbuf_ptr, MAX_STR_LEN-(junk_gbuf_ptr-junk_gbuf), " E1");
> } else {
> junk_gbuf_ptr += g_snprintf(junk_gbuf_ptr, MAX_STR_LEN-(junk_gbuf_ptr-junk_gbuf), ", no options");
>
> ---
> Aaron Campbell <aaron@xxxxxxxxx>
> Software Engineer, Arbor Networks, Inc.
>