patch-2.4.0-test10 linux/net/packet/af_packet.c
Next file: linux/net/protocols.c
Previous file: linux/net/netsyms.c
Back to the patch index
Back to the overall index
- Lines: 77
- Date:
Fri Oct 27 11:03:14 2000
- Orig file:
v2.4.0-test9/linux/net/packet/af_packet.c
- Orig date:
Mon Aug 28 21:16:05 2000
diff -u --recursive --new-file v2.4.0-test9/linux/net/packet/af_packet.c linux/net/packet/af_packet.c
@@ -5,7 +5,7 @@
*
* PACKET - implements raw packet sockets.
*
- * Version: $Id: af_packet.c,v 1.42 2000/08/29 03:44:56 davem Exp $
+ * Version: $Id: af_packet.c,v 1.46 2000/10/24 21:26:19 davem Exp $
*
* Authors: Ross Biro, <bir7@leland.Stanford.Edu>
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
@@ -33,6 +33,7 @@
* Alan Cox : Protocol setting support
* Alexey Kuznetsov : Untied from IPv4 stack.
* Cyrus Durgin : Fixed kerneld for kmod.
+ * Michal Ostrowski : Module initialization cleanup.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -67,6 +68,10 @@
#include <linux/init.h>
#include <linux/if_bridge.h>
+#ifdef CONFIG_NET_DIVERT
+#include <linux/divert.h>
+#endif /* CONFIG_NET_DIVERT */
+
#ifdef CONFIG_INET
#include <net/inet_common.h>
#endif
@@ -1484,6 +1489,14 @@
#endif
#endif
+ case SIOCGIFDIVERT:
+ case SIOCSIFDIVERT:
+#ifdef CONFIG_NET_DIVERT
+ return(divert_ioctl(cmd, (struct divert_cf *) arg));
+#else
+ return -ENOPKG;
+#endif /* CONFIG_NET_DIVERT */
+
return -ENOPKG;
#ifdef CONFIG_INET
@@ -1860,8 +1873,8 @@
#endif
-#ifdef MODULE
-void cleanup_module(void)
+
+static void __exit packet_exit(void)
{
#ifdef CONFIG_PROC_FS
remove_proc_entry("net/packet", 0);
@@ -1872,17 +1885,16 @@
}
-int init_module(void)
-#else
-void __init packet_proto_init(struct net_proto *pro)
-#endif
+static int __init packet_init(void)
{
sock_register(&packet_family_ops);
register_netdevice_notifier(&packet_netdev_notifier);
#ifdef CONFIG_PROC_FS
create_proc_read_entry("net/packet", 0, 0, packet_read_proc, NULL);
#endif
-#ifdef MODULE
return 0;
-#endif
}
+
+
+module_init(packet_init);
+module_exit(packet_exit);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)