]> The Tcpdump Group git mirrors - tcpdump/commitdiff
repair ID payload protocol # decoding. we shouln't check DOI,
authoritojun <itojun>
Fri, 22 Sep 2000 20:35:34 +0000 (20:35 +0000)
committeritojun <itojun>
Fri, 22 Sep 2000 20:35:34 +0000 (20:35 +0000)
and 0 means ANY (not IPPROTO_IP).

print-isakmp.c

index 75c68787cd1a0db4843336e69f9e449f569da1c0..8042df8d8dc47b1693c8752460d3c77e6e9c4a70 100644 (file)
@@ -30,7 +30,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.13 2000-07-01 03:39:05 assar Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.14 2000-09-22 20:35:34 itojun Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -670,13 +670,16 @@ isakmp_id_print(struct isakmp_gen *ext, u_char *ep, u_int32_t phase,
 
                p = (struct ipsecdoi_id *)ext;
                printf(" idtype=%s", STR_OR_ID(p->type, ipsecidtypestr));
-               setprotoent(1);
-               pe = getprotobynumber(p->proto_id);
-               if (pe)
-                       printf(" protoid=%s", pe->p_name);
-               else
-                       printf(" protoid=%s", PROTOIDSTR(p->proto_id));
-               endprotoent();
+               if (p->proto_id) {
+                       setprotoent(1);
+                       pe = getprotobynumber(p->proto_id);
+                       if (pe)
+                               printf(" protoid=%s", pe->p_name);
+                       endprotoent();
+               } else {
+                       /* it DOES NOT mean IPPROTO_IP! */
+                       printf(" protoid=%s", "0");
+               }
                printf(" port=%d", ntohs(p->port));
                if (!len)
                        break;