> On 8 Mar 2017, at 16:29, Jeremie Courreges-Anglas <[email protected]> wrote:
>
>
> https://tools.ietf.org/html/draft-housley-etherip-01
>
> still proposes a 1 byte header, the first nibble is the version (2).
> The published RFC specifies version 3 and a two bytes header.
>
> https://tools.ietf.org/html/rfc3378
>
> print-etherip.c almost gets it right when trying to interpret the
> version. Here's a diff to fix it.
>
> Using tcpdump -envvvttt, before:
>
> Mar 08 04:21:03.258703 fe:e1:ba:d1:94:57 fe:e1:ba:d1:94:56 0800 134: etherip
> 10.64.20.2 > 10.64.20.1 ver unknown len 100 [tos 0x10] (ttl 64, id 33731, len
> 120)
> Mar 08 04:21:03.259136 fe:e1:ba:d1:94:56 fe:e1:ba:d1:94:57 0800 134: etherip
> 10.64.20.1 > 10.64.20.2 ver unknown len 100 [tos 0x10] (ttl 64, id 56533, len
> 120)
>
> After:
>
> Mar 08 04:21:56.786890 fe:e1:ba:d1:94:57 fe:e1:ba:d1:94:56 0800 134: etherip
> 10.64.20.2 > 10.64.20.1 ver 3 len 100: fe:e1:ba:d1:94:58 fe:e1:ba:d0:18:c3
> 0800 98: 10.64.64.3 > 10.64.64.1: icmp: echo request (id:9d1b seq:8359) (ttl
> 255, id 7825, len 84) [tos 0x10] (ttl 64, id 61952, len 120)
> Mar 08 04:21:56.787106 fe:e1:ba:d1:94:56 fe:e1:ba:d1:94:57 0800 134: etherip
> 10.64.20.1 > 10.64.20.2 ver 3 len 100: fe:e1:ba:d0:18:c3 fe:e1:ba:d1:94:58
> 0800 98: 10.64.64.1 > 10.64.64.3: icmp: echo reply (id:9d1b seq:8359) (ttl
> 255, id 31193, len 84) [tos 0x10] (ttl 64, id 35562, len 120)
>
> ok?
ok.
>
>
> Index: print-etherip.c
> ===================================================================
> RCS file: /d/cvs/src/usr.sbin/tcpdump/print-etherip.c,v
> retrieving revision 1.8
> diff -u -p -p -u -r1.8 print-etherip.c
> --- print-etherip.c 16 Jan 2015 06:40:21 -0000 1.8
> +++ print-etherip.c 8 Mar 2017 06:21:22 -0000
> @@ -72,7 +72,7 @@ etherip_print(const u_char *bp, u_int ca
> printf("etherip %s > %s ver ", ipaddr_string(&ip->ip_src),
> ipaddr_string(&ip->ip_dst));
>
> - switch ((*pbuf) & 0xf) {
> + switch (*pbuf >> 4) {
> case 2:
> hlen = 1;
> printf("%d", 2);
>
>
> --
> jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
>