Fix incorrect uses of sizeof().

The details of the fix can be found in the tcpdump git repository:
commit 684955d58611ee94eccdc34e82b32e676337188c
This commit is contained in:
Kevin Lo 2011-12-28 05:58:31 +00:00
parent 6b194c7ade
commit 5610c31cb2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=228926
6 changed files with 8 additions and 8 deletions

View File

@ -280,7 +280,7 @@ eigrp_print(register const u_char *pptr, register u_int len) {
if (eigrp_tlv_len < sizeof(struct eigrp_tlv_header) ||
eigrp_tlv_len > tlen) {
print_unknown_data(tptr+sizeof(sizeof(struct eigrp_tlv_header)),"\n\t ",tlen);
print_unknown_data(tptr+sizeof(struct eigrp_tlv_header),"\n\t ",tlen);
return;
}
@ -468,7 +468,7 @@ eigrp_print(register const u_char *pptr, register u_int len) {
}
/* do we want to see an additionally hexdump ? */
if (vflag > 1)
print_unknown_data(tptr+sizeof(sizeof(struct eigrp_tlv_header)),"\n\t ",
print_unknown_data(tptr+sizeof(struct eigrp_tlv_header),"\n\t ",
eigrp_tlv_len-sizeof(struct eigrp_tlv_header));
tptr+=eigrp_tlv_len;

View File

@ -609,7 +609,7 @@ ldp_msg_print(register const u_char *pptr) {
}
/* do we want to see an additionally hexdump ? */
if (vflag > 1 || hexdump==TRUE)
print_unknown_data(tptr+sizeof(sizeof(struct ldp_msg_header)),"\n\t ",
print_unknown_data(tptr+sizeof(struct ldp_msg_header),"\n\t ",
msg_len);
tptr += msg_len+4;

View File

@ -871,7 +871,7 @@ lmp_print(register const u_char *pptr, register u_int len) {
}
/* do we want to see an additionally hexdump ? */
if (vflag > 1 || hexdump==TRUE)
print_unknown_data(tptr+sizeof(sizeof(struct lmp_object_header)),"\n\t ",
print_unknown_data(tptr+sizeof(struct lmp_object_header),"\n\t ",
lmp_obj_len-sizeof(struct lmp_object_header));
tptr+=lmp_obj_len;

View File

@ -878,7 +878,7 @@ lspping_print(register const u_char *pptr, register u_int len) {
}
/* do we want to see an additionally tlv hexdump ? */
if (vflag > 1 || tlv_hexdump==TRUE)
print_unknown_data(tptr+sizeof(sizeof(struct lspping_tlv_header)),"\n\t ",
print_unknown_data(tptr+sizeof(struct lspping_tlv_header),"\n\t ",
lspping_tlv_len);

View File

@ -1790,7 +1790,7 @@ _U_
}
/* do we also want to see a hex dump ? */
if (vflag > 1 || hexdump==TRUE)
print_unknown_data(tptr+sizeof(sizeof(struct rsvp_object_header)),"\n\t ", /* FIXME indentation */
print_unknown_data(tptr+sizeof(struct rsvp_object_header),"\n\t ", /* FIXME indentation */
rsvp_obj_len-sizeof(struct rsvp_object_header));
tptr+=rsvp_obj_len;

View File

@ -368,7 +368,7 @@ void slow_marker_lacp_print(register const u_char *tptr, register u_int tlen) {
tlv_header->type != LACP_TLV_TERMINATOR &&
tlv_header->type != MARKER_TLV_TERMINATOR) {
printf("\n\t-----trailing data-----");
print_unknown_data(tptr+sizeof(sizeof(struct tlv_header_t)),"\n\t ",tlen);
print_unknown_data(tptr+sizeof(struct tlv_header_t),"\n\t ",tlen);
return;
}
@ -441,7 +441,7 @@ void slow_marker_lacp_print(register const u_char *tptr, register u_int tlen) {
}
/* do we want to see an additional hexdump ? */
if (vflag > 1) {
print_unknown_data(tptr+sizeof(sizeof(struct tlv_header_t)),"\n\t ",
print_unknown_data(tptr+sizeof(struct tlv_header_t),"\n\t ",
tlv_len-sizeof(struct tlv_header_t));
}