]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Fix indentation to make it clearer what the arguments to a printf call
authorGuy Harris <[email protected]>
Sun, 28 Jun 2009 18:06:01 +0000 (11:06 -0700)
committerGuy Harris <[email protected]>
Sun, 28 Jun 2009 18:06:01 +0000 (11:06 -0700)
are.

To extract a 32-bit big-endian quantity from a particular address, use
EXTRACT_32BITS(), don't do pointer casting - casting a "char *" or
"unsigned char *" to point to a multi-byte quantity doesn't guarantee
the pointer can be dereferenced and give you the right answer (SPARC
traps on unaligned pointer accesses, some other processor types might
also trap, or might ignore the low bits of the pointer).

print-rsvp.c

index 6a74cfe5ca52209ca29c75dac1d8dd5a7b3da116..3778e62b9514ccf8fa8ce64dae9f5f372ee02bd4 100644 (file)
@@ -1079,12 +1079,12 @@ rsvp_obj_print (const u_char *pptr, u_int plen, const u_char *tptr,
                                bittok2str(rsvp_obj_rro_label_flag_values,
                                    "none",
                                    *(obj_tptr+2)),
-                                   *(obj_tptr+2),
+                               *(obj_tptr+2),
                                tok2str(rsvp_ctype_values,
                                        "Unknown",
                                        *(obj_tptr+3) + 256*RSVP_OBJ_RRO),
-                                       *(obj_tptr+3),
-                                       ntohl(*(unsigned int *)(obj_tptr+4)));
+                               *(obj_tptr+3),
+                               EXTRACT_32BITS(obj_tptr+4));
                     }
                     obj_tlen-=*(obj_tptr+1);
                     obj_tptr+=*(obj_tptr+1);