{"id":204604,"date":"2013-12-03T03:24:02","date_gmt":"2013-12-02T23:24:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=204604"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=204604","title":{"rendered":"<span class=\"post_title\">VmWare patch for linux 3.13<\/span>"},"content":{"rendered":"<div class=\"content html_format\">\n<pre><code class=\"diff\">--- vmnet-only\/filter.c 2013-10-18 23:11:55.000000000 +0400 +++ vmnet-only\/filter.c 2013-12-03 04:16:31.751352170 +0400 @@ -27,6 +27,7 @@  #include &quot;compat_module.h&quot;  #include &lt;linux\/mutex.h&gt;  #include &lt;linux\/netdevice.h&gt; +#include &lt;linux\/version.h&gt;  #if COMPAT_LINUX_VERSION_CHECK_LT(3, 2, 0)  #   include &lt;linux\/module.h&gt;  #else @@ -203,7 +204,11 @@  #endif    static unsigned int +#if LINUX_VERSION_CODE &lt; KERNEL_VERSION(3, 13, 0)  VNetFilterHookFn(unsigned int hooknum,                 \/\/ IN: +#else +VNetFilterHookFn(const struct nf_hook_ops *ops,        \/\/ IN: +#endif  #ifdef VMW_NFHOOK_USES_SKB                   struct sk_buff *skb,                  \/\/ IN:  #else @@ -252,7 +257,14 @@       \/* When the host transmits, hooknum is VMW_NF_INET_POST_ROUTING. *\/     \/* When the host receives, hooknum is VMW_NF_INET_LOCAL_IN. *\/ -   transmit = (hooknum == VMW_NF_INET_POST_ROUTING); + +#if LINUX_VERSION_CODE &lt; KERNEL_VERSION(3, 13, 0) +    transmit = (hooknum == VMW_NF_INET_POST_ROUTING); +#else +    transmit = (ops-&gt;hooknum == VMW_NF_INET_POST_ROUTING); +#endif + +   transmit = (ops-&gt;hooknum == VMW_NF_INET_POST_ROUTING);       packetHeader = compat_skb_network_header(skb);     ip = (struct iphdr*)packetHeader; <\/code><\/pre>\n<p>  <a href=\"https:\/\/www.kernel.org\/diff\/diffview.cgi?file=%2Fpub%2Flinux%2Fkernel%2Fv3.x%2Ftesting%2Fpatch-3.13-rc2.xz;z=7732\">\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0442\u0443\u0442<\/a><br \/>  <a name=\"habracut\"><\/a>    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/204604\/\"> http:\/\/habrahabr.ru\/post\/204604\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">\n<pre><code class=\"diff\">--- vmnet-only\/filter.c 2013-10-18 23:11:55.000000000 +0400 +++ vmnet-only\/filter.c 2013-12-03 04:16:31.751352170 +0400 @@ -27,6 +27,7 @@  #include &quot;compat_module.h&quot;  #include &lt;linux\/mutex.h&gt;  #include &lt;linux\/netdevice.h&gt; +#include &lt;linux\/version.h&gt;  #if COMPAT_LINUX_VERSION_CHECK_LT(3, 2, 0)  #   include &lt;linux\/module.h&gt;  #else @@ -203,7 +204,11 @@  #endif    static unsigned int +#if LINUX_VERSION_CODE &lt; KERNEL_VERSION(3, 13, 0)  VNetFilterHookFn(unsigned int hooknum,                 \/\/ IN: +#else +VNetFilterHookFn(const struct nf_hook_ops *ops,        \/\/ IN: +#endif  #ifdef VMW_NFHOOK_USES_SKB                   struct sk_buff *skb,                  \/\/ IN:  #else @@ -252,7 +257,14 @@       \/* When the host transmits, hooknum is VMW_NF_INET_POST_ROUTING. *\/     \/* When the host receives, hooknum is VMW_NF_INET_LOCAL_IN. *\/ -   transmit = (hooknum == VMW_NF_INET_POST_ROUTING); + +#if LINUX_VERSION_CODE &lt; KERNEL_VERSION(3, 13, 0) +    transmit = (hooknum == VMW_NF_INET_POST_ROUTING); +#else +    transmit = (ops-&gt;hooknum == VMW_NF_INET_POST_ROUTING); +#endif + +   transmit = (ops-&gt;hooknum == VMW_NF_INET_POST_ROUTING);       packetHeader = compat_skb_network_header(skb);     ip = (struct iphdr*)packetHeader; <\/code><\/pre>\n<p>  <a href=\"https:\/\/www.kernel.org\/diff\/diffview.cgi?file=%2Fpub%2Flinux%2Fkernel%2Fv3.x%2Ftesting%2Fpatch-3.13-rc2.xz;z=7732\">\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0442\u0443\u0442<\/a>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-204604","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/204604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=204604"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/204604\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=204604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=204604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=204604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}