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

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

netfilter: conntrack: deconstify packet callback skb pointer



Only two protocols need the ->error() function: icmp and icmpv6.
This is because icmp error mssages might be RELATED to an existing
connection (e.g. PMTUD, port unreachable and the like), and their
->error() handlers do this.

The error callback is already optional, so remove it for
udp and call them from ->packet() instead.

As the error() callback can call checksum functions that write to
skb->csum*, the const qualifier has to be removed as well.

Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 9976fc6e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -43,7 +43,7 @@ struct nf_conntrack_l4proto {


	/* Returns verdict for packet, or -1 for invalid. */
	/* Returns verdict for packet, or -1 for invalid. */
	int (*packet)(struct nf_conn *ct,
	int (*packet)(struct nf_conn *ct,
		      const struct sk_buff *skb,
		      struct sk_buff *skb,
		      unsigned int dataoff,
		      unsigned int dataoff,
		      enum ip_conntrack_info ctinfo,
		      enum ip_conntrack_info ctinfo,
		      const struct nf_hook_state *state);
		      const struct nf_hook_state *state);
+1 −1
Original line number Original line Diff line number Diff line
@@ -435,7 +435,7 @@ static u64 dccp_ack_seq(const struct dccp_hdr *dh)
		     ntohl(dhack->dccph_ack_nr_low);
		     ntohl(dhack->dccph_ack_nr_low);
}
}


static int dccp_packet(struct nf_conn *ct, const struct sk_buff *skb,
static int dccp_packet(struct nf_conn *ct, struct sk_buff *skb,
		       unsigned int dataoff, enum ip_conntrack_info ctinfo,
		       unsigned int dataoff, enum ip_conntrack_info ctinfo,
		       const struct nf_hook_state *state)
		       const struct nf_hook_state *state)
{
{
+1 −1
Original line number Original line Diff line number Diff line
@@ -44,7 +44,7 @@ static bool generic_pkt_to_tuple(const struct sk_buff *skb,


/* Returns verdict for packet, or -1 for invalid. */
/* Returns verdict for packet, or -1 for invalid. */
static int generic_packet(struct nf_conn *ct,
static int generic_packet(struct nf_conn *ct,
			  const struct sk_buff *skb,
			  struct sk_buff *skb,
			  unsigned int dataoff,
			  unsigned int dataoff,
			  enum ip_conntrack_info ctinfo,
			  enum ip_conntrack_info ctinfo,
			  const struct nf_hook_state *state)
			  const struct nf_hook_state *state)
+1 −1
Original line number Original line Diff line number Diff line
@@ -233,7 +233,7 @@ static unsigned int *gre_get_timeouts(struct net *net)


/* Returns verdict for packet, and may modify conntrack */
/* Returns verdict for packet, and may modify conntrack */
static int gre_packet(struct nf_conn *ct,
static int gre_packet(struct nf_conn *ct,
		      const struct sk_buff *skb,
		      struct sk_buff *skb,
		      unsigned int dataoff,
		      unsigned int dataoff,
		      enum ip_conntrack_info ctinfo,
		      enum ip_conntrack_info ctinfo,
		      const struct nf_hook_state *state)
		      const struct nf_hook_state *state)
+1 −1
Original line number Original line Diff line number Diff line
@@ -74,7 +74,7 @@ static bool icmp_invert_tuple(struct nf_conntrack_tuple *tuple,


/* Returns verdict for packet, or -1 for invalid. */
/* Returns verdict for packet, or -1 for invalid. */
static int icmp_packet(struct nf_conn *ct,
static int icmp_packet(struct nf_conn *ct,
		       const struct sk_buff *skb,
		       struct sk_buff *skb,
		       unsigned int dataoff,
		       unsigned int dataoff,
		       enum ip_conntrack_info ctinfo,
		       enum ip_conntrack_info ctinfo,
		       const struct nf_hook_state *state)
		       const struct nf_hook_state *state)
Loading