On Tue, Jul 03, 2018 at 12:51:26PM +1000, David Gwynne wrote:
> this is the simplest diff i could make that adds gre in udp handling
> to tcpdump.
>
> ok?
OK bluhm@
> Index: print-udp.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/tcpdump/print-udp.c,v
> retrieving revision 1.40
> diff -u -p -r1.40 print-udp.c
> --- print-udp.c 22 Dec 2015 21:01:07 -0000 1.40
> +++ print-udp.c 3 Jul 2018 02:48:13 -0000
> @@ -374,6 +374,7 @@ static int udp6_cksum(const struct ip6_h
> #define GTP_U_PORT 2152
> #define GTP_PRIME_PORT 3386
> #define UDPENCAP_PORT 4500 /*XXX*/
> +#define GRE_PORT 4754
> #define MULTICASTDNS_PORT 5353
>
> #ifdef INET6
> @@ -640,6 +641,10 @@ udp_print(const u_char *bp, u_int length
> iapp_print((const u_char *)(up + 1), length);
> else if (ISPORT(VQP_PORT))
> vqp_print((const u_char *)(up + 1), length);
> + else if (ISPORT(GRE_PORT)) {
> + printf(" ");
> + gre_print((const u_char *)(up + 1), length);
> + }
> #ifdef INET6
> else if (ISPORT(RIPNG_PORT))
> ripng_print((const u_char *)(up + 1), length);