Commit c4986734 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[NETFILTER]: x_tables: add xt_{match,target} arguments to match/target functions

parent 1c524830
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -208,6 +208,7 @@ static unsigned int arpt_error(struct sk_buff **pskb,
			       const struct net_device *in,
			       const struct net_device *out,
			       unsigned int hooknum,
			       const struct xt_target *target,
			       const void *targinfo,
			       void *userinfo)
{
+6 −5
Original line number Diff line number Diff line
@@ -8,9 +8,10 @@ MODULE_AUTHOR("Bart De Schuymer <bdschuym@pandora.be>");
MODULE_DESCRIPTION("arptables arp payload mangle target");

static unsigned int
target(struct sk_buff **pskb, const struct net_device *in,
   const struct net_device *out, unsigned int hooknum, const void *targinfo,
   void *userinfo)
target(struct sk_buff **pskb,
       const struct net_device *in, const struct net_device *out,
       unsigned int hooknum, const struct xt_target *target,
       const void *targinfo, void *userinfo)
{
	const struct arpt_mangle *mangle = targinfo;
	struct arphdr *arp;
@@ -65,8 +66,8 @@ target(struct sk_buff **pskb, const struct net_device *in,
}

static int
checkentry(const char *tablename, const void *e, void *targinfo,
   unsigned int targinfosize, unsigned int hook_mask)
checkentry(const char *tablename, const void *e, const struct xt_target *target,
           void *targinfo, unsigned int targinfosize, unsigned int hook_mask)
{
	const struct arpt_mangle *mangle = targinfo;

+4 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ static unsigned int ipt_snat_target(struct sk_buff **pskb,
				    const struct net_device *in,
				    const struct net_device *out,
				    unsigned int hooknum,
				    const struct ipt_target *target,
				    const void *targinfo,
				    void *userinfo)
{
@@ -145,6 +146,7 @@ static unsigned int ipt_dnat_target(struct sk_buff **pskb,
				    const struct net_device *in,
				    const struct net_device *out,
				    unsigned int hooknum,
				    const struct ipt_target *target,
				    const void *targinfo,
				    void *userinfo)
{
@@ -170,6 +172,7 @@ static unsigned int ipt_dnat_target(struct sk_buff **pskb,

static int ipt_snat_checkentry(const char *tablename,
			       const void *entry,
			       const struct ipt_target *target,
			       void *targinfo,
			       unsigned int targinfosize,
			       unsigned int hook_mask)
@@ -186,6 +189,7 @@ static int ipt_snat_checkentry(const char *tablename,

static int ipt_dnat_checkentry(const char *tablename,
			       const void *entry,
			       const struct ipt_target *target,
			       void *targinfo,
			       unsigned int targinfosize,
			       unsigned int hook_mask)
+3 −0
Original line number Diff line number Diff line
@@ -179,6 +179,7 @@ ipt_error(struct sk_buff **pskb,
	  const struct net_device *in,
	  const struct net_device *out,
	  unsigned int hooknum,
	  const struct xt_target *target,
	  const void *targinfo,
	  void *userinfo)
{
@@ -1285,6 +1286,7 @@ static int
icmp_match(const struct sk_buff *skb,
	   const struct net_device *in,
	   const struct net_device *out,
	   const struct xt_match *match,
	   const void *matchinfo,
	   int offset,
	   unsigned int protoff,
@@ -1318,6 +1320,7 @@ icmp_match(const struct sk_buff *skb,
static int
icmp_checkentry(const char *tablename,
	   const void *info,
	   const struct xt_match *match,
	   void *matchinfo,
	   unsigned int matchsize,
	   unsigned int hook_mask)
+5 −2
Original line number Diff line number Diff line
@@ -311,6 +311,7 @@ target(struct sk_buff **pskb,
       const struct net_device *in,
       const struct net_device *out,
       unsigned int hooknum,
       const struct xt_target *target,
       const void *targinfo,
       void *userinfo)
{
@@ -380,6 +381,7 @@ target(struct sk_buff **pskb,
static int
checkentry(const char *tablename,
	   const void *e_void,
	   const struct xt_target *target,
           void *targinfo,
           unsigned int targinfosize,
           unsigned int hook_mask)
@@ -458,9 +460,10 @@ checkentry(const char *tablename,
}

/* drop reference count of cluster config when rule is deleted */
static void destroy(void *matchinfo, unsigned int matchinfosize)
static void destroy(const struct xt_target *target, void *targinfo,
		    unsigned int targinfosize)
{
	struct ipt_clusterip_tgt_info *cipinfo = matchinfo;
	struct ipt_clusterip_tgt_info *cipinfo = targinfo;

	/* if no more entries are referencing the config, remove it
	 * from the list and destroy the proc entry */
Loading