netlink_sock_diag: replace NLA_ALIGN with NLMSG_ALIGN
In several netlink_sock_diag parsers NLA_ALIGN was used instead of NLMSG_ALIGN to align the length of netlink messages. Fortunately, both macros round the given length to the closest multiple of 4, so technically there is no difference, but the use of wrong macro is misleading. * netlink_inet_diag.c (decode_inet_diag_req_compat, decode_inet_diag_req_v2, decode_inet_diag_msg): Replace NLA_ALIGN with NLMSG_ALIGN. * netlink_netlink_diag.c (decode_netlink_diag_msg): Likewise. * netlink_packet_diag.c (decode_packet_diag_msg): Likewise. * netlink_smc_diag.c (decode_smc_diag_msg): Likewise.
This commit is contained in:
parent
184b09d450
commit
d6a94e0bcd
@ -255,7 +255,7 @@ decode_inet_diag_req_compat(struct tcb *const tcp,
|
||||
tprints("...");
|
||||
tprints("}");
|
||||
|
||||
offset = NLA_ALIGN(sizeof(req));
|
||||
offset = NLMSG_ALIGN(sizeof(req));
|
||||
if (decode_nla && len > offset) {
|
||||
tprints(", ");
|
||||
decode_nlattr(tcp, addr + offset, len - offset,
|
||||
@ -297,7 +297,7 @@ decode_inet_diag_req_v2(struct tcb *const tcp,
|
||||
tprints("...");
|
||||
tprints("}");
|
||||
|
||||
offset = NLA_ALIGN(sizeof(req));
|
||||
offset = NLMSG_ALIGN(sizeof(req));
|
||||
if (decode_nla && len > offset) {
|
||||
tprints(", ");
|
||||
decode_nlattr(tcp, addr + offset, len - offset,
|
||||
@ -456,7 +456,7 @@ DECL_NETLINK_DIAG_DECODER(decode_inet_diag_msg)
|
||||
tprints("...");
|
||||
tprints("}");
|
||||
|
||||
offset = NLA_ALIGN(sizeof(msg));
|
||||
offset = NLMSG_ALIGN(sizeof(msg));
|
||||
if (decode_nla && len > offset) {
|
||||
tprints(", ");
|
||||
decode_nlattr(tcp, addr + offset, len - offset,
|
||||
|
@ -180,7 +180,7 @@ DECL_NETLINK_DIAG_DECODER(decode_netlink_diag_msg)
|
||||
tprints("...");
|
||||
tprints("}");
|
||||
|
||||
offset = NLA_ALIGN(sizeof(msg));
|
||||
offset = NLMSG_ALIGN(sizeof(msg));
|
||||
if (decode_nla && len > offset) {
|
||||
tprints(", ");
|
||||
decode_nlattr(tcp, addr + offset, len - offset,
|
||||
|
@ -199,7 +199,7 @@ DECL_NETLINK_DIAG_DECODER(decode_packet_diag_msg)
|
||||
tprints("...");
|
||||
tprints("}");
|
||||
|
||||
offset = NLA_ALIGN(sizeof(msg));
|
||||
offset = NLMSG_ALIGN(sizeof(msg));
|
||||
if (decode_nla && len > offset) {
|
||||
tprints(", ");
|
||||
decode_nlattr(tcp, addr + offset, len - offset,
|
||||
|
@ -177,7 +177,7 @@ DECL_NETLINK_DIAG_DECODER(decode_smc_diag_msg)
|
||||
tprints("...");
|
||||
tprints("}");
|
||||
|
||||
offset = NLA_ALIGN(sizeof(msg));
|
||||
offset = NLMSG_ALIGN(sizeof(msg));
|
||||
if (decode_nla && len > offset) {
|
||||
tprints(", ");
|
||||
decode_nlattr(tcp, addr + offset, len - offset,
|
||||
|
Loading…
Reference in New Issue
Block a user