Skip to content

Commit 5547cd0

Browse files
kaberdavem330
authored andcommitted
netfilter: nf_conntrack_sctp: fix sparse warnings
Introduced by a258860 (netfilter: ctnetlink: add full support for SCTP to ctnetlink): net/netfilter/nf_conntrack_proto_sctp.c:483:2: warning: cast from restricted type net/netfilter/nf_conntrack_proto_sctp.c:483:2: warning: incorrect type in argument 1 (different base types) net/netfilter/nf_conntrack_proto_sctp.c:483:2: expected unsigned int [unsigned] [usertype] x net/netfilter/nf_conntrack_proto_sctp.c:483:2: got restricted unsigned int const <noident> net/netfilter/nf_conntrack_proto_sctp.c:483:2: warning: cast from restricted type net/netfilter/nf_conntrack_proto_sctp.c:483:2: warning: cast from restricted type net/netfilter/nf_conntrack_proto_sctp.c:483:2: warning: cast from restricted type net/netfilter/nf_conntrack_proto_sctp.c:483:2: warning: cast from restricted type net/netfilter/nf_conntrack_proto_sctp.c:487:2: warning: cast from restricted type net/netfilter/nf_conntrack_proto_sctp.c:487:2: warning: incorrect type in argument 1 (different base types) net/netfilter/nf_conntrack_proto_sctp.c:487:2: expected unsigned int [unsigned] [usertype] x net/netfilter/nf_conntrack_proto_sctp.c:487:2: got restricted unsigned int const <noident> net/netfilter/nf_conntrack_proto_sctp.c:487:2: warning: cast from restricted type net/netfilter/nf_conntrack_proto_sctp.c:487:2: warning: cast from restricted type net/netfilter/nf_conntrack_proto_sctp.c:487:2: warning: cast from restricted type net/netfilter/nf_conntrack_proto_sctp.c:487:2: warning: cast from restricted type net/netfilter/nf_conntrack_proto_sctp.c:532:42: warning: incorrect type in assignment (different base types) net/netfilter/nf_conntrack_proto_sctp.c:532:42: expected restricted unsigned int <noident> net/netfilter/nf_conntrack_proto_sctp.c:532:42: got unsigned int net/netfilter/nf_conntrack_proto_sctp.c:534:39: warning: incorrect type in assignment (different base types) net/netfilter/nf_conntrack_proto_sctp.c:534:39: expected restricted unsigned int <noident> net/netfilter/nf_conntrack_proto_sctp.c:534:39: got unsigned int Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c71529e commit 5547cd0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

net/netfilter/nf_conntrack_proto_sctp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,11 +482,11 @@ static int sctp_to_nlattr(struct sk_buff *skb, struct nlattr *nla,
482482

483483
NLA_PUT_BE32(skb,
484484
CTA_PROTOINFO_SCTP_VTAG_ORIGINAL,
485-
htonl(ct->proto.sctp.vtag[IP_CT_DIR_ORIGINAL]));
485+
ct->proto.sctp.vtag[IP_CT_DIR_ORIGINAL]);
486486

487487
NLA_PUT_BE32(skb,
488488
CTA_PROTOINFO_SCTP_VTAG_REPLY,
489-
htonl(ct->proto.sctp.vtag[IP_CT_DIR_REPLY]));
489+
ct->proto.sctp.vtag[IP_CT_DIR_REPLY]);
490490

491491
read_unlock_bh(&sctp_lock);
492492

@@ -530,9 +530,9 @@ static int nlattr_to_sctp(struct nlattr *cda[], struct nf_conn *ct)
530530
write_lock_bh(&sctp_lock);
531531
ct->proto.sctp.state = nla_get_u8(tb[CTA_PROTOINFO_SCTP_STATE]);
532532
ct->proto.sctp.vtag[IP_CT_DIR_ORIGINAL] =
533-
ntohl(nla_get_be32(tb[CTA_PROTOINFO_SCTP_VTAG_ORIGINAL]));
533+
nla_get_be32(tb[CTA_PROTOINFO_SCTP_VTAG_ORIGINAL]);
534534
ct->proto.sctp.vtag[IP_CT_DIR_REPLY] =
535-
ntohl(nla_get_be32(tb[CTA_PROTOINFO_SCTP_VTAG_REPLY]));
535+
nla_get_be32(tb[CTA_PROTOINFO_SCTP_VTAG_REPLY]);
536536
write_unlock_bh(&sctp_lock);
537537

538538
return 0;

0 commit comments

Comments
 (0)