Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 382793
Collapse All | Expand All

(-)vmnet-only.orig//driver.c (-24 / +25 lines)
Lines 165-171 static long VNetFileOpUnlockedIoctl(str Link Here
165
                                     unsigned int iocmd, unsigned long ioarg);
165
                                     unsigned int iocmd, unsigned long ioarg);
166
#endif
166
#endif
167
167
168
static struct file_operations vnetFileOps;
168
/* static struct file_operations vnetFileOps; old */
169
170
   /* Moved file operations initialize here because of incompatibilites
171
    * with Gentoo hardened profile/hardend Linux 3.
172
    * Initialize the file_operations structure. Because this code is always
173
    * compiled as a module, this is fine to do it here and not in a static
174
    * initializer.
175
    */
176
static struct file_operations vnetFileOps = {
177
   .owner = THIS_MODULE,
178
   .read = VNetFileOpRead,
179
   .write = VNetFileOpWrite,
180
   .poll = VNetFileOpPoll,
181
#ifdef HAVE_UNLOCKED_IOCTL
182
   .unlocked_ioctl = VNetFileOpUnlockedIoctl,
183
#else
184
   .ioctl = VNetFileOpIoctl,
185
#endif
186
#ifdef HAVE_COMPAT_IOCTL
187
   .compat_ioctl = VNetFileOpUnlockedIoctl,
188
#endif
189
   .open = VNetFileOpOpen,
190
   .release = VNetFileOpClose
191
};
169
192
170
/*
193
/*
171
 * Utility functions
194
 * Utility functions
Lines 475-503 init_module(void) Link Here
475
   if (retval) {
498
   if (retval) {
476
      goto err_proto;
499
      goto err_proto;
477
   }
500
   }
478
501
 
479
   /*
480
    * Initialize the file_operations structure. Because this code is always
481
    * compiled as a module, this is fine to do it here and not in a static
482
    * initializer.
483
    */
484
485
   memset(&vnetFileOps, 0, sizeof vnetFileOps);
486
   vnetFileOps.owner = THIS_MODULE;
487
   vnetFileOps.read = VNetFileOpRead;
488
   vnetFileOps.write = VNetFileOpWrite;
489
   vnetFileOps.poll = VNetFileOpPoll;
490
#ifdef HAVE_UNLOCKED_IOCTL
491
   vnetFileOps.unlocked_ioctl = VNetFileOpUnlockedIoctl;
492
#else
493
   vnetFileOps.ioctl = VNetFileOpIoctl;
494
#endif
495
#ifdef HAVE_COMPAT_IOCTL
496
   vnetFileOps.compat_ioctl = VNetFileOpUnlockedIoctl;
497
#endif
498
   vnetFileOps.open = VNetFileOpOpen;
499
   vnetFileOps.release = VNetFileOpClose;
500
501
   retval = register_chrdev(VNET_MAJOR_NUMBER, "vmnet", &vnetFileOps);
502
   retval = register_chrdev(VNET_MAJOR_NUMBER, "vmnet", &vnetFileOps);
502
   if (retval) {
503
   if (retval) {
503
      LOG(0, (KERN_NOTICE "/dev/vmnet: could not register major device %d\n",
504
      LOG(0, (KERN_NOTICE "/dev/vmnet: could not register major device %d\n",
(-)vmnet-only.orig//filter.c (+4 lines)
Lines 40-45 Link Here
40
#include "vnetInt.h"
40
#include "vnetInt.h"
41
#include "vmnetInt.h"
41
#include "vmnetInt.h"
42
42
43
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
44
#include <linux/export.h>
45
#endif
46
43
// VNet_FilterLogPacket.action for dropped packets
47
// VNet_FilterLogPacket.action for dropped packets
44
#define VNET_FILTER_ACTION_DRP         (1)
48
#define VNET_FILTER_ACTION_DRP         (1)
45
#define VNET_FILTER_ACTION_DRP_SHORT   (2)
49
#define VNET_FILTER_ACTION_DRP_SHORT   (2)
(-)vmnet-only.orig//netif.c (-1 / +6 lines)
Lines 62-68 static int VNetNetifClose(struct net_de Link Here
62
static int  VNetNetifStartXmit(struct sk_buff *skb, struct net_device *dev);
62
static int  VNetNetifStartXmit(struct sk_buff *skb, struct net_device *dev);
63
static struct net_device_stats *VNetNetifGetStats(struct net_device *dev);
63
static struct net_device_stats *VNetNetifGetStats(struct net_device *dev);
64
static int  VNetNetifSetMAC(struct net_device *dev, void *addr);
64
static int  VNetNetifSetMAC(struct net_device *dev, void *addr);
65
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 42, 0) || (LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0))
65
static void VNetNetifSetMulticast(struct net_device *dev);
66
static void VNetNetifSetMulticast(struct net_device *dev);
67
#endif
66
#if 0
68
#if 0
67
static void VNetNetifTxTimeout(struct net_device *dev);
69
static void VNetNetifTxTimeout(struct net_device *dev);
68
#endif
70
#endif
Lines 131-137 VNetNetIfSetup(struct net_device *dev) Link Here
131
      .ndo_stop = VNetNetifClose,
133
      .ndo_stop = VNetNetifClose,
132
      .ndo_get_stats = VNetNetifGetStats,
134
      .ndo_get_stats = VNetNetifGetStats,
133
      .ndo_set_mac_address = VNetNetifSetMAC,
135
      .ndo_set_mac_address = VNetNetifSetMAC,
136
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 42, 0) || (LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0))
134
      .ndo_set_multicast_list = VNetNetifSetMulticast,
137
      .ndo_set_multicast_list = VNetNetifSetMulticast,
138
#endif
135
      /*
139
      /*
136
       * We cannot stuck... If someone will report problems under
140
       * We cannot stuck... If someone will report problems under
137
       * low memory conditions or some such, we should enable it.
141
       * low memory conditions or some such, we should enable it.
Lines 612-622 VNetNetifSetMAC(struct net_device *dev, Link Here
612
 *----------------------------------------------------------------------
616
 *----------------------------------------------------------------------
613
 */
617
 */
614
618
619
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 42, 0) || (LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0))
615
void
620
void
616
VNetNetifSetMulticast(struct net_device *dev) // IN: unused
621
VNetNetifSetMulticast(struct net_device *dev) // IN: unused
617
{
622
{
618
}
623
}
619
624
#endif
620
625
621
/*
626
/*
622
 *----------------------------------------------------------------------
627
 *----------------------------------------------------------------------
(-)vmnet-only.orig//userif.c (-1 / +8 lines)
Lines 516-526 VNetCsumCopyDatagram(const struct sk_buf Link Here
516
      if (frag->size > 0) {
516
      if (frag->size > 0) {
517
	 unsigned int tmpCsum;
517
	 unsigned int tmpCsum;
518
	 const void *vaddr;
518
	 const void *vaddr;
519
519
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 42, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
520
         vaddr = kmap(skb_frag_page(frag));
521
#else
520
	 vaddr = kmap(frag->page);
522
	 vaddr = kmap(frag->page);
523
#endif
521
	 tmpCsum = csum_and_copy_to_user(vaddr + frag->page_offset,
524
	 tmpCsum = csum_and_copy_to_user(vaddr + frag->page_offset,
522
					 curr, frag->size, 0, &err);
525
					 curr, frag->size, 0, &err);
526
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 42, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
527
         kunmap(skb_frag_page(frag));
528
#else
523
	 kunmap(frag->page);
529
	 kunmap(frag->page);
530
#endif
524
	 if (err) {
531
	 if (err) {
525
	    return err;
532
	    return err;
526
	 }
533
	 }

Return to bug 382793