tcpdump mailing list archives
Re: Error in print-ospf layout?
From: Hannes Gredler <hannes () juniper net>
Date: Sat, 28 Feb 2004 02:08:22 +0100
tx, could you pls post a .pcap capture of that ospf packet for more in-depth testing ? ..and on which architecure did you note the endian error ? /hannes On Sat, Feb 28, 2004 at 12:57:22AM +0100, click wrote: | Hi all, | I tried some libnet's samples to sniffing an OSPFV2 HELLO pachet I saw | something strange in the endianless: | | root@White-Dolphin:/home/click/libnet/sample# ./ospf_hello 192.168.0.1 | 192.168.0.1 192.168.0.4 | libnet 1.1 OSPF Hello packet shaping[raw] | Wrote 68 byte OSPF packet; check the wire. | | Sniffing with tcpdump (last CVS version) | | root@White-Dolphin:~/tcpdump# tcpdump -v -i any | tcpdump: WARNING: Promiscuous mode not supported on the "any" device | tcpdump: listening on any, link-type LINUX_SLL (Linux cooked), capture size 68 | bytes | 00:35:17.518403 IP (tos 0x0, ttl 254, id 101, offset 0, flags [DF], length: | 68) White-Dolphin.spine.org > White-Dolphin.spine.org: OSPFv2, Hello (1), | length: 48 | Router-ID: 13.0.0.208, Area 0.238.255.192, Authentication Type: none | (0) | Options: [none] [|ospf] | [snip] | | Has you can see Router-ID and Area are printed in a wrong way..... | the problem is at line 841 of tcpdump/printf-ospf.c for Router-ID field, | and at line 845 for Area field. | | I've patched temporarily print-ospf.c using intoa() and htonl() has you can | see in the .diff file attached with this mail. | | With printf-ospf.c patched: | | OSPFv2, Hello (1), length: 48 | Router-ID: 208.0.0.13, Area 192.255.238.0, Authentication Type: none | (0) | Options: [none] [|ospf] | | | Regards | Valerio 'click' Genovese | -- | http://www.spine-group.org | | | --- print-ospf.c 2004-01-27 14:33:24.000000000 +0100 | +++ print-ospf-patch.c 2004-02-28 00:52:36.000000000 +0100 | @@ -838,11 +838,11 @@ | dataend = bp + length; | | TCHECK(op->ospf_routerid); | - printf("\n\tRouter-ID: %s", ipaddr_string(&op->ospf_routerid)); | + printf("\n\tRouter-ID: %s", intoa(htonl(op->ospf_routerid.s_addr))); | | TCHECK(op->ospf_areaid); | if (op->ospf_areaid.s_addr != 0) | - printf(", Area %s", ipaddr_string(&op->ospf_areaid)); | + printf(", Area %s", intoa(htonl(op->ospf_areaid.s_addr))); | else | printf(", Backbone Area"); | - This is the TCPDUMP workers list. It is archived at http://www.tcpdump.org/lists/workers/index.html To unsubscribe use mailto:tcpdump-workers-request () tcpdump org?body=unsubscribe
Current thread:
- Error in print-ospf layout? click (Feb 27)
- Re: Error in print-ospf layout? Hannes Gredler (Feb 27)
- Re: Error in print-ospf layout? click (Feb 28)
- Re: Error in print-ospf layout? click (Feb 28)
- Re: Error in print-ospf layout? click (Feb 28)
- Re: Error in print-ospf layout? Hannes Gredler (Feb 27)