/* gre hdr info to tuple */ boolgre_pkt_to_tuple(conststruct sk_buff *skb, unsignedint dataoff, struct net *net, struct nf_conntrack_tuple *tuple) { conststructpptp_gre_header *pgrehdr; structpptp_gre_header _pgrehdr; __be16 srckey; conststructgre_base_hdr *grehdr; structgre_base_hdr _grehdr;
/* first only delinearize old RFC1701 GRE header */ grehdr = skb_header_pointer(skb, dataoff, sizeof(_grehdr), &_grehdr); if (!grehdr || (grehdr->flags & GRE_VERSION) != GRE_VERSION_1) { /* try to behave like "nf_conntrack_proto_generic" */ tuple->src.u.all = 0; tuple->dst.u.all = 0; returntrue; }
/* PPTP header is variable length, only need up to the call_id field */ pgrehdr = skb_header_pointer(skb, dataoff, 8, &_pgrehdr); if (!pgrehdr) returntrue;
if (grehdr->protocol != GRE_PROTO_PPP) { pr_debug("Unsupported GRE proto(0x%x)\n", ntohs(grehdr->protocol)); returnfalse; }
This document specifies GRE version number 0. GRE version number 1 is used by PPTP [RFC2637]. Additional GRE version numbers are assigned by IETF Consensus as defined in RFC 2434 [RFC2434].