ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: [Ethereal-dev] [PATCH] packet_ospf.c update according to last OSPF-TE draft

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

From: Michael Rozhavsky <mike@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 14 May 2001 13:39:03 +0300 (IDT)
Hi,

There are some minor changes between 3rd and 4th edition of
draft-katz-yeung-ospf-traffic.

This patch corrects sub-TLV translation. See subsections 2.5.3 and 2.5.4
of draft.

--

      Michael Rozhavsky
Index: packet-ospf.c
===================================================================
RCS file: /cvsroot/ethereal/packet-ospf.c,v
retrieving revision 1.39
diff -u -r1.39 packet-ospf.c
--- packet-ospf.c	2001/05/02 18:12:44	1.39
+++ packet-ospf.c	2001/05/14 09:29:48
@@ -601,15 +601,17 @@
 		case MPLS_LINK_LOCAL_IF:
 		case MPLS_LINK_REMOTE_IF:
 		    ti = proto_tree_add_text(tlv_tree, tvb, stlv_offset, stlv_len+4,
-					     "%s: %s", stlv_name,
-					     ip_to_str(tvb_get_ptr(tvb, stlv_offset+4, 4)));
+					     "%s", stlv_name);
 		    stlv_tree = proto_item_add_subtree(ti, ett_ospf_lsa_mpls_link_stlv);
 		    proto_tree_add_text(stlv_tree, tvb, stlv_offset, 2,
 					"TLV Type: %u: %s", stlv_type, stlv_name);
 		    proto_tree_add_text(stlv_tree, tvb, stlv_offset+2, 2, "TLV Length: %u",
 					stlv_len);
-		    proto_tree_add_text(stlv_tree, tvb, stlv_offset+4, 4, "%s: %s", stlv_name,
-					ip_to_str(tvb_get_ptr(tvb, stlv_offset+4, 4)));
+		    /*   The Local/Remote Interface IP Address sub-TLV is TLV type 3/4, and is 4N
+		       octets in length, where N is the number of neighbor addresses. */
+		    for (i=0; i < stlv_len; i+=4)
+		      proto_tree_add_text(stlv_tree, tvb, stlv_offset+4+i, 4, "%s: %s", stlv_name,
+					  ip_to_str(tvb_get_ptr(tvb, stlv_offset+4+i, 4)));
 		    break;
 
 		case MPLS_LINK_TE_METRIC: