lkml.org 
[lkml]   [1996]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPatch for netlink driver
Hello!

I have been poking around in an attempt to get a useful IPX tunnel set
up. I thought it could be done entirely from user mode, but I was
wrong: using a SOCK_PACKET, one does not receive IPX packets originating
locally (doh!). I haven't bothered to actually look in to that, but
instead wrote an ether driver that uses NetLink. Works great, except for
the fact that there is no select function for the NetLink device. Here's
a patch against pre2.0.7. (should work against later versions too ;)
Also, methinks that the symbols netlink_attach, netlink_detach and
netlink_post should be exported for modules.

-b

--- linux/net/netlink.c.old Sun May 19 12:10:04 1996
+++ linux/net/netlink.c Thu May 30 13:31:01 1996
@@ -63,6 +63,21 @@
return -EINVAL;
}

+static int netlink_select(struct inode *inode, struct file *file, int sel_type, select_table * wait)
+{
+ unsigned int minor = MINOR(inode->i_rdev);
+ switch (sel_type) {
+ case SEL_IN:
+ if (skb_peek(&skb_queue_rd[minor])!=NULL)
+ return 1;
+ select_wait(&read_space_wait[minor], wait);
+ break;
+ case SEL_OUT:
+ return 1;
+ }
+ return 0;
+}
+
/*
* Write a message to the kernel side of a communication link
*/
@@ -161,7 +176,7 @@
netlink_read,
netlink_write,
NULL, /* netlink_readdir */
- NULL, /* netlink_select */
+ netlink_select,
netlink_ioctl,
NULL, /* netlink_mmap */
netlink_open,

\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.054 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site