Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a163f2cb authored by Florian Westphal's avatar Florian Westphal Committed by Pablo Neira Ayuso
Browse files

netfilter: conntrack: don't acquire lock during seq_printf



read access doesn't need any lock here.

Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 4a96300c
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -191,13 +191,7 @@ static void sctp_print_tuple(struct seq_file *s,
/* Print out the private part of the conntrack. */
static void sctp_print_conntrack(struct seq_file *s, struct nf_conn *ct)
{
	enum sctp_conntrack state;

	spin_lock_bh(&ct->lock);
	state = ct->proto.sctp.state;
	spin_unlock_bh(&ct->lock);

	seq_printf(s, "%s ", sctp_conntrack_names[state]);
	seq_printf(s, "%s ", sctp_conntrack_names[ct->proto.sctp.state]);
}

#define for_each_sctp_chunk(skb, sch, _sch, offset, dataoff, count)	\
+1 −7
Original line number Diff line number Diff line
@@ -313,13 +313,7 @@ static void tcp_print_tuple(struct seq_file *s,
/* Print out the private part of the conntrack. */
static void tcp_print_conntrack(struct seq_file *s, struct nf_conn *ct)
{
	enum tcp_conntrack state;

	spin_lock_bh(&ct->lock);
	state = ct->proto.tcp.state;
	spin_unlock_bh(&ct->lock);

	seq_printf(s, "%s ", tcp_conntrack_names[state]);
	seq_printf(s, "%s ", tcp_conntrack_names[ct->proto.tcp.state]);
}

static unsigned int get_conntrack_index(const struct tcphdr *tcph)