| @@ -206,16 +206,14 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb) · 205 unmodified lines |
| 206 | 206 | skb_push(skb, header_len); |
| 207 | 207 | hdr = (struct pptp_gre_header *)(skb->data); |
| 208 | 208 | |
| 209 | | − hdr->flags = PPTP_GRE_FLAG_K; |
| 210 | | − hdr->ver = PPTP_GRE_VER; |
| 211 | | − hdr->protocol = htons(PPTP_GRE_PROTO); |
| 212 | | − hdr->call_id = htons(opt->dst_addr.call_id); |
| 209 | + hdr->gre_hd.flags = GRE_KEY | GRE_VERSION_1 | GRE_SEQ; |
| 210 | + hdr->gre_hd.protocol = GRE_PROTO_PPP; |
| 211 | + hdr->call_id = htons(opt->dst_addr.call_id); |
| 213 | 212 | |
| 214 | | − hdr->flags |= PPTP_GRE_FLAG_S; |
| 215 | | − hdr->seq = htonl(++opt->seq_sent); |
| 213 | + hdr->seq = htonl(++opt->seq_sent); |
| 216 | 214 | if (opt->ack_sent != seq_recv) { |
| 217 | 215 | /* send ack with this message */ |
| 218 | | − hdr->ver |= PPTP_GRE_FLAG_A; |
| 216 | + hdr->gre_hd.flags |= GRE_ACK; |
| 219 | 217 | hdr->ack = htonl(seq_recv); |
| 220 | 218 | opt->ack_sent = seq_recv; |
| 221 | 219 | } |
| @@ -278,7 +276,7 @@ static int pptp_rcv_core(struct sock *sk, struct sk_buff *skb) · 56 unmodified lines |
| 278 | 276 | headersize = sizeof(*header); |
| 279 | 277 | |
| 280 | 278 | /* test if acknowledgement present */ |
| 281 | | − if (PPTP_GRE_IS_A(header->ver)) { |
| 279 | + if (GRE_IS_ACK(header->gre_hd.flags)) { |
| 282 | 280 | __u32 ack; |
| 283 | 281 | |
| 284 | 282 | if (!pskb_may_pull(skb, headersize)) |
| @@ -286,7 +284,7 @@ static int pptp_rcv_core(struct sock *sk, struct sk_buff *skb) · 1 unmodified line |
| 286 | 284 | header = (struct pptp_gre_header *)(skb->data); |
| 287 | 285 | |
| 288 | 286 | /* ack in different place if S = 0 */ |
| 289 | | − ack = PPTP_GRE_IS_S(header->flags) ? header->ack : header->seq; |
| 287 | + ack = GRE_IS_SEQ(header->gre_hd.flags) ? header->ack : header->seq; |
| 290 | 288 | |
| 291 | 289 | ack = ntohl(ack); |
| 292 | 290 | |
| @@ -299,7 +297,7 @@ static int pptp_rcv_core(struct sock *sk, struct sk_buff *skb) · 6 unmodified lines |
| 299 | 297 | headersize -= sizeof(header->ack); |
| 300 | 298 | } |
| 301 | 299 | /* test if payload present */ |
| 302 | | − if (!PPTP_GRE_IS_S(header->flags)) |
| 300 | + if (!GRE_IS_SEQ(header->gre_hd.flags)) |
| 303 | 301 | goto drop; |
| 304 | 302 | |
| 305 | 303 | payload_len = ntohs(header->payload_len); |
| @@ -360,11 +358,11 @@ static int pptp_rcv(struct sk_buff *skb) · 54 unmodified lines |
| 360 | 358 | |
| 361 | 359 | header = (struct pptp_gre_header *)skb->data; |
| 362 | 360 | |
| 363 | | − if (ntohs(header->protocol) != PPTP_GRE_PROTO || /* PPTP-GRE protocol for PPTP */ |
| 364 | | − PPTP_GRE_IS_C(header->flags) || /* flag C should be clear */ |
| 365 | | − PPTP_GRE_IS_R(header->flags) || /* flag R should be clear */ |
| 366 | | − !PPTP_GRE_IS_K(header->flags) || /* flag K should be set */ |
| 367 | | − (header->flags&0xF) != 0) /* routing and recursion ctrl = 0 */ |
| 361 | + if (header->gre_hd.protocol != GRE_PROTO_PPP || /* PPTP-GRE protocol for PPTP */ |
| 362 | + GRE_IS_CSUM(header->gre_hd.flags) || /* flag CSUM should be clear */ |
| 363 | + GRE_IS_ROUTING(header->gre_hd.flags) || /* flag ROUTING should be clear */ |
| 364 | + !GRE_IS_KEY(header->gre_hd.flags) || /* flag KEY should be set */ |
| 365 | + (header->gre_hd.flags & GRE_FLAGS)) /* flag Recursion Ctrl should be clear */ |
| 368 | 366 | /* if invalid, discard this packet */ |
| 369 | 367 | goto drop; |
| 370 | 368 | |