@@ -2250,7 +2250,7 @@ ikev2_ID_print(netdissect_options *ndo, u_char tpay,
2250
2250
uint32_t proto _U_ , int depth _U_ )
2251
2251
{
2252
2252
const struct ikev2_id * idp ;
2253
- u_int idtype_len , i ;
2253
+ u_int idtype_len ;
2254
2254
unsigned int dumpascii , dumphex ;
2255
2255
const unsigned char * typedata ;
2256
2256
@@ -2307,13 +2307,7 @@ ikev2_ID_print(netdissect_options *ndo, u_char tpay,
2307
2307
2308
2308
if (dumpascii ) {
2309
2309
ND_TCHECK_LEN (typedata , idtype_len );
2310
- for (i = 0 ; i < idtype_len ; i ++ ) {
2311
- if (ND_ASCII_ISPRINT (GET_U_1 (typedata + i ))) {
2312
- ND_PRINT ("%c" , GET_U_1 (typedata + i ));
2313
- } else {
2314
- ND_PRINT ("." );
2315
- }
2316
- }
2310
+ nd_printjn (ndo , typedata , idtype_len );
2317
2311
}
2318
2312
if (dumphex ) {
2319
2313
if (!rawprint (ndo , (const uint8_t * )typedata , idtype_len ))
@@ -2848,7 +2842,7 @@ ikev2_vid_print(netdissect_options *ndo, u_char tpay,
2848
2842
uint32_t proto _U_ , int depth _U_ )
2849
2843
{
2850
2844
const u_char * vid ;
2851
- u_int i , len ;
2845
+ u_int len ;
2852
2846
2853
2847
ND_TCHECK_SIZE (ext );
2854
2848
ikev2_pay_print (ndo , NPSTR (tpay ), GET_U_1 (ext -> critical ));
@@ -2861,11 +2855,7 @@ ikev2_vid_print(netdissect_options *ndo, u_char tpay,
2861
2855
vid = (const u_char * )(ext + 1 );
2862
2856
len = item_len - 4 ;
2863
2857
ND_TCHECK_LEN (vid , len );
2864
- for (i = 0 ; i < len ; i ++ ) {
2865
- if (ND_ASCII_ISPRINT (GET_U_1 (vid + i )))
2866
- ND_PRINT ("%c" , GET_U_1 (vid + i ));
2867
- else ND_PRINT ("." );
2868
- }
2858
+ nd_printjn (ndo , vid , len );
2869
2859
if (2 < ndo -> ndo_vflag && 4 < len ) {
2870
2860
/* Print the entire payload in hex */
2871
2861
ND_PRINT (" " );
0 commit comments