Ethereal-dev: [patch] Re: [Ethereal-dev] Service Location Protocol

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Brad Hards <bhards@xxxxxxxxxxxxxx>
Date: Fri, 14 Feb 2003 17:35:27 +1100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 13 Feb 2003 06:47, Brad Hards wrote:
>       0                   1                   2                   3
>       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
>      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>      |    Version    |  Function-ID  |            Length             |
>      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>      | Length, contd.|O|F|R|       reserved          |Next Ext Offset|
>      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>      |  Next Extension Offset, contd.|              XID              |
>      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>      |      Language Tag Length      |         Language Tag          \
>      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
>
> </quote>
>
> How do you get two bytes out of that? Or are you looking at something that
> is doing SLPv1?
Clearly I should have had coffee before spruiking off and showing what a moron 
I am.

Many thanks to Christoph for both finding the error, and then politely 
pointing out (off list) why I was wrong.

Patch is attached. This corrects both the display error, and a couple of typos 
that I had queued for SLP.

Please apply.

Brad



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+TI4vW6pHgIdAuOMRArG5AJ9mOGuR6eW0kesdBUgH03Wt5C6LAwCgkClO
0pP61DAl2Z5cvuMnJdnqZT0=
=Ou1D
-----END PGP SIGNATURE-----
diff -Naur -x ps.c -x register.c -x register-static.c clean/ethereal-0.9.9/packet-srvloc.c ethereal-0.9.9/packet-srvloc.c
--- clean/ethereal-0.9.9/packet-srvloc.c	2003-01-24 10:50:14.000000000 +1100
+++ ethereal-0.9.9/packet-srvloc.c	2003-02-14 17:37:10.000000000 +1100
@@ -703,7 +703,7 @@
 	    next_ext_off = tvb_get_ntoh24(tvb, offset + 7);
 	    proto_tree_add_uint(srvloc_tree, hf_srvloc_nextextoff, tvb, offset + 7, 3,
 				next_ext_off);
-	    proto_tree_add_uint(srvloc_tree, hf_srvloc_xid, tvb, offset + 10, 3,
+	    proto_tree_add_uint(srvloc_tree, hf_srvloc_xid, tvb, offset + 10, 2,
 				tvb_get_ntohs(tvb, offset + 10));
 	    lang_tag_len = tvb_get_ntohs(tvb, offset + 12);
 	    proto_tree_add_uint(srvloc_tree, hf_srvloc_langtaglen, tvb, offset + 12, 2,	lang_tag_len);
@@ -1199,7 +1199,7 @@
 	    "", HFILL}
 	},
 	{ &hf_srvloc_attrreq_slpspilen,
-	  { "SLP SPI Length", "svrloc.attrreq.slpspilen", FT_UINT16, BASE_DEC, NULL, 0x0,
+	  { "SLP SPI Length", "srvloc.attrreq.slpspilen", FT_UINT16, BASE_DEC, NULL, 0x0,
 	    "Length of the SLP SPI", HFILL}
 	},
 	{ &hf_srvloc_attrreq_slpspi,
@@ -1251,7 +1251,7 @@
 	    "", HFILL}
 	},
 	{ &hf_srvloc_daadvert_slpspilen,
-	  { "SLP SPI Length", "svrloc.daadvert.slpspilen", FT_UINT16, BASE_DEC, NULL, 0x0,
+	  { "SLP SPI Length", "srvloc.daadvert.slpspilen", FT_UINT16, BASE_DEC, NULL, 0x0,
 	    "Length of the SLP SPI", HFILL}
 	},
 	{ &hf_srvloc_daadvert_slpspi,