2 * Connection tracking support for PPTP (Point to Point Tunneling Protocol).
3 * PPTP is a a protocol for creating virtual private networks.
4 * It is a specification defined by Microsoft and some vendors
5 * working with Microsoft. PPTP is built on top of a modified
6 * version of the Internet Generic Routing Encapsulation Protocol.
7 * GRE is defined in RFC 1701 and RFC 1702. Documentation of
8 * PPTP can be found in RFC 2637
10 * (C) 2000-2005 by Harald Welte <laforge@gnumonks.org>
12 * Development of this code funded by Astaro AG (http://www.astaro.com/)
15 * - We blindly assume that control connections are always
16 * established in PNS->PAC direction. This is a violation
18 * - We can only support one single call within each session
20 * - testing of incoming PPTP calls
23 #include <linux/module.h>
24 #include <linux/skbuff.h>
26 #include <linux/tcp.h>
28 #include <net/netfilter/nf_conntrack.h>
29 #include <net/netfilter/nf_conntrack_core.h>
30 #include <net/netfilter/nf_conntrack_helper.h>
31 #include <net/netfilter/nf_conntrack_zones.h>
32 #include <linux/netfilter/nf_conntrack_proto_gre.h>
33 #include <linux/netfilter/nf_conntrack_pptp.h>
35 #define NF_CT_PPTP_VERSION "3.1"
37 MODULE_LICENSE("GPL");
38 MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>");
39 MODULE_DESCRIPTION("Netfilter connection tracking helper module for PPTP");
40 MODULE_ALIAS("ip_conntrack_pptp");
41 MODULE_ALIAS_NFCT_HELPER("pptp");
43 static DEFINE_SPINLOCK(nf_pptp_lock
);
46 (*nf_nat_pptp_hook_outbound
)(struct sk_buff
*skb
,
47 struct nf_conn
*ct
, enum ip_conntrack_info ctinfo
,
48 struct PptpControlHeader
*ctlh
,
49 union pptp_ctrl_union
*pptpReq
) __read_mostly
;
50 EXPORT_SYMBOL_GPL(nf_nat_pptp_hook_outbound
);
53 (*nf_nat_pptp_hook_inbound
)(struct sk_buff
*skb
,
54 struct nf_conn
*ct
, enum ip_conntrack_info ctinfo
,
55 struct PptpControlHeader
*ctlh
,
56 union pptp_ctrl_union
*pptpReq
) __read_mostly
;
57 EXPORT_SYMBOL_GPL(nf_nat_pptp_hook_inbound
);
60 (*nf_nat_pptp_hook_exp_gre
)(struct nf_conntrack_expect
*expect_orig
,
61 struct nf_conntrack_expect
*expect_reply
)
63 EXPORT_SYMBOL_GPL(nf_nat_pptp_hook_exp_gre
);
66 (*nf_nat_pptp_hook_expectfn
)(struct nf_conn
*ct
,
67 struct nf_conntrack_expect
*exp
) __read_mostly
;
68 EXPORT_SYMBOL_GPL(nf_nat_pptp_hook_expectfn
);
70 #if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
71 /* PptpControlMessageType names */
72 const char *const pptp_msg_name
[] = {
74 "START_SESSION_REQUEST",
75 "START_SESSION_REPLY",
76 "STOP_SESSION_REQUEST",
86 "CALL_DISCONNECT_NOTIFY",
90 EXPORT_SYMBOL(pptp_msg_name
);
94 #define MINS * 60 SECS
95 #define HOURS * 60 MINS
97 #define PPTP_GRE_TIMEOUT (10 MINS)
98 #define PPTP_GRE_STREAM_TIMEOUT (5 HOURS)
100 static void pptp_expectfn(struct nf_conn
*ct
,
101 struct nf_conntrack_expect
*exp
)
103 struct net
*net
= nf_ct_net(ct
);
104 typeof(nf_nat_pptp_hook_expectfn
) nf_nat_pptp_expectfn
;
105 pr_debug("increasing timeouts\n");
107 /* increase timeout of GRE data channel conntrack entry */
108 ct
->proto
.gre
.timeout
= PPTP_GRE_TIMEOUT
;
109 ct
->proto
.gre
.stream_timeout
= PPTP_GRE_STREAM_TIMEOUT
;
111 /* Can you see how rusty this code is, compared with the pre-2.6.11
112 * one? That's what happened to my shiny newnat of 2002 ;( -HW */
115 nf_nat_pptp_expectfn
= rcu_dereference(nf_nat_pptp_hook_expectfn
);
116 if (nf_nat_pptp_expectfn
&& ct
->master
->status
& IPS_NAT_MASK
)
117 nf_nat_pptp_expectfn(ct
, exp
);
119 struct nf_conntrack_tuple inv_t
;
120 struct nf_conntrack_expect
*exp_other
;
122 /* obviously this tuple inversion only works until you do NAT */
123 nf_ct_invert_tuplepr(&inv_t
, &exp
->tuple
);
124 pr_debug("trying to unexpect other dir: ");
125 nf_ct_dump_tuple(&inv_t
);
127 exp_other
= nf_ct_expect_find_get(net
, nf_ct_zone(ct
), &inv_t
);
129 /* delete other expectation. */
131 nf_ct_unexpect_related(exp_other
);
132 nf_ct_expect_put(exp_other
);
134 pr_debug("not found\n");
140 static int destroy_sibling_or_exp(struct net
*net
, struct nf_conn
*ct
,
141 const struct nf_conntrack_tuple
*t
)
143 const struct nf_conntrack_tuple_hash
*h
;
144 struct nf_conntrack_expect
*exp
;
145 struct nf_conn
*sibling
;
146 u16 zone
= nf_ct_zone(ct
);
148 pr_debug("trying to timeout ct or exp for tuple ");
151 h
= nf_conntrack_find_get(net
, zone
, t
);
153 sibling
= nf_ct_tuplehash_to_ctrack(h
);
154 pr_debug("setting timeout of conntrack %p to 0\n", sibling
);
155 sibling
->proto
.gre
.timeout
= 0;
156 sibling
->proto
.gre
.stream_timeout
= 0;
157 if (del_timer(&sibling
->timeout
))
158 sibling
->timeout
.function((unsigned long)sibling
);
162 exp
= nf_ct_expect_find_get(net
, zone
, t
);
164 pr_debug("unexpect_related of expect %p\n", exp
);
165 nf_ct_unexpect_related(exp
);
166 nf_ct_expect_put(exp
);
173 /* timeout GRE data connections */
174 static void pptp_destroy_siblings(struct nf_conn
*ct
)
176 struct net
*net
= nf_ct_net(ct
);
177 const struct nf_conn_help
*help
= nfct_help(ct
);
178 struct nf_conntrack_tuple t
;
180 nf_ct_gre_keymap_destroy(ct
);
182 /* try original (pns->pac) tuple */
183 memcpy(&t
, &ct
->tuplehash
[IP_CT_DIR_ORIGINAL
].tuple
, sizeof(t
));
184 t
.dst
.protonum
= IPPROTO_GRE
;
185 t
.src
.u
.gre
.key
= help
->help
.ct_pptp_info
.pns_call_id
;
186 t
.dst
.u
.gre
.key
= help
->help
.ct_pptp_info
.pac_call_id
;
187 if (!destroy_sibling_or_exp(net
, ct
, &t
))
188 pr_debug("failed to timeout original pns->pac ct/exp\n");
190 /* try reply (pac->pns) tuple */
191 memcpy(&t
, &ct
->tuplehash
[IP_CT_DIR_REPLY
].tuple
, sizeof(t
));
192 t
.dst
.protonum
= IPPROTO_GRE
;
193 t
.src
.u
.gre
.key
= help
->help
.ct_pptp_info
.pac_call_id
;
194 t
.dst
.u
.gre
.key
= help
->help
.ct_pptp_info
.pns_call_id
;
195 if (!destroy_sibling_or_exp(net
, ct
, &t
))
196 pr_debug("failed to timeout reply pac->pns ct/exp\n");
199 /* expect GRE connections (PNS->PAC and PAC->PNS direction) */
200 static int exp_gre(struct nf_conn
*ct
, __be16 callid
, __be16 peer_callid
)
202 struct nf_conntrack_expect
*exp_orig
, *exp_reply
;
203 enum ip_conntrack_dir dir
;
205 typeof(nf_nat_pptp_hook_exp_gre
) nf_nat_pptp_exp_gre
;
207 exp_orig
= nf_ct_expect_alloc(ct
);
208 if (exp_orig
== NULL
)
211 exp_reply
= nf_ct_expect_alloc(ct
);
212 if (exp_reply
== NULL
)
215 /* original direction, PNS->PAC */
216 dir
= IP_CT_DIR_ORIGINAL
;
217 nf_ct_expect_init(exp_orig
, NF_CT_EXPECT_CLASS_DEFAULT
,
219 &ct
->tuplehash
[dir
].tuple
.src
.u3
,
220 &ct
->tuplehash
[dir
].tuple
.dst
.u3
,
221 IPPROTO_GRE
, &peer_callid
, &callid
);
222 exp_orig
->expectfn
= pptp_expectfn
;
224 /* reply direction, PAC->PNS */
225 dir
= IP_CT_DIR_REPLY
;
226 nf_ct_expect_init(exp_reply
, NF_CT_EXPECT_CLASS_DEFAULT
,
228 &ct
->tuplehash
[dir
].tuple
.src
.u3
,
229 &ct
->tuplehash
[dir
].tuple
.dst
.u3
,
230 IPPROTO_GRE
, &callid
, &peer_callid
);
231 exp_reply
->expectfn
= pptp_expectfn
;
233 nf_nat_pptp_exp_gre
= rcu_dereference(nf_nat_pptp_hook_exp_gre
);
234 if (nf_nat_pptp_exp_gre
&& ct
->status
& IPS_NAT_MASK
)
235 nf_nat_pptp_exp_gre(exp_orig
, exp_reply
);
236 if (nf_ct_expect_related(exp_orig
) != 0)
238 if (nf_ct_expect_related(exp_reply
) != 0)
239 goto out_unexpect_orig
;
241 /* Add GRE keymap entries */
242 if (nf_ct_gre_keymap_add(ct
, IP_CT_DIR_ORIGINAL
, &exp_orig
->tuple
) != 0)
243 goto out_unexpect_both
;
244 if (nf_ct_gre_keymap_add(ct
, IP_CT_DIR_REPLY
, &exp_reply
->tuple
) != 0) {
245 nf_ct_gre_keymap_destroy(ct
);
246 goto out_unexpect_both
;
251 nf_ct_expect_put(exp_reply
);
253 nf_ct_expect_put(exp_orig
);
258 nf_ct_unexpect_related(exp_reply
);
260 nf_ct_unexpect_related(exp_orig
);
265 pptp_inbound_pkt(struct sk_buff
*skb
,
266 struct PptpControlHeader
*ctlh
,
267 union pptp_ctrl_union
*pptpReq
,
270 enum ip_conntrack_info ctinfo
)
272 struct nf_ct_pptp_master
*info
= &nfct_help(ct
)->help
.ct_pptp_info
;
274 __be16 cid
= 0, pcid
= 0;
275 typeof(nf_nat_pptp_hook_inbound
) nf_nat_pptp_inbound
;
277 msg
= ntohs(ctlh
->messageType
);
278 pr_debug("inbound control message %s\n", pptp_msg_name
[msg
]);
281 case PPTP_START_SESSION_REPLY
:
282 /* server confirms new control session */
283 if (info
->sstate
< PPTP_SESSION_REQUESTED
)
285 if (pptpReq
->srep
.resultCode
== PPTP_START_OK
)
286 info
->sstate
= PPTP_SESSION_CONFIRMED
;
288 info
->sstate
= PPTP_SESSION_ERROR
;
291 case PPTP_STOP_SESSION_REPLY
:
292 /* server confirms end of control session */
293 if (info
->sstate
> PPTP_SESSION_STOPREQ
)
295 if (pptpReq
->strep
.resultCode
== PPTP_STOP_OK
)
296 info
->sstate
= PPTP_SESSION_NONE
;
298 info
->sstate
= PPTP_SESSION_ERROR
;
301 case PPTP_OUT_CALL_REPLY
:
302 /* server accepted call, we now expect GRE frames */
303 if (info
->sstate
!= PPTP_SESSION_CONFIRMED
)
305 if (info
->cstate
!= PPTP_CALL_OUT_REQ
&&
306 info
->cstate
!= PPTP_CALL_OUT_CONF
)
309 cid
= pptpReq
->ocack
.callID
;
310 pcid
= pptpReq
->ocack
.peersCallID
;
311 if (info
->pns_call_id
!= pcid
)
313 pr_debug("%s, CID=%X, PCID=%X\n", pptp_msg_name
[msg
],
314 ntohs(cid
), ntohs(pcid
));
316 if (pptpReq
->ocack
.resultCode
== PPTP_OUTCALL_CONNECT
) {
317 info
->cstate
= PPTP_CALL_OUT_CONF
;
318 info
->pac_call_id
= cid
;
319 exp_gre(ct
, cid
, pcid
);
321 info
->cstate
= PPTP_CALL_NONE
;
324 case PPTP_IN_CALL_REQUEST
:
325 /* server tells us about incoming call request */
326 if (info
->sstate
!= PPTP_SESSION_CONFIRMED
)
329 cid
= pptpReq
->icreq
.callID
;
330 pr_debug("%s, CID=%X\n", pptp_msg_name
[msg
], ntohs(cid
));
331 info
->cstate
= PPTP_CALL_IN_REQ
;
332 info
->pac_call_id
= cid
;
335 case PPTP_IN_CALL_CONNECT
:
336 /* server tells us about incoming call established */
337 if (info
->sstate
!= PPTP_SESSION_CONFIRMED
)
339 if (info
->cstate
!= PPTP_CALL_IN_REP
&&
340 info
->cstate
!= PPTP_CALL_IN_CONF
)
343 pcid
= pptpReq
->iccon
.peersCallID
;
344 cid
= info
->pac_call_id
;
346 if (info
->pns_call_id
!= pcid
)
349 pr_debug("%s, PCID=%X\n", pptp_msg_name
[msg
], ntohs(pcid
));
350 info
->cstate
= PPTP_CALL_IN_CONF
;
352 /* we expect a GRE connection from PAC to PNS */
353 exp_gre(ct
, cid
, pcid
);
356 case PPTP_CALL_DISCONNECT_NOTIFY
:
357 /* server confirms disconnect */
358 cid
= pptpReq
->disc
.callID
;
359 pr_debug("%s, CID=%X\n", pptp_msg_name
[msg
], ntohs(cid
));
360 info
->cstate
= PPTP_CALL_NONE
;
362 /* untrack this call id, unexpect GRE packets */
363 pptp_destroy_siblings(ct
);
366 case PPTP_WAN_ERROR_NOTIFY
:
367 case PPTP_SET_LINK_INFO
:
368 case PPTP_ECHO_REQUEST
:
369 case PPTP_ECHO_REPLY
:
370 /* I don't have to explain these ;) */
377 nf_nat_pptp_inbound
= rcu_dereference(nf_nat_pptp_hook_inbound
);
378 if (nf_nat_pptp_inbound
&& ct
->status
& IPS_NAT_MASK
)
379 return nf_nat_pptp_inbound(skb
, ct
, ctinfo
, ctlh
, pptpReq
);
383 pr_debug("invalid %s: type=%d cid=%u pcid=%u "
384 "cstate=%d sstate=%d pns_cid=%u pac_cid=%u\n",
385 msg
<= PPTP_MSG_MAX
? pptp_msg_name
[msg
] : pptp_msg_name
[0],
386 msg
, ntohs(cid
), ntohs(pcid
), info
->cstate
, info
->sstate
,
387 ntohs(info
->pns_call_id
), ntohs(info
->pac_call_id
));
392 pptp_outbound_pkt(struct sk_buff
*skb
,
393 struct PptpControlHeader
*ctlh
,
394 union pptp_ctrl_union
*pptpReq
,
397 enum ip_conntrack_info ctinfo
)
399 struct nf_ct_pptp_master
*info
= &nfct_help(ct
)->help
.ct_pptp_info
;
401 __be16 cid
= 0, pcid
= 0;
402 typeof(nf_nat_pptp_hook_outbound
) nf_nat_pptp_outbound
;
404 msg
= ntohs(ctlh
->messageType
);
405 pr_debug("outbound control message %s\n", pptp_msg_name
[msg
]);
408 case PPTP_START_SESSION_REQUEST
:
409 /* client requests for new control session */
410 if (info
->sstate
!= PPTP_SESSION_NONE
)
412 info
->sstate
= PPTP_SESSION_REQUESTED
;
415 case PPTP_STOP_SESSION_REQUEST
:
416 /* client requests end of control session */
417 info
->sstate
= PPTP_SESSION_STOPREQ
;
420 case PPTP_OUT_CALL_REQUEST
:
421 /* client initiating connection to server */
422 if (info
->sstate
!= PPTP_SESSION_CONFIRMED
)
424 info
->cstate
= PPTP_CALL_OUT_REQ
;
425 /* track PNS call id */
426 cid
= pptpReq
->ocreq
.callID
;
427 pr_debug("%s, CID=%X\n", pptp_msg_name
[msg
], ntohs(cid
));
428 info
->pns_call_id
= cid
;
431 case PPTP_IN_CALL_REPLY
:
432 /* client answers incoming call */
433 if (info
->cstate
!= PPTP_CALL_IN_REQ
&&
434 info
->cstate
!= PPTP_CALL_IN_REP
)
437 cid
= pptpReq
->icack
.callID
;
438 pcid
= pptpReq
->icack
.peersCallID
;
439 if (info
->pac_call_id
!= pcid
)
441 pr_debug("%s, CID=%X PCID=%X\n", pptp_msg_name
[msg
],
442 ntohs(cid
), ntohs(pcid
));
444 if (pptpReq
->icack
.resultCode
== PPTP_INCALL_ACCEPT
) {
445 /* part two of the three-way handshake */
446 info
->cstate
= PPTP_CALL_IN_REP
;
447 info
->pns_call_id
= cid
;
449 info
->cstate
= PPTP_CALL_NONE
;
452 case PPTP_CALL_CLEAR_REQUEST
:
453 /* client requests hangup of call */
454 if (info
->sstate
!= PPTP_SESSION_CONFIRMED
)
456 /* FUTURE: iterate over all calls and check if
457 * call ID is valid. We don't do this without newnat,
458 * because we only know about last call */
459 info
->cstate
= PPTP_CALL_CLEAR_REQ
;
462 case PPTP_SET_LINK_INFO
:
463 case PPTP_ECHO_REQUEST
:
464 case PPTP_ECHO_REPLY
:
465 /* I don't have to explain these ;) */
472 nf_nat_pptp_outbound
= rcu_dereference(nf_nat_pptp_hook_outbound
);
473 if (nf_nat_pptp_outbound
&& ct
->status
& IPS_NAT_MASK
)
474 return nf_nat_pptp_outbound(skb
, ct
, ctinfo
, ctlh
, pptpReq
);
478 pr_debug("invalid %s: type=%d cid=%u pcid=%u "
479 "cstate=%d sstate=%d pns_cid=%u pac_cid=%u\n",
480 msg
<= PPTP_MSG_MAX
? pptp_msg_name
[msg
] : pptp_msg_name
[0],
481 msg
, ntohs(cid
), ntohs(pcid
), info
->cstate
, info
->sstate
,
482 ntohs(info
->pns_call_id
), ntohs(info
->pac_call_id
));
486 static const unsigned int pptp_msg_size
[] = {
487 [PPTP_START_SESSION_REQUEST
] = sizeof(struct PptpStartSessionRequest
),
488 [PPTP_START_SESSION_REPLY
] = sizeof(struct PptpStartSessionReply
),
489 [PPTP_STOP_SESSION_REQUEST
] = sizeof(struct PptpStopSessionRequest
),
490 [PPTP_STOP_SESSION_REPLY
] = sizeof(struct PptpStopSessionReply
),
491 [PPTP_OUT_CALL_REQUEST
] = sizeof(struct PptpOutCallRequest
),
492 [PPTP_OUT_CALL_REPLY
] = sizeof(struct PptpOutCallReply
),
493 [PPTP_IN_CALL_REQUEST
] = sizeof(struct PptpInCallRequest
),
494 [PPTP_IN_CALL_REPLY
] = sizeof(struct PptpInCallReply
),
495 [PPTP_IN_CALL_CONNECT
] = sizeof(struct PptpInCallConnected
),
496 [PPTP_CALL_CLEAR_REQUEST
] = sizeof(struct PptpClearCallRequest
),
497 [PPTP_CALL_DISCONNECT_NOTIFY
] = sizeof(struct PptpCallDisconnectNotify
),
498 [PPTP_WAN_ERROR_NOTIFY
] = sizeof(struct PptpWanErrorNotify
),
499 [PPTP_SET_LINK_INFO
] = sizeof(struct PptpSetLinkInfo
),
502 /* track caller id inside control connection, call expect_related */
504 conntrack_pptp_help(struct sk_buff
*skb
, unsigned int protoff
,
505 struct nf_conn
*ct
, enum ip_conntrack_info ctinfo
)
508 int dir
= CTINFO2DIR(ctinfo
);
509 const struct nf_ct_pptp_master
*info
= &nfct_help(ct
)->help
.ct_pptp_info
;
510 const struct tcphdr
*tcph
;
512 const struct pptp_pkt_hdr
*pptph
;
513 struct pptp_pkt_hdr _pptph
;
514 struct PptpControlHeader _ctlh
, *ctlh
;
515 union pptp_ctrl_union _pptpReq
, *pptpReq
;
516 unsigned int tcplen
= skb
->len
- protoff
;
517 unsigned int datalen
, reqlen
, nexthdr_off
;
518 int oldsstate
, oldcstate
;
522 /* don't do any tracking before tcp handshake complete */
523 if (ctinfo
!= IP_CT_ESTABLISHED
&& ctinfo
!= IP_CT_ESTABLISHED_REPLY
)
526 nexthdr_off
= protoff
;
527 tcph
= skb_header_pointer(skb
, nexthdr_off
, sizeof(_tcph
), &_tcph
);
529 nexthdr_off
+= tcph
->doff
* 4;
530 datalen
= tcplen
- tcph
->doff
* 4;
532 pptph
= skb_header_pointer(skb
, nexthdr_off
, sizeof(_pptph
), &_pptph
);
534 pr_debug("no full PPTP header, can't track\n");
537 nexthdr_off
+= sizeof(_pptph
);
538 datalen
-= sizeof(_pptph
);
540 /* if it's not a control message we can't do anything with it */
541 if (ntohs(pptph
->packetType
) != PPTP_PACKET_CONTROL
||
542 ntohl(pptph
->magicCookie
) != PPTP_MAGIC_COOKIE
) {
543 pr_debug("not a control packet\n");
547 ctlh
= skb_header_pointer(skb
, nexthdr_off
, sizeof(_ctlh
), &_ctlh
);
550 nexthdr_off
+= sizeof(_ctlh
);
551 datalen
-= sizeof(_ctlh
);
554 msg
= ntohs(ctlh
->messageType
);
555 if (msg
> 0 && msg
<= PPTP_MSG_MAX
&& reqlen
< pptp_msg_size
[msg
])
557 if (reqlen
> sizeof(*pptpReq
))
558 reqlen
= sizeof(*pptpReq
);
560 pptpReq
= skb_header_pointer(skb
, nexthdr_off
, reqlen
, &_pptpReq
);
564 oldsstate
= info
->sstate
;
565 oldcstate
= info
->cstate
;
567 spin_lock_bh(&nf_pptp_lock
);
569 /* FIXME: We just blindly assume that the control connection is always
570 * established from PNS->PAC. However, RFC makes no guarantee */
571 if (dir
== IP_CT_DIR_ORIGINAL
)
572 /* client -> server (PNS -> PAC) */
573 ret
= pptp_outbound_pkt(skb
, ctlh
, pptpReq
, reqlen
, ct
,
576 /* server -> client (PAC -> PNS) */
577 ret
= pptp_inbound_pkt(skb
, ctlh
, pptpReq
, reqlen
, ct
,
579 pr_debug("sstate: %d->%d, cstate: %d->%d\n",
580 oldsstate
, info
->sstate
, oldcstate
, info
->cstate
);
581 spin_unlock_bh(&nf_pptp_lock
);
586 static const struct nf_conntrack_expect_policy pptp_exp_policy
= {
591 /* control protocol helper */
592 static struct nf_conntrack_helper pptp __read_mostly
= {
595 .tuple
.src
.l3num
= AF_INET
,
596 .tuple
.src
.u
.tcp
.port
= cpu_to_be16(PPTP_CONTROL_PORT
),
597 .tuple
.dst
.protonum
= IPPROTO_TCP
,
598 .help
= conntrack_pptp_help
,
599 .destroy
= pptp_destroy_siblings
,
600 .expect_policy
= &pptp_exp_policy
,
603 static void nf_conntrack_pptp_net_exit(struct net
*net
)
605 nf_ct_gre_keymap_flush(net
);
608 static struct pernet_operations nf_conntrack_pptp_net_ops
= {
609 .exit
= nf_conntrack_pptp_net_exit
,
612 static int __init
nf_conntrack_pptp_init(void)
616 rv
= nf_conntrack_helper_register(&pptp
);
619 rv
= register_pernet_subsys(&nf_conntrack_pptp_net_ops
);
621 nf_conntrack_helper_unregister(&pptp
);
625 static void __exit
nf_conntrack_pptp_fini(void)
627 nf_conntrack_helper_unregister(&pptp
);
628 unregister_pernet_subsys(&nf_conntrack_pptp_net_ops
);
631 module_init(nf_conntrack_pptp_init
);
632 module_exit(nf_conntrack_pptp_fini
);