summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorGao Feng2016-08-25 17:08:11 +0200
committerPablo Neira Ayuso2016-09-07 10:36:48 +0200
commitecc6569f3503b39f45bc6b86197b5e0a8533fb72 (patch)
treef68eb9aa077ba7a78d0f2187becbf17105eff14f /net
parentptp: ixp46x: remove NO_IRQ handling (diff)
downloadkernel-qcow2-linux-ecc6569f3503b39f45bc6b86197b5e0a8533fb72.tar.gz
kernel-qcow2-linux-ecc6569f3503b39f45bc6b86197b5e0a8533fb72.tar.xz
kernel-qcow2-linux-ecc6569f3503b39f45bc6b86197b5e0a8533fb72.zip
netfilter: gre: Use consistent GRE_* macros instead of ones defined by netfilter.
There are already some GRE_* macros in kernel, so it is unnecessary to define these macros. And remove some useless macros Signed-off-by: Gao Feng <fgao@ikuai8.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/netfilter/nf_nat_proto_gre.c4
-rw-r--r--net/netfilter/nf_conntrack_proto_gre.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/netfilter/nf_nat_proto_gre.c b/net/ipv4/netfilter/nf_nat_proto_gre.c
index 9414923f1e15..93198d71dbb6 100644
--- a/net/ipv4/netfilter/nf_nat_proto_gre.c
+++ b/net/ipv4/netfilter/nf_nat_proto_gre.c
@@ -104,11 +104,11 @@ gre_manip_pkt(struct sk_buff *skb,
if (maniptype != NF_NAT_MANIP_DST)
return true;
switch (greh->version) {
- case GRE_VERSION_1701:
+ case ntohs(GRE_VERSION_0):
/* We do not currently NAT any GREv0 packets.
* Try to behave like "nf_nat_proto_unknown" */
break;
- case GRE_VERSION_PPTP:
+ case ntohs(GRE_VERSION_1):
pr_debug("call_id -> 0x%04x\n", ntohs(tuple->dst.u.gre.key));
pgreh->call_id = tuple->dst.u.gre.key;
break;
diff --git a/net/netfilter/nf_conntrack_proto_gre.c b/net/netfilter/nf_conntrack_proto_gre.c
index a96451a7af20..deb239a014e4 100644
--- a/net/netfilter/nf_conntrack_proto_gre.c
+++ b/net/netfilter/nf_conntrack_proto_gre.c
@@ -200,7 +200,7 @@ static bool gre_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff,
/* first only delinearize old RFC1701 GRE header */
grehdr = skb_header_pointer(skb, dataoff, sizeof(_grehdr), &_grehdr);
- if (!grehdr || grehdr->version != GRE_VERSION_PPTP) {
+ if (!grehdr || grehdr->version != ntohs(GRE_VERSION_1)) {
/* try to behave like "nf_conntrack_proto_generic" */
tuple->src.u.all = 0;
tuple->dst.u.all = 0;
@@ -212,7 +212,7 @@ static bool gre_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff,
if (!pgrehdr)
return true;
- if (ntohs(grehdr->protocol) != GRE_PROTOCOL_PPTP) {
+ if (grehdr->protocol != GRE_PROTO_PPP) {
pr_debug("GRE_VERSION_PPTP but unknown proto\n");
return false;
}