mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 03:07:43 +02:00
Merge commit 'origin/core51'
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
diff -Naur kvm-kmod-2.6.38.6.org/x86/external-module-compat.h kvm-kmod-2.6.38.6/x86/external-module-compat.h
|
||||
--- kvm-kmod-2.6.38.6.org/x86/external-module-compat.h 2011-05-15 09:34:48.000000000 +0200
|
||||
+++ kvm-kmod-2.6.38.6/x86/external-module-compat.h 2011-05-21 13:30:50.529469540 +0200
|
||||
@@ -1064,41 +1064,6 @@
|
||||
|
||||
#endif /* >= 2.6.36 */
|
||||
|
||||
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
|
||||
-static inline u64 pvclock_scale_delta(u64 delta, u32 mul_frac, int shift)
|
||||
-{
|
||||
- u64 product;
|
||||
-#ifdef __i386__
|
||||
- u32 tmp1, tmp2;
|
||||
-#endif
|
||||
-
|
||||
- if (shift < 0)
|
||||
- delta >>= -shift;
|
||||
- else
|
||||
- delta <<= shift;
|
||||
-
|
||||
-#ifdef __i386__
|
||||
- __asm__ (
|
||||
- "mul %5 ; "
|
||||
- "mov %4,%%eax ; "
|
||||
- "mov %%edx,%4 ; "
|
||||
- "mul %5 ; "
|
||||
- "xor %5,%5 ; "
|
||||
- "add %4,%%eax ; "
|
||||
- "adc %5,%%edx ; "
|
||||
- : "=A" (product), "=r" (tmp1), "=r" (tmp2)
|
||||
- : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
|
||||
-#elif defined(__x86_64__)
|
||||
- __asm__ (
|
||||
- "mul %%rdx ; shrd $32,%%rdx,%%rax"
|
||||
- : "=a" (product) : "0" (delta), "d" ((u64)mul_frac) );
|
||||
-#else
|
||||
-#error implement me!
|
||||
-#endif
|
||||
-
|
||||
- return product;
|
||||
-}
|
||||
-#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) && \
|
||||
LINUX_VERSION_CODE != KERNEL_VERSION(2,6,32) && defined(CONFIG_X86_64)
|
||||
@@ -1,137 +0,0 @@
|
||||
diff -Naur linux-2.6.32.43.org/net/ipv4/ip_gre.c linux-2.6.32.43/net/ipv4/ip_gre.c
|
||||
--- linux-2.6.32.43.org/net/ipv4/ip_gre.c 2011-07-13 05:29:43.000000000 +0200
|
||||
+++ linux-2.6.32.43/net/ipv4/ip_gre.c 2011-06-20 19:27:06.000000000 +0200
|
||||
@@ -1665,14 +1665,16 @@
|
||||
|
||||
printk(KERN_INFO "GRE over IPv4 tunneling driver\n");
|
||||
|
||||
- if (inet_add_protocol(&ipgre_protocol, IPPROTO_GRE) < 0) {
|
||||
- printk(KERN_INFO "ipgre init: can't add protocol\n");
|
||||
- return -EAGAIN;
|
||||
- }
|
||||
-
|
||||
err = register_pernet_gen_device(&ipgre_net_id, &ipgre_net_ops);
|
||||
if (err < 0)
|
||||
+ goto out;
|
||||
+
|
||||
+ err = inet_add_protocol(&ipgre_protocol, IPPROTO_GRE);
|
||||
+ if (err < 0) {
|
||||
+ printk(KERN_INFO "ipgre init: can't add protocol\n");
|
||||
+ err = -EAGAIN;
|
||||
goto gen_device_failed;
|
||||
+ }
|
||||
|
||||
err = rtnl_link_register(&ipgre_link_ops);
|
||||
if (err < 0)
|
||||
@@ -1688,9 +1690,9 @@
|
||||
tap_ops_failed:
|
||||
rtnl_link_unregister(&ipgre_link_ops);
|
||||
rtnl_link_failed:
|
||||
- unregister_pernet_gen_device(ipgre_net_id, &ipgre_net_ops);
|
||||
-gen_device_failed:
|
||||
inet_del_protocol(&ipgre_protocol, IPPROTO_GRE);
|
||||
+gen_device_failed:
|
||||
+ unregister_pernet_gen_device(ipgre_net_id, &ipgre_net_ops);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -1698,9 +1700,10 @@
|
||||
{
|
||||
rtnl_link_unregister(&ipgre_tap_ops);
|
||||
rtnl_link_unregister(&ipgre_link_ops);
|
||||
- unregister_pernet_gen_device(ipgre_net_id, &ipgre_net_ops);
|
||||
if (inet_del_protocol(&ipgre_protocol, IPPROTO_GRE) < 0)
|
||||
printk(KERN_INFO "ipgre close: can't remove protocol\n");
|
||||
+
|
||||
+ unregister_pernet_gen_device(ipgre_net_id, &ipgre_net_ops);
|
||||
}
|
||||
|
||||
module_init(ipgre_init);
|
||||
diff -Naur linux-2.6.32.43.org/net/ipv4/ipip.c linux-2.6.32.43/net/ipv4/ipip.c
|
||||
--- linux-2.6.32.43.org/net/ipv4/ipip.c 2011-07-13 05:29:43.000000000 +0200
|
||||
+++ linux-2.6.32.43/net/ipv4/ipip.c 2011-06-20 19:27:06.000000000 +0200
|
||||
@@ -830,15 +830,14 @@
|
||||
|
||||
printk(banner);
|
||||
|
||||
- if (xfrm4_tunnel_register(&ipip_handler, AF_INET)) {
|
||||
+ err = register_pernet_gen_device(&ipip_net_id, &ipip_net_ops);
|
||||
+ if (err < 0)
|
||||
+ return err;
|
||||
+ err = xfrm4_tunnel_register(&ipip_handler, AF_INET);
|
||||
+ if (err < 0) {
|
||||
+ unregister_pernet_gen_device(ipip_net_id, &ipip_net_ops);
|
||||
printk(KERN_INFO "ipip init: can't register tunnel\n");
|
||||
- return -EAGAIN;
|
||||
}
|
||||
-
|
||||
- err = register_pernet_gen_device(&ipip_net_id, &ipip_net_ops);
|
||||
- if (err)
|
||||
- xfrm4_tunnel_deregister(&ipip_handler, AF_INET);
|
||||
-
|
||||
return err;
|
||||
}
|
||||
|
||||
diff -Naur linux-2.6.32.43.org/net/ipv6/ip6_tunnel.c linux-2.6.32.43/net/ipv6/ip6_tunnel.c
|
||||
--- linux-2.6.32.43.org/net/ipv6/ip6_tunnel.c 2011-07-13 05:29:43.000000000 +0200
|
||||
+++ linux-2.6.32.43/net/ipv6/ip6_tunnel.c 2011-06-20 19:27:06.000000000 +0200
|
||||
@@ -1466,10 +1465,14 @@
|
||||
{
|
||||
int err;
|
||||
|
||||
+ err = register_pernet_gen_device(&ip6_tnl_net_id, &ip6_tnl_net_ops);
|
||||
+ if (err < 0)
|
||||
+ goto out;
|
||||
+
|
||||
if (xfrm6_tunnel_register(&ip4ip6_handler, AF_INET)) {
|
||||
printk(KERN_ERR "ip6_tunnel init: can't register ip4ip6\n");
|
||||
err = -EAGAIN;
|
||||
- goto out;
|
||||
+ goto unreg_pernet_dev;
|
||||
}
|
||||
|
||||
if (xfrm6_tunnel_register(&ip6ip6_handler, AF_INET6)) {
|
||||
@@ -1478,14 +1481,12 @@
|
||||
goto unreg_ip4ip6;
|
||||
}
|
||||
|
||||
- err = register_pernet_gen_device(&ip6_tnl_net_id, &ip6_tnl_net_ops);
|
||||
- if (err < 0)
|
||||
- goto err_pernet;
|
||||
return 0;
|
||||
-err_pernet:
|
||||
- xfrm6_tunnel_deregister(&ip6ip6_handler, AF_INET6);
|
||||
+
|
||||
unreg_ip4ip6:
|
||||
xfrm6_tunnel_deregister(&ip4ip6_handler, AF_INET);
|
||||
+unreg_pernet_dev:
|
||||
+ unregister_pernet_gen_device(ip6_tnl_net_id, &ip6_tnl_net_ops);
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
diff -Naur linux-2.6.32.43.org/net/ipv6/sit.c linux-2.6.32.43/net/ipv6/sit.c
|
||||
--- linux-2.6.32.43.org/net/ipv6/sit.c 2011-07-13 05:29:43.000000000 +0200
|
||||
+++ linux-2.6.32.43/net/ipv6/sit.c 2011-06-20 19:27:06.000000000 +0200
|
||||
@@ -1086,15 +1086,17 @@
|
||||
|
||||
printk(KERN_INFO "IPv6 over IPv4 tunneling driver\n");
|
||||
|
||||
- if (xfrm4_tunnel_register(&sit_handler, AF_INET6) < 0) {
|
||||
+ err = register_pernet_gen_device(&sit_net_id, &sit_net_ops);
|
||||
+ if (err < 0)
|
||||
+ return err;
|
||||
+
|
||||
+ err = xfrm4_tunnel_register(&sit_handler, AF_INET6);
|
||||
+ if (err < 0) {
|
||||
+ unregister_pernet_gen_device(sit_net_id, &sit_net_ops);
|
||||
printk(KERN_INFO "sit init: Can't add protocol\n");
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
- err = register_pernet_gen_device(&sit_net_id, &sit_net_ops);
|
||||
- if (err < 0)
|
||||
- xfrm4_tunnel_deregister(&sit_handler, AF_INET6);
|
||||
-
|
||||
return err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user