Skip to content

Commit

Permalink
Fix incorrect type in assignment of ipv6 port for audit
Browse files Browse the repository at this point in the history
Remove inappropriate use of ntohs() and assign the
port value directly.

Reported-by: kernel test robot <[email protected]>
Signed-off-by: Casey Schaufler <[email protected]>
  • Loading branch information
cschaufler committed Feb 28, 2022
1 parent e783362 commit a5cd1ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/smack/smack_lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2510,7 +2510,7 @@ static int smk_ipv6_check(struct smack_known *subject,
#ifdef CONFIG_AUDIT
smk_ad_init_net(&ad, __func__, LSM_AUDIT_DATA_NET, &net);
ad.a.u.net->family = PF_INET6;
ad.a.u.net->dport = ntohs(address->sin6_port);
ad.a.u.net->dport = address->sin6_port;
if (act == SMK_RECEIVING)
ad.a.u.net->v6info.saddr = address->sin6_addr;
else
Expand Down

0 comments on commit a5cd1ab

Please sign in to comment.