aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_gre.c
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2010-08-22 02:05:39 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-22 02:05:39 -0400
commit00959ade36acadc00e757f87060bf6e4501d545f (patch)
tree9bfe790d4a8b63b0e6653388da73dfd777eea8ff /net/ipv4/ip_gre.c
parent1003489e06c04d807c783a8958f2ccc9aed7a244 (diff)
PPTP: PPP over IPv4 (Point-to-Point Tunneling Protocol)
PPP: introduce "pptp" module which implements point-to-point tunneling protocol using pppox framework NET: introduce the "gre" module for demultiplexing GRE packets on version criteria (required to pptp and ip_gre may coexists) NET: ip_gre: update to use the "gre" module This patch introduces then pptp support to the linux kernel which dramatically speeds up pptp vpn connections and decreases cpu usage in comparison of existing user-space implementation (poptop/pptpclient). There is accel-pptp project (https://sourceforge.net/projects/accel-pptp/) to utilize this module, it contains plugin for pppd to use pptp in client-mode and modified pptpd (poptop) to build high-performance pptp NAS. There was many changes from initial submitted patch, most important are: 1. using rcu instead of read-write locks 2. using static bitmap instead of dynamically allocated 3. using vmalloc for memory allocation instead of BITS_PER_LONG + __get_free_pages 4. fixed many coding style issues Thanks to Eric Dumazet. Signed-off-by: Dmitry Kozlov <xeb@mail.ru> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_gre.c')
-rw-r--r--net/ipv4/ip_gre.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 945b20a5ad50..85176895495a 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -44,6 +44,7 @@
44#include <net/net_namespace.h> 44#include <net/net_namespace.h>
45#include <net/netns/generic.h> 45#include <net/netns/generic.h>
46#include <net/rtnetlink.h> 46#include <net/rtnetlink.h>
47#include <net/gre.h>
47 48
48#ifdef CONFIG_IPV6 49#ifdef CONFIG_IPV6
49#include <net/ipv6.h> 50#include <net/ipv6.h>
@@ -1278,10 +1279,9 @@ static void ipgre_fb_tunnel_init(struct net_device *dev)
1278} 1279}
1279 1280
1280 1281
1281static const struct net_protocol ipgre_protocol = { 1282static const struct gre_protocol ipgre_protocol = {
1282 .handler = ipgre_rcv, 1283 .handler = ipgre_rcv,
1283 .err_handler = ipgre_err, 1284 .err_handler = ipgre_err,
1284 .netns_ok = 1,
1285}; 1285};
1286 1286
1287static void ipgre_destroy_tunnels(struct ipgre_net *ign, struct list_head *head) 1287static void ipgre_destroy_tunnels(struct ipgre_net *ign, struct list_head *head)
@@ -1663,7 +1663,7 @@ static int __init ipgre_init(void)
1663 if (err < 0) 1663 if (err < 0)
1664 return err; 1664 return err;
1665 1665
1666 err = inet_add_protocol(&ipgre_protocol, IPPROTO_GRE); 1666 err = gre_add_protocol(&ipgre_protocol, GREPROTO_CISCO);
1667 if (err < 0) { 1667 if (err < 0) {
1668 printk(KERN_INFO "ipgre init: can't add protocol\n"); 1668 printk(KERN_INFO "ipgre init: can't add protocol\n");
1669 goto add_proto_failed; 1669 goto add_proto_failed;
@@ -1683,7 +1683,7 @@ out:
1683tap_ops_failed: 1683tap_ops_failed:
1684 rtnl_link_unregister(&ipgre_link_ops); 1684 rtnl_link_unregister(&ipgre_link_ops);
1685rtnl_link_failed: 1685rtnl_link_failed:
1686 inet_del_protocol(&ipgre_protocol, IPPROTO_GRE); 1686 gre_del_protocol(&ipgre_protocol, GREPROTO_CISCO);
1687add_proto_failed: 1687add_proto_failed:
1688 unregister_pernet_device(&ipgre_net_ops); 1688 unregister_pernet_device(&ipgre_net_ops);
1689 goto out; 1689 goto out;
@@ -1693,7 +1693,7 @@ static void __exit ipgre_fini(void)
1693{ 1693{
1694 rtnl_link_unregister(&ipgre_tap_ops); 1694 rtnl_link_unregister(&ipgre_tap_ops);
1695 rtnl_link_unregister(&ipgre_link_ops); 1695 rtnl_link_unregister(&ipgre_link_ops);
1696 if (inet_del_protocol(&ipgre_protocol, IPPROTO_GRE) < 0) 1696 if (gre_del_protocol(&ipgre_protocol, GREPROTO_CISCO) < 0)
1697 printk(KERN_INFO "ipgre close: can't remove protocol\n"); 1697 printk(KERN_INFO "ipgre close: can't remove protocol\n");
1698 unregister_pernet_device(&ipgre_net_ops); 1698 unregister_pernet_device(&ipgre_net_ops);
1699} 1699}