[nf-next,4/4] netfilter: sip: Use NF_DROP and NF_ACCEPT instead of 0 and 1

Submitted by 高峰 on March 17, 2017, 6:49 a.m.

Details

Message ID 5b6ed9bdf11a28a4c514cb94ca042f741d9d688b.1489726438.git.fgao@ikuai8.com
State Changes Requested
Delegated to: Pablo Neira
Headers show

Commit Message

高峰 March 17, 2017, 6:49 a.m.
From: Gao Feng <fgao@ikuai8.com>

The current sip codes should use NF_DROP and NF_ACCEPT instead of
the literal number 0 and 1.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
---
 net/netfilter/nf_nat_sip.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/net/netfilter/nf_nat_sip.c b/net/netfilter/nf_nat_sip.c
index 791fac4..a093979 100644
--- a/net/netfilter/nf_nat_sip.c
+++ b/net/netfilter/nf_nat_sip.c
@@ -48,7 +48,7 @@  static unsigned int mangle_packet(struct sk_buff *skb, unsigned int protoff,
 		if (!__nf_nat_mangle_tcp_packet(skb, ct, ctinfo,
 						protoff, matchoff, matchlen,
 						buffer, buflen, false))
-			return 0;
+			return NF_DROP;
 	} else {
 		baseoff = protoff + sizeof(struct udphdr);
 		matchoff += dataoff - baseoff;
@@ -56,13 +56,13 @@  static unsigned int mangle_packet(struct sk_buff *skb, unsigned int protoff,
 		if (!nf_nat_mangle_udp_packet(skb, ct, ctinfo,
 					      protoff, matchoff, matchlen,
 					      buffer, buflen))
-			return 0;
+			return NF_DROP;
 	}
 
 	/* Reload data pointer and adjust datalen value */
 	*dptr = skb->data + dataoff;
 	*datalen += buflen - matchlen;
-	return 1;
+	return NF_ACCEPT;
 }
 
 static int sip_sprintf_addr(const struct nf_conn *ct, char *buffer,