Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [NETFILTER]: Rename init functions.
  [TCP]: Fix RFC2465 typo.
  [INET]: Introduce tunnel4/tunnel6
  [NET]: deinline 200+ byte inlines in sock.h
  [ECONET]: Convert away from SOCKOPS_WRAPPED
  [NET]: Fix ipx/econet/appletalk/irda ioctl crashes
  [NET]: Kill Documentation/networking/TODO
  [TG3]: Update version and reldate
  [TG3]: Skip timer code during full lock
  [TG3]: Speed up SRAM access
  [TG3]: Fix PHY loopback on 5700
  [TG3]: Fix bug in 40-bit DMA workaround code
  [TG3]: Fix probe failure due to invalid MAC address
This commit is contained in:
Linus Torvalds 2006-03-29 11:29:33 -08:00
commit f3cab8a0b1
140 changed files with 1144 additions and 918 deletions

View File

@ -1,18 +0,0 @@
To-do items for network drivers
-------------------------------
* Move ethernet crc routine to generic code
* (for 2.5) Integrate Jamal Hadi Salim's netdev Rx polling API change
* Audit all net drivers to make sure magic packet / wake-on-lan /
similar features are disabled in the driver by default.
* Audit all net drivers to make sure the module always prints out a
version string when loaded as a module, but only prints a version
string when built into the kernel if a device is detected.
* Add ETHTOOL_GDRVINFO ioctl support to all ethernet drivers.
* dmfe PCI DMA is totally wrong and only works on x86

View File

@ -1885,6 +1885,7 @@ NETWORKING [GENERAL]
P: Networking Team
M: netdev@vger.kernel.org
L: netdev@vger.kernel.org
W: http://linux-net.osdl.org/
S: Maintained
NETWORKING [IPv4/IPv6]

View File

@ -69,8 +69,8 @@
#define DRV_MODULE_NAME "tg3"
#define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "3.54"
#define DRV_MODULE_RELDATE "Mar 23, 2006"
#define DRV_MODULE_VERSION "3.55"
#define DRV_MODULE_RELDATE "Mar 27, 2006"
#define TG3_DEF_MAC_MODE 0
#define TG3_DEF_RX_MODE 0
@ -497,33 +497,40 @@ static void tg3_write_mem(struct tg3 *tp, u32 off, u32 val)
unsigned long flags;
spin_lock_irqsave(&tp->indirect_lock, flags);
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off);
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val);
if (tp->write32 != tg3_write_indirect_reg32) {
tw32_f(TG3PCI_MEM_WIN_BASE_ADDR, off);
tw32_f(TG3PCI_MEM_WIN_DATA, val);
/* Always leave this as zero. */
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0);
/* Always leave this as zero. */
tw32_f(TG3PCI_MEM_WIN_BASE_ADDR, 0);
} else {
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off);
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val);
/* Always leave this as zero. */
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0);
}
spin_unlock_irqrestore(&tp->indirect_lock, flags);
}
static void tg3_write_mem_fast(struct tg3 *tp, u32 off, u32 val)
{
/* If no workaround is needed, write to mem space directly */
if (tp->write32 != tg3_write_indirect_reg32)
tw32(NIC_SRAM_WIN_BASE + off, val);
else
tg3_write_mem(tp, off, val);
}
static void tg3_read_mem(struct tg3 *tp, u32 off, u32 *val)
{
unsigned long flags;
spin_lock_irqsave(&tp->indirect_lock, flags);
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off);
pci_read_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val);
if (tp->write32 != tg3_write_indirect_reg32) {
tw32_f(TG3PCI_MEM_WIN_BASE_ADDR, off);
*val = tr32(TG3PCI_MEM_WIN_DATA);
/* Always leave this as zero. */
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0);
/* Always leave this as zero. */
tw32_f(TG3PCI_MEM_WIN_BASE_ADDR, 0);
} else {
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off);
pci_read_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val);
/* Always leave this as zero. */
pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0);
}
spin_unlock_irqrestore(&tp->indirect_lock, flags);
}
@ -1367,12 +1374,12 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
}
}
tg3_write_sig_post_reset(tp, RESET_KIND_SHUTDOWN);
/* Finally, set the new power state. */
pci_write_config_word(tp->pdev, pm + PCI_PM_CTRL, power_control);
udelay(100); /* Delay after power state change */
tg3_write_sig_post_reset(tp, RESET_KIND_SHUTDOWN);
return 0;
}
@ -3600,7 +3607,7 @@ static inline int tg3_40bit_overflow_test(struct tg3 *tp, dma_addr_t mapping,
int len)
{
#if defined(CONFIG_HIGHMEM) && (BITS_PER_LONG == 64)
if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)
if (tp->tg3_flags & TG3_FLAG_40BIT_DMA_BUG)
return (((u64) mapping + len) > DMA_40BIT_MASK);
return 0;
#else
@ -6461,6 +6468,9 @@ static void tg3_timer(unsigned long __opaque)
{
struct tg3 *tp = (struct tg3 *) __opaque;
if (tp->irq_sync)
goto restart_timer;
spin_lock(&tp->lock);
if (!(tp->tg3_flags & TG3_FLAG_TAGGED_STATUS)) {
@ -6537,11 +6547,11 @@ static void tg3_timer(unsigned long __opaque)
if (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) {
u32 val;
tg3_write_mem_fast(tp, NIC_SRAM_FW_CMD_MBOX,
FWCMD_NICDRV_ALIVE2);
tg3_write_mem_fast(tp, NIC_SRAM_FW_CMD_LEN_MBOX, 4);
tg3_write_mem(tp, NIC_SRAM_FW_CMD_MBOX,
FWCMD_NICDRV_ALIVE2);
tg3_write_mem(tp, NIC_SRAM_FW_CMD_LEN_MBOX, 4);
/* 5 seconds timeout */
tg3_write_mem_fast(tp, NIC_SRAM_FW_CMD_DATA_MBOX, 5);
tg3_write_mem(tp, NIC_SRAM_FW_CMD_DATA_MBOX, 5);
val = tr32(GRC_RX_CPU_EVENT);
val |= (1 << 14);
tw32(GRC_RX_CPU_EVENT, val);
@ -6551,6 +6561,7 @@ static void tg3_timer(unsigned long __opaque)
spin_unlock(&tp->lock);
restart_timer:
tp->timer.expires = jiffies + tp->timer_offset;
add_timer(&tp->timer);
}
@ -8399,8 +8410,11 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
}
mac_mode = (tp->mac_mode & ~MAC_MODE_PORT_MODE_MASK) |
MAC_MODE_LINK_POLARITY | MAC_MODE_PORT_MODE_GMII;
if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401)
if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401) {
mac_mode &= ~MAC_MODE_LINK_POLARITY;
tg3_writephy(tp, MII_TG3_EXT_CTRL,
MII_TG3_EXT_CTRL_LNK3_LED_MODE);
}
tw32(MAC_MODE, mac_mode);
}
else
@ -10531,6 +10545,7 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
{
struct net_device *dev = tp->dev;
u32 hi, lo, mac_offset;
int addr_ok = 0;
#ifdef CONFIG_SPARC64
if (!tg3_get_macaddr_sparc(tp))
@ -10560,29 +10575,34 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
dev->dev_addr[3] = (lo >> 16) & 0xff;
dev->dev_addr[4] = (lo >> 8) & 0xff;
dev->dev_addr[5] = (lo >> 0) & 0xff;
}
/* Next, try NVRAM. */
else if (!(tp->tg3_flags & TG3_FLG2_SUN_570X) &&
!tg3_nvram_read(tp, mac_offset + 0, &hi) &&
!tg3_nvram_read(tp, mac_offset + 4, &lo)) {
dev->dev_addr[0] = ((hi >> 16) & 0xff);
dev->dev_addr[1] = ((hi >> 24) & 0xff);
dev->dev_addr[2] = ((lo >> 0) & 0xff);
dev->dev_addr[3] = ((lo >> 8) & 0xff);
dev->dev_addr[4] = ((lo >> 16) & 0xff);
dev->dev_addr[5] = ((lo >> 24) & 0xff);
}
/* Finally just fetch it out of the MAC control regs. */
else {
hi = tr32(MAC_ADDR_0_HIGH);
lo = tr32(MAC_ADDR_0_LOW);
dev->dev_addr[5] = lo & 0xff;
dev->dev_addr[4] = (lo >> 8) & 0xff;
dev->dev_addr[3] = (lo >> 16) & 0xff;
dev->dev_addr[2] = (lo >> 24) & 0xff;
dev->dev_addr[1] = hi & 0xff;
dev->dev_addr[0] = (hi >> 8) & 0xff;
/* Some old bootcode may report a 0 MAC address in SRAM */
addr_ok = is_valid_ether_addr(&dev->dev_addr[0]);
}
if (!addr_ok) {
/* Next, try NVRAM. */
if (!(tp->tg3_flags & TG3_FLG2_SUN_570X) &&
!tg3_nvram_read(tp, mac_offset + 0, &hi) &&
!tg3_nvram_read(tp, mac_offset + 4, &lo)) {
dev->dev_addr[0] = ((hi >> 16) & 0xff);
dev->dev_addr[1] = ((hi >> 24) & 0xff);
dev->dev_addr[2] = ((lo >> 0) & 0xff);
dev->dev_addr[3] = ((lo >> 8) & 0xff);
dev->dev_addr[4] = ((lo >> 16) & 0xff);
dev->dev_addr[5] = ((lo >> 24) & 0xff);
}
/* Finally just fetch it out of the MAC control regs. */
else {
hi = tr32(MAC_ADDR_0_HIGH);
lo = tr32(MAC_ADDR_0_LOW);
dev->dev_addr[5] = lo & 0xff;
dev->dev_addr[4] = (lo >> 8) & 0xff;
dev->dev_addr[3] = (lo >> 16) & 0xff;
dev->dev_addr[2] = (lo >> 24) & 0xff;
dev->dev_addr[1] = hi & 0xff;
dev->dev_addr[0] = (hi >> 8) & 0xff;
}
}
if (!is_valid_ether_addr(&dev->dev_addr[0])) {

View File

@ -938,28 +938,7 @@ static inline void sock_put(struct sock *sk)
sk_free(sk);
}
static inline int sk_receive_skb(struct sock *sk, struct sk_buff *skb)
{
int rc = NET_RX_SUCCESS;
if (sk_filter(sk, skb, 0))
goto discard_and_relse;
skb->dev = NULL;
bh_lock_sock(sk);
if (!sock_owned_by_user(sk))
rc = sk->sk_backlog_rcv(sk, skb);
else
sk_add_backlog(sk, skb);
bh_unlock_sock(sk);
out:
sock_put(sk);
return rc;
discard_and_relse:
kfree_skb(skb);
goto out;
}
extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb);
/* Detach socket from process context.
* Announce socket dead, detach it from wait queue and inode.
@ -1044,33 +1023,9 @@ sk_dst_reset(struct sock *sk)
write_unlock(&sk->sk_dst_lock);
}
static inline struct dst_entry *
__sk_dst_check(struct sock *sk, u32 cookie)
{
struct dst_entry *dst = sk->sk_dst_cache;
extern struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie);
if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) {
sk->sk_dst_cache = NULL;
dst_release(dst);
return NULL;
}
return dst;
}
static inline struct dst_entry *
sk_dst_check(struct sock *sk, u32 cookie)
{
struct dst_entry *dst = sk_dst_get(sk);
if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) {
sk_dst_reset(sk);
dst_release(dst);
return NULL;
}
return dst;
}
extern struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie);
static inline void sk_setup_caps(struct sock *sk, struct dst_entry *dst)
{
@ -1140,45 +1095,7 @@ extern void sk_reset_timer(struct sock *sk, struct timer_list* timer,
extern void sk_stop_timer(struct sock *sk, struct timer_list* timer);
static inline int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
{
int err = 0;
int skb_len;
/* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
number of warnings when compiling with -W --ANK
*/
if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
(unsigned)sk->sk_rcvbuf) {
err = -ENOMEM;
goto out;
}
/* It would be deadlock, if sock_queue_rcv_skb is used
with socket lock! We assume that users of this
function are lock free.
*/
err = sk_filter(sk, skb, 1);
if (err)
goto out;
skb->dev = NULL;
skb_set_owner_r(skb, sk);
/* Cache the SKB length before we tack it onto the receive
* queue. Once it is added it no longer belongs to us and
* may be freed by other threads of control pulling packets
* from the queue.
*/
skb_len = skb->len;
skb_queue_tail(&sk->sk_receive_queue, skb);
if (!sock_flag(sk, SOCK_DEAD))
sk->sk_data_ready(sk, skb_len);
out:
return err;
}
extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
static inline int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
{

View File

@ -864,13 +864,19 @@ struct xfrm_algo_desc {
/* XFRM tunnel handlers. */
struct xfrm_tunnel {
int (*handler)(struct sk_buff *skb);
void (*err_handler)(struct sk_buff *skb, __u32 info);
int (*err_handler)(struct sk_buff *skb, __u32 info);
struct xfrm_tunnel *next;
int priority;
};
struct xfrm6_tunnel {
int (*handler)(struct sk_buff **pskb);
void (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt,
int type, int code, int offset, __u32 info);
int (*handler)(struct sk_buff *skb);
int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt,
int type, int code, int offset, __u32 info);
struct xfrm6_tunnel *next;
int priority;
};
extern void xfrm_init(void);
@ -906,7 +912,7 @@ extern int xfrm4_rcv(struct sk_buff *skb);
extern int xfrm4_output(struct sk_buff *skb);
extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler);
extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler);
extern int xfrm6_rcv_spi(struct sk_buff **pskb, u32 spi);
extern int xfrm6_rcv_spi(struct sk_buff *skb, u32 spi);
extern int xfrm6_rcv(struct sk_buff **pskb);
extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler);
extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler);

View File

@ -1819,6 +1819,22 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
return rc;
}
#ifdef CONFIG_COMPAT
static int atalk_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{
/*
* All Appletalk ioctls except SIOCATALKDIFADDR are standard. And
* SIOCATALKDIFADDR is handled by upper layer as well, so there is
* nothing to do. Eventually SIOCATALKDIFADDR should be moved
* here so there is no generic SIOCPROTOPRIVATE translation in the
* system.
*/
return -ENOIOCTLCMD;
}
#endif
static struct net_proto_family atalk_family_ops = {
.family = PF_APPLETALK,
.create = atalk_create,
@ -1836,6 +1852,9 @@ static const struct proto_ops SOCKOPS_WRAPPED(atalk_dgram_ops) = {
.getname = atalk_getname,
.poll = datagram_poll,
.ioctl = atalk_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = atalk_compat_ioctl,
#endif
.listen = sock_no_listen,
.shutdown = sock_no_shutdown,
.setsockopt = sock_no_setsockopt,

View File

@ -58,16 +58,16 @@ static struct ebt_match filter_802_3 =
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ebt_802_3_init(void)
{
return ebt_register_match(&filter_802_3);
}
static void __exit fini(void)
static void __exit ebt_802_3_fini(void)
{
ebt_unregister_match(&filter_802_3);
}
module_init(init);
module_exit(fini);
module_init(ebt_802_3_init);
module_exit(ebt_802_3_fini);
MODULE_LICENSE("GPL");

View File

@ -213,16 +213,16 @@ static struct ebt_match filter_among = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ebt_among_init(void)
{
return ebt_register_match(&filter_among);
}
static void __exit fini(void)
static void __exit ebt_among_fini(void)
{
ebt_unregister_match(&filter_among);
}
module_init(init);
module_exit(fini);
module_init(ebt_among_init);
module_exit(ebt_among_fini);
MODULE_LICENSE("GPL");

View File

@ -125,16 +125,16 @@ static struct ebt_match filter_arp =
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ebt_arp_init(void)
{
return ebt_register_match(&filter_arp);
}
static void __exit fini(void)
static void __exit ebt_arp_fini(void)
{
ebt_unregister_match(&filter_arp);
}
module_init(init);
module_exit(fini);
module_init(ebt_arp_init);
module_exit(ebt_arp_fini);
MODULE_LICENSE("GPL");

View File

@ -82,16 +82,16 @@ static struct ebt_target reply_target =
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ebt_arpreply_init(void)
{
return ebt_register_target(&reply_target);
}
static void __exit fini(void)
static void __exit ebt_arpreply_fini(void)
{
ebt_unregister_target(&reply_target);
}
module_init(init);
module_exit(fini);
module_init(ebt_arpreply_init);
module_exit(ebt_arpreply_fini);
MODULE_LICENSE("GPL");

View File

@ -61,16 +61,16 @@ static struct ebt_target dnat =
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ebt_dnat_init(void)
{
return ebt_register_target(&dnat);
}
static void __exit fini(void)
static void __exit ebt_dnat_fini(void)
{
ebt_unregister_target(&dnat);
}
module_init(init);
module_exit(fini);
module_init(ebt_dnat_init);
module_exit(ebt_dnat_fini);
MODULE_LICENSE("GPL");

View File

@ -112,16 +112,16 @@ static struct ebt_match filter_ip =
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ebt_ip_init(void)
{
return ebt_register_match(&filter_ip);
}
static void __exit fini(void)
static void __exit ebt_ip_fini(void)
{
ebt_unregister_match(&filter_ip);
}
module_init(init);
module_exit(fini);
module_init(ebt_ip_init);
module_exit(ebt_ip_fini);
MODULE_LICENSE("GPL");

View File

@ -98,16 +98,16 @@ static struct ebt_match ebt_limit_reg =
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ebt_limit_init(void)
{
return ebt_register_match(&ebt_limit_reg);
}
static void __exit fini(void)
static void __exit ebt_limit_fini(void)
{
ebt_unregister_match(&ebt_limit_reg);
}
module_init(init);
module_exit(fini);
module_init(ebt_limit_init);
module_exit(ebt_limit_fini);
MODULE_LICENSE("GPL");

View File

@ -188,7 +188,7 @@ static struct nf_logger ebt_log_logger = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ebt_log_init(void)
{
int ret;
@ -205,12 +205,12 @@ static int __init init(void)
return 0;
}
static void __exit fini(void)
static void __exit ebt_log_fini(void)
{
nf_log_unregister_logger(&ebt_log_logger);
ebt_unregister_watcher(&log);
}
module_init(init);
module_exit(fini);
module_init(ebt_log_init);
module_exit(ebt_log_fini);
MODULE_LICENSE("GPL");

View File

@ -52,16 +52,16 @@ static struct ebt_target mark_target =
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ebt_mark_init(void)
{
return ebt_register_target(&mark_target);
}
static void __exit fini(void)
static void __exit ebt_mark_fini(void)
{
ebt_unregister_target(&mark_target);
}
module_init(init);
module_exit(fini);
module_init(ebt_mark_init);
module_exit(ebt_mark_fini);
MODULE_LICENSE("GPL");

View File

@ -47,16 +47,16 @@ static struct ebt_match filter_mark =
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ebt_mark_m_init(void)
{
return ebt_register_match(&filter_mark);
}
static void __exit fini(void)
static void __exit ebt_mark_m_fini(void)
{
ebt_unregister_match(&filter_mark);
}
module_init(init);
module_exit(fini);
module_init(ebt_mark_m_init);
module_exit(ebt_mark_m_fini);
MODULE_LICENSE("GPL");

View File

@ -44,16 +44,16 @@ static struct ebt_match filter_pkttype =
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ebt_pkttype_init(void)
{
return ebt_register_match(&filter_pkttype);
}
static void __exit fini(void)
static void __exit ebt_pkttype_fini(void)
{
ebt_unregister_match(&filter_pkttype);
}
module_init(init);
module_exit(fini);
module_init(ebt_pkttype_init);
module_exit(ebt_pkttype_fini);
MODULE_LICENSE("GPL");

View File

@ -66,16 +66,16 @@ static struct ebt_target redirect_target =
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ebt_redirect_init(void)
{
return ebt_register_target(&redirect_target);
}
static void __exit fini(void)
static void __exit ebt_redirect_fini(void)
{
ebt_unregister_target(&redirect_target);
}
module_init(init);
module_exit(fini);
module_init(ebt_redirect_init);
module_exit(ebt_redirect_fini);
MODULE_LICENSE("GPL");

View File

@ -61,16 +61,16 @@ static struct ebt_target snat =
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ebt_snat_init(void)
{
return ebt_register_target(&snat);
}
static void __exit fini(void)
static void __exit ebt_snat_fini(void)
{
ebt_unregister_target(&snat);
}
module_init(init);
module_exit(fini);
module_init(ebt_snat_init);
module_exit(ebt_snat_fini);
MODULE_LICENSE("GPL");

View File

@ -180,16 +180,16 @@ static struct ebt_match filter_stp =
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ebt_stp_init(void)
{
return ebt_register_match(&filter_stp);
}
static void __exit fini(void)
static void __exit ebt_stp_fini(void)
{
ebt_unregister_match(&filter_stp);
}
module_init(init);
module_exit(fini);
module_init(ebt_stp_init);
module_exit(ebt_stp_fini);
MODULE_LICENSE("GPL");

View File

@ -281,7 +281,7 @@ static struct nf_logger ebt_ulog_logger = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ebt_ulog_init(void)
{
int i, ret = 0;
@ -316,7 +316,7 @@ static int __init init(void)
return ret;
}
static void __exit fini(void)
static void __exit ebt_ulog_fini(void)
{
ebt_ulog_buff_t *ub;
int i;
@ -337,8 +337,8 @@ static void __exit fini(void)
sock_release(ebtulognl->sk_socket);
}
module_init(init);
module_exit(fini);
module_init(ebt_ulog_init);
module_exit(ebt_ulog_fini);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Bart De Schuymer <bdschuym@pandora.be>");
MODULE_DESCRIPTION("ebtables userspace logging module for bridged Ethernet"

View File

@ -178,7 +178,7 @@ static struct ebt_match filter_vlan = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ebt_vlan_init(void)
{
DEBUG_MSG("ebtables 802.1Q extension module v"
MODULE_VERS "\n");
@ -186,10 +186,10 @@ static int __init init(void)
return ebt_register_match(&filter_vlan);
}
static void __exit fini(void)
static void __exit ebt_vlan_fini(void)
{
ebt_unregister_match(&filter_vlan);
}
module_init(init);
module_exit(fini);
module_init(ebt_vlan_init);
module_exit(ebt_vlan_fini);

View File

@ -62,7 +62,7 @@ static int ebt_broute(struct sk_buff **pskb)
return 0; /* bridge it */
}
static int __init init(void)
static int __init ebtable_broute_init(void)
{
int ret;
@ -74,13 +74,13 @@ static int __init init(void)
return ret;
}
static void __exit fini(void)
static void __exit ebtable_broute_fini(void)
{
br_should_route_hook = NULL;
synchronize_net();
ebt_unregister_table(&broute_table);
}
module_init(init);
module_exit(fini);
module_init(ebtable_broute_init);
module_exit(ebtable_broute_fini);
MODULE_LICENSE("GPL");

View File

@ -91,7 +91,7 @@ static struct nf_hook_ops ebt_ops_filter[] = {
},
};
static int __init init(void)
static int __init ebtable_filter_init(void)
{
int i, j, ret;
@ -109,7 +109,7 @@ static int __init init(void)
return ret;
}
static void __exit fini(void)
static void __exit ebtable_filter_fini(void)
{
int i;
@ -118,6 +118,6 @@ static void __exit fini(void)
ebt_unregister_table(&frame_filter);
}
module_init(init);
module_exit(fini);
module_init(ebtable_filter_init);
module_exit(ebtable_filter_fini);
MODULE_LICENSE("GPL");

View File

@ -98,7 +98,7 @@ static struct nf_hook_ops ebt_ops_nat[] = {
},
};
static int __init init(void)
static int __init ebtable_nat_init(void)
{
int i, ret, j;
@ -116,7 +116,7 @@ static int __init init(void)
return ret;
}
static void __exit fini(void)
static void __exit ebtable_nat_fini(void)
{
int i;
@ -125,6 +125,6 @@ static void __exit fini(void)
ebt_unregister_table(&frame_nat);
}
module_init(init);
module_exit(fini);
module_init(ebtable_nat_init);
module_exit(ebtable_nat_fini);
MODULE_LICENSE("GPL");

View File

@ -1487,7 +1487,7 @@ static struct nf_sockopt_ops ebt_sockopts =
.get = do_ebt_get_ctl,
};
static int __init init(void)
static int __init ebtables_init(void)
{
int ret;
@ -1501,7 +1501,7 @@ static int __init init(void)
return 0;
}
static void __exit fini(void)
static void __exit ebtables_fini(void)
{
nf_unregister_sockopt(&ebt_sockopts);
printk(KERN_NOTICE "Ebtables v2.0 unregistered\n");
@ -1516,6 +1516,6 @@ EXPORT_SYMBOL(ebt_unregister_watcher);
EXPORT_SYMBOL(ebt_register_target);
EXPORT_SYMBOL(ebt_unregister_target);
EXPORT_SYMBOL(ebt_do_table);
module_init(init);
module_exit(fini);
module_init(ebtables_init);
module_exit(ebtables_fini);
MODULE_LICENSE("GPL");

View File

@ -187,6 +187,99 @@ static void sock_disable_timestamp(struct sock *sk)
}
int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
{
int err = 0;
int skb_len;
/* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
number of warnings when compiling with -W --ANK
*/
if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
(unsigned)sk->sk_rcvbuf) {
err = -ENOMEM;
goto out;
}
/* It would be deadlock, if sock_queue_rcv_skb is used
with socket lock! We assume that users of this
function are lock free.
*/
err = sk_filter(sk, skb, 1);
if (err)
goto out;
skb->dev = NULL;
skb_set_owner_r(skb, sk);
/* Cache the SKB length before we tack it onto the receive
* queue. Once it is added it no longer belongs to us and
* may be freed by other threads of control pulling packets
* from the queue.
*/
skb_len = skb->len;
skb_queue_tail(&sk->sk_receive_queue, skb);
if (!sock_flag(sk, SOCK_DEAD))
sk->sk_data_ready(sk, skb_len);
out:
return err;
}
EXPORT_SYMBOL(sock_queue_rcv_skb);
int sk_receive_skb(struct sock *sk, struct sk_buff *skb)
{
int rc = NET_RX_SUCCESS;
if (sk_filter(sk, skb, 0))
goto discard_and_relse;
skb->dev = NULL;
bh_lock_sock(sk);
if (!sock_owned_by_user(sk))
rc = sk->sk_backlog_rcv(sk, skb);
else
sk_add_backlog(sk, skb);
bh_unlock_sock(sk);
out:
sock_put(sk);
return rc;
discard_and_relse:
kfree_skb(skb);
goto out;
}
EXPORT_SYMBOL(sk_receive_skb);
struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie)
{
struct dst_entry *dst = sk->sk_dst_cache;
if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) {
sk->sk_dst_cache = NULL;
dst_release(dst);
return NULL;
}
return dst;
}
EXPORT_SYMBOL(__sk_dst_check);
struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie)
{
struct dst_entry *dst = sk_dst_get(sk);
if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) {
sk_dst_reset(sk);
dst_release(dst);
return NULL;
}
return dst;
}
EXPORT_SYMBOL(sk_dst_check);
/*
* This is meant for all protocols to use and covers goings on
* at the socket level. Everything here is generic.

View File

@ -133,7 +133,7 @@ static struct nf_hook_ops dnrmg_ops = {
.priority = NF_DN_PRI_DNRTMSG,
};
static int __init init(void)
static int __init dn_rtmsg_init(void)
{
int rv = 0;
@ -152,7 +152,7 @@ static int __init init(void)
return rv;
}
static void __exit fini(void)
static void __exit dn_rtmsg_fini(void)
{
nf_unregister_hook(&dnrmg_ops);
sock_release(dnrmg->sk_socket);
@ -164,6 +164,6 @@ MODULE_AUTHOR("Steven Whitehouse <steve@chygwyn.com>");
MODULE_LICENSE("GPL");
MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NETLINK_DNRTMSG);
module_init(init);
module_exit(fini);
module_init(dn_rtmsg_init);
module_exit(dn_rtmsg_fini);

View File

@ -42,6 +42,7 @@
#include <linux/spinlock.h>
#include <linux/rcupdate.h>
#include <linux/bitops.h>
#include <linux/mutex.h>
#include <asm/uaccess.h>
#include <asm/system.h>
@ -49,6 +50,7 @@
static const struct proto_ops econet_ops;
static struct hlist_head econet_sklist;
static DEFINE_RWLOCK(econet_lock);
static DEFINE_MUTEX(econet_mutex);
/* Since there are only 256 possible network numbers (or fewer, depends
how you count) it makes sense to use a simple lookup table. */
@ -124,6 +126,8 @@ static int econet_recvmsg(struct kiocb *iocb, struct socket *sock,
msg->msg_namelen = sizeof(struct sockaddr_ec);
mutex_lock(&econet_mutex);
/*
* Call the generic datagram receiver. This handles all sorts
* of horrible races and re-entrancy so we can forget about it
@ -174,6 +178,7 @@ static int econet_recvmsg(struct kiocb *iocb, struct socket *sock,
out_free:
skb_free_datagram(sk, skb);
out:
mutex_unlock(&econet_mutex);
return err;
}
@ -184,8 +189,8 @@ static int econet_recvmsg(struct kiocb *iocb, struct socket *sock,
static int econet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{
struct sockaddr_ec *sec = (struct sockaddr_ec *)uaddr;
struct sock *sk=sock->sk;
struct econet_sock *eo = ec_sk(sk);
struct sock *sk;
struct econet_sock *eo;
/*
* Check legality
@ -195,11 +200,18 @@ static int econet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len
sec->sec_family != AF_ECONET)
return -EINVAL;
mutex_lock(&econet_mutex);
sk = sock->sk;
eo = ec_sk(sk);
eo->cb = sec->cb;
eo->port = sec->port;
eo->station = sec->addr.station;
eo->net = sec->addr.net;
mutex_unlock(&econet_mutex);
return 0;
}
@ -284,6 +296,8 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
* Get and verify the address.
*/
mutex_lock(&econet_mutex);
if (saddr == NULL) {
struct econet_sock *eo = ec_sk(sk);
@ -292,8 +306,10 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
port = eo->port;
cb = eo->cb;
} else {
if (msg->msg_namelen < sizeof(struct sockaddr_ec))
if (msg->msg_namelen < sizeof(struct sockaddr_ec)) {
mutex_unlock(&econet_mutex);
return -EINVAL;
}
addr.station = saddr->addr.station;
addr.net = saddr->addr.net;
port = saddr->port;
@ -304,19 +320,21 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
dev = net2dev_map[addr.net];
/* If not directly reachable, use some default */
if (dev == NULL)
{
if (dev == NULL) {
dev = net2dev_map[0];
/* No interfaces at all? */
if (dev == NULL)
if (dev == NULL) {
mutex_unlock(&econet_mutex);
return -ENETDOWN;
}
}
if (len + 15 > dev->mtu)
if (len + 15 > dev->mtu) {
mutex_unlock(&econet_mutex);
return -EMSGSIZE;
}
if (dev->type == ARPHRD_ECONET)
{
if (dev->type == ARPHRD_ECONET) {
/* Real hardware Econet. We're not worthy etc. */
#ifdef CONFIG_ECONET_NATIVE
unsigned short proto = 0;
@ -374,6 +392,7 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
dev_queue_xmit(skb);
dev_put(dev);
mutex_unlock(&econet_mutex);
return(len);
out_free:
@ -384,14 +403,18 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
#else
err = -EPROTOTYPE;
#endif
mutex_unlock(&econet_mutex);
return err;
}
#ifdef CONFIG_ECONET_AUNUDP
/* AUN virtual Econet. */
if (udpsock == NULL)
if (udpsock == NULL) {
mutex_unlock(&econet_mutex);
return -ENETDOWN; /* No socket - can't send */
}
/* Make up a UDP datagram and hand it off to some higher intellect. */
@ -438,8 +461,10 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
void __user *base = msg->msg_iov[i].iov_base;
size_t len = msg->msg_iov[i].iov_len;
/* Check it now since we switch to KERNEL_DS later. */
if (!access_ok(VERIFY_READ, base, len))
if (!access_ok(VERIFY_READ, base, len)) {
mutex_unlock(&econet_mutex);
return -EFAULT;
}
iov[i+1].iov_base = base;
iov[i+1].iov_len = len;
size += len;
@ -447,8 +472,11 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
/* Get a skbuff (no data, just holds our cb information) */
if ((skb = sock_alloc_send_skb(sk, 0,
msg->msg_flags & MSG_DONTWAIT, &err)) == NULL)
msg->msg_flags & MSG_DONTWAIT,
&err)) == NULL) {
mutex_unlock(&econet_mutex);
return err;
}
eb = (struct ec_cb *)&skb->cb;
@ -475,6 +503,8 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
#else
err = -EPROTOTYPE;
#endif
mutex_unlock(&econet_mutex);
return err;
}
@ -485,18 +515,25 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
static int econet_getname(struct socket *sock, struct sockaddr *uaddr,
int *uaddr_len, int peer)
{
struct sock *sk = sock->sk;
struct econet_sock *eo = ec_sk(sk);
struct sock *sk;
struct econet_sock *eo;
struct sockaddr_ec *sec = (struct sockaddr_ec *)uaddr;
if (peer)
return -EOPNOTSUPP;
mutex_lock(&econet_mutex);
sk = sock->sk;
eo = ec_sk(sk);
sec->sec_family = AF_ECONET;
sec->port = eo->port;
sec->addr.station = eo->station;
sec->addr.net = eo->net;
mutex_unlock(&econet_mutex);
*uaddr_len = sizeof(*sec);
return 0;
}
@ -522,10 +559,13 @@ static void econet_destroy_timer(unsigned long data)
static int econet_release(struct socket *sock)
{
struct sock *sk = sock->sk;
struct sock *sk;
mutex_lock(&econet_mutex);
sk = sock->sk;
if (!sk)
return 0;
goto out_unlock;
econet_remove_socket(&econet_sklist, sk);
@ -549,10 +589,14 @@ static int econet_release(struct socket *sock)
sk->sk_timer.expires = jiffies + HZ;
sk->sk_timer.function = econet_destroy_timer;
add_timer(&sk->sk_timer);
return 0;
goto out_unlock;
}
sk_free(sk);
out_unlock:
mutex_unlock(&econet_mutex);
return 0;
}
@ -608,6 +652,7 @@ static int ec_dev_ioctl(struct socket *sock, unsigned int cmd, void __user *arg)
struct ec_device *edev;
struct net_device *dev;
struct sockaddr_ec *sec;
int err;
/*
* Fetch the caller's info block into kernel space
@ -621,38 +666,35 @@ static int ec_dev_ioctl(struct socket *sock, unsigned int cmd, void __user *arg)
sec = (struct sockaddr_ec *)&ifr.ifr_addr;
switch (cmd)
{
mutex_lock(&econet_mutex);
err = 0;
switch (cmd) {
case SIOCSIFADDR:
edev = dev->ec_ptr;
if (edev == NULL)
{
if (edev == NULL) {
/* Magic up a new one. */
edev = kmalloc(sizeof(struct ec_device), GFP_KERNEL);
if (edev == NULL) {
printk("af_ec: memory squeeze.\n");
dev_put(dev);
return -ENOMEM;
err = -ENOMEM;
break;
}
memset(edev, 0, sizeof(struct ec_device));
dev->ec_ptr = edev;
}
else
} else
net2dev_map[edev->net] = NULL;
edev->station = sec->addr.station;
edev->net = sec->addr.net;
net2dev_map[sec->addr.net] = dev;
if (!net2dev_map[0])
net2dev_map[0] = dev;
dev_put(dev);
return 0;
break;
case SIOCGIFADDR:
edev = dev->ec_ptr;
if (edev == NULL)
{
dev_put(dev);
return -ENODEV;
if (edev == NULL) {
err = -ENODEV;
break;
}
memset(sec, 0, sizeof(struct sockaddr_ec));
sec->addr.station = edev->station;
@ -660,12 +702,19 @@ static int ec_dev_ioctl(struct socket *sock, unsigned int cmd, void __user *arg)
sec->sec_family = AF_ECONET;
dev_put(dev);
if (copy_to_user(arg, &ifr, sizeof(struct ifreq)))
return -EFAULT;
return 0;
err = -EFAULT;
break;
default:
err = -EINVAL;
break;
}
mutex_unlock(&econet_mutex);
dev_put(dev);
return -EINVAL;
return err;
}
/*
@ -699,7 +748,7 @@ static struct net_proto_family econet_family_ops = {
.owner = THIS_MODULE,
};
static const struct proto_ops SOCKOPS_WRAPPED(econet_ops) = {
static const struct proto_ops econet_ops = {
.family = PF_ECONET,
.owner = THIS_MODULE,
.release = econet_release,
@ -720,9 +769,6 @@ static const struct proto_ops SOCKOPS_WRAPPED(econet_ops) = {
.sendpage = sock_no_sendpage,
};
#include <linux/smp_lock.h>
SOCKOPS_WRAP(econet, PF_ECONET);
#if defined(CONFIG_ECONET_AUNUDP) || defined(CONFIG_ECONET_NATIVE)
/*
* Find the listening socket, if any, for the given data.

View File

@ -235,6 +235,7 @@ config IP_PNP_RARP
# bool ' IP: ARP support' CONFIG_IP_PNP_ARP
config NET_IPIP
tristate "IP: tunneling"
select INET_TUNNEL
---help---
Tunneling means encapsulating data of one protocol type within
another protocol and sending it over a channel that understands the
@ -395,7 +396,7 @@ config INET_ESP
config INET_IPCOMP
tristate "IP: IPComp transformation"
select XFRM
select INET_TUNNEL
select INET_XFRM_TUNNEL
select CRYPTO
select CRYPTO_DEFLATE
---help---
@ -404,14 +405,14 @@ config INET_IPCOMP
If unsure, say Y.
config INET_XFRM_TUNNEL
tristate
select INET_TUNNEL
default n
config INET_TUNNEL
tristate "IP: tunnel transformation"
select XFRM
---help---
Support for generic IP tunnel transformation, which is required by
the IP tunneling module as well as tunnel mode IPComp.
If unsure, say Y.
tristate
default n
config INET_DIAG
tristate "INET: socket monitoring interface"

View File

@ -22,7 +22,8 @@ obj-$(CONFIG_SYN_COOKIES) += syncookies.o
obj-$(CONFIG_INET_AH) += ah4.o
obj-$(CONFIG_INET_ESP) += esp4.o
obj-$(CONFIG_INET_IPCOMP) += ipcomp.o
obj-$(CONFIG_INET_TUNNEL) += xfrm4_tunnel.o
obj-$(CONFIG_INET_XFRM_TUNNEL) += xfrm4_tunnel.o
obj-$(CONFIG_INET_TUNNEL) += tunnel4.o
obj-$(CONFIG_IP_PNP) += ipconfig.o
obj-$(CONFIG_IP_ROUTE_MULTIPATH_RR) += multipath_rr.o
obj-$(CONFIG_IP_ROUTE_MULTIPATH_RANDOM) += multipath_random.o

View File

@ -114,7 +114,6 @@
#include <net/sock.h>
#include <net/ip.h>
#include <net/icmp.h>
#include <net/protocol.h>
#include <net/ipip.h>
#include <net/inet_ecn.h>
#include <net/xfrm.h>
@ -274,7 +273,7 @@ static void ipip_tunnel_uninit(struct net_device *dev)
dev_put(dev);
}
static void ipip_err(struct sk_buff *skb, u32 info)
static int ipip_err(struct sk_buff *skb, u32 info)
{
#ifndef I_WISH_WORLD_WERE_PERFECT
@ -286,21 +285,22 @@ static void ipip_err(struct sk_buff *skb, u32 info)
int type = skb->h.icmph->type;
int code = skb->h.icmph->code;
struct ip_tunnel *t;
int err;
switch (type) {
default:
case ICMP_PARAMETERPROB:
return;
return 0;
case ICMP_DEST_UNREACH:
switch (code) {
case ICMP_SR_FAILED:
case ICMP_PORT_UNREACH:
/* Impossible event. */
return;
return 0;
case ICMP_FRAG_NEEDED:
/* Soft state for pmtu is maintained by IP core. */
return;
return 0;
default:
/* All others are translated to HOST_UNREACH.
rfc2003 contains "deep thoughts" about NET_UNREACH,
@ -311,14 +311,18 @@ static void ipip_err(struct sk_buff *skb, u32 info)
break;
case ICMP_TIME_EXCEEDED:
if (code != ICMP_EXC_TTL)
return;
return 0;
break;
}
err = -ENOENT;
read_lock(&ipip_lock);
t = ipip_tunnel_lookup(iph->daddr, iph->saddr);
if (t == NULL || t->parms.iph.daddr == 0)
goto out;
err = 0;
if (t->parms.iph.ttl == 0 && type == ICMP_TIME_EXCEEDED)
goto out;
@ -329,7 +333,7 @@ static void ipip_err(struct sk_buff *skb, u32 info)
t->err_time = jiffies;
out:
read_unlock(&ipip_lock);
return;
return err;
#else
struct iphdr *iph = (struct iphdr*)dp;
int hlen = iph->ihl<<2;
@ -344,15 +348,15 @@ static void ipip_err(struct sk_buff *skb, u32 info)
struct rtable *rt;
if (len < hlen + sizeof(struct iphdr))
return;
return 0;
eiph = (struct iphdr*)(dp + hlen);
switch (type) {
default:
return;
return 0;
case ICMP_PARAMETERPROB:
if (skb->h.icmph->un.gateway < hlen)
return;
return 0;
/* So... This guy found something strange INSIDE encapsulated
packet. Well, he is fool, but what can we do ?
@ -366,16 +370,16 @@ static void ipip_err(struct sk_buff *skb, u32 info)
case ICMP_SR_FAILED:
case ICMP_PORT_UNREACH:
/* Impossible event. */
return;
return 0;
case ICMP_FRAG_NEEDED:
/* And it is the only really necessary thing :-) */
rel_info = ntohs(skb->h.icmph->un.frag.mtu);
if (rel_info < hlen+68)
return;
return 0;
rel_info -= hlen;
/* BSD 4.2 MORE DOES NOT EXIST IN NATURE. */
if (rel_info > ntohs(eiph->tot_len))
return;
return 0;
break;
default:
/* All others are translated to HOST_UNREACH.
@ -389,14 +393,14 @@ static void ipip_err(struct sk_buff *skb, u32 info)
break;
case ICMP_TIME_EXCEEDED:
if (code != ICMP_EXC_TTL)
return;
return 0;
break;
}
/* Prepare fake skb to feed it to icmp_send */
skb2 = skb_clone(skb, GFP_ATOMIC);
if (skb2 == NULL)
return;
return 0;
dst_release(skb2->dst);
skb2->dst = NULL;
skb_pull(skb2, skb->data - (u8*)eiph);
@ -409,7 +413,7 @@ static void ipip_err(struct sk_buff *skb, u32 info)
fl.proto = IPPROTO_IPIP;
if (ip_route_output_key(&rt, &key)) {
kfree_skb(skb2);
return;
return 0;
}
skb2->dev = rt->u.dst.dev;
@ -424,14 +428,14 @@ static void ipip_err(struct sk_buff *skb, u32 info)
rt->u.dst.dev->type != ARPHRD_TUNNEL) {
ip_rt_put(rt);
kfree_skb(skb2);
return;
return 0;
}
} else {
ip_rt_put(rt);
if (ip_route_input(skb2, eiph->daddr, eiph->saddr, eiph->tos, skb2->dev) ||
skb2->dst->dev->type != ARPHRD_TUNNEL) {
kfree_skb(skb2);
return;
return 0;
}
}
@ -439,7 +443,7 @@ static void ipip_err(struct sk_buff *skb, u32 info)
if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) {
if (rel_info > dst_mtu(skb2->dst)) {
kfree_skb(skb2);
return;
return 0;
}
skb2->dst->ops->update_pmtu(skb2->dst, rel_info);
rel_info = htonl(rel_info);
@ -453,7 +457,7 @@ static void ipip_err(struct sk_buff *skb, u32 info)
icmp_send(skb2, rel_type, rel_code, rel_info);
kfree_skb(skb2);
return;
return 0;
#endif
}
@ -855,39 +859,12 @@ static int __init ipip_fb_tunnel_init(struct net_device *dev)
return 0;
}
#ifdef CONFIG_INET_TUNNEL
static struct xfrm_tunnel ipip_handler = {
.handler = ipip_rcv,
.err_handler = ipip_err,
.priority = 1,
};
static inline int ipip_register(void)
{
return xfrm4_tunnel_register(&ipip_handler);
}
static inline int ipip_unregister(void)
{
return xfrm4_tunnel_deregister(&ipip_handler);
}
#else
static struct net_protocol ipip_protocol = {
.handler = ipip_rcv,
.err_handler = ipip_err,
.no_policy = 1,
};
static inline int ipip_register(void)
{
return inet_add_protocol(&ipip_protocol, IPPROTO_IPIP);
}
static inline int ipip_unregister(void)
{
return inet_del_protocol(&ipip_protocol, IPPROTO_IPIP);
}
#endif
static char banner[] __initdata =
KERN_INFO "IPv4 over IPv4 tunneling driver\n";
@ -897,7 +874,7 @@ static int __init ipip_init(void)
printk(banner);
if (ipip_register() < 0) {
if (xfrm4_tunnel_register(&ipip_handler)) {
printk(KERN_INFO "ipip init: can't register tunnel\n");
return -EAGAIN;
}
@ -919,7 +896,7 @@ static int __init ipip_init(void)
err2:
free_netdev(ipip_fb_tunnel_dev);
err1:
ipip_unregister();
xfrm4_tunnel_deregister(&ipip_handler);
goto out;
}
@ -939,7 +916,7 @@ static void __exit ipip_destroy_tunnels(void)
static void __exit ipip_fini(void)
{
if (ipip_unregister() < 0)
if (xfrm4_tunnel_deregister(&ipip_handler))
printk(KERN_INFO "ipip close: can't deregister tunnel\n");
rtnl_lock();

View File

@ -167,15 +167,15 @@ static struct nf_queue_rerouter ip_reroute = {
.reroute = queue_reroute,
};
static int init(void)
static int ipv4_netfilter_init(void)
{
return nf_register_queue_rerouter(PF_INET, &ip_reroute);
}
static void fini(void)
static void ipv4_netfilter_fini(void)
{
nf_unregister_queue_rerouter(PF_INET);
}
module_init(init);
module_exit(fini);
module_init(ipv4_netfilter_init);
module_exit(ipv4_netfilter_fini);

View File

@ -1166,7 +1166,7 @@ static struct nf_sockopt_ops arpt_sockopts = {
.get = do_arpt_get_ctl,
};
static int __init init(void)
static int __init arp_tables_init(void)
{
int ret;
@ -1187,7 +1187,7 @@ static int __init init(void)
return 0;
}
static void __exit fini(void)
static void __exit arp_tables_fini(void)
{
nf_unregister_sockopt(&arpt_sockopts);
xt_proto_fini(NF_ARP);
@ -1197,5 +1197,5 @@ EXPORT_SYMBOL(arpt_register_table);
EXPORT_SYMBOL(arpt_unregister_table);
EXPORT_SYMBOL(arpt_do_table);
module_init(init);
module_exit(fini);
module_init(arp_tables_init);
module_exit(arp_tables_fini);

View File

@ -89,7 +89,7 @@ static struct arpt_target arpt_mangle_reg = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init arpt_mangle_init(void)
{
if (arpt_register_target(&arpt_mangle_reg))
return -EINVAL;
@ -97,10 +97,10 @@ static int __init init(void)
return 0;
}
static void __exit fini(void)
static void __exit arpt_mangle_fini(void)
{
arpt_unregister_target(&arpt_mangle_reg);
}
module_init(init);
module_exit(fini);
module_init(arpt_mangle_init);
module_exit(arpt_mangle_fini);

View File

@ -179,7 +179,7 @@ static struct nf_hook_ops arpt_ops[] = {
},
};
static int __init init(void)
static int __init arptable_filter_init(void)
{
int ret, i;
@ -201,7 +201,7 @@ static int __init init(void)
return ret;
}
static void __exit fini(void)
static void __exit arptable_filter_fini(void)
{
unsigned int i;
@ -211,5 +211,5 @@ static void __exit fini(void)
arpt_unregister_table(&packet_filter);
}
module_init(init);
module_exit(fini);
module_init(arptable_filter_init);
module_exit(arptable_filter_fini);

View File

@ -153,13 +153,13 @@ static struct ip_conntrack_helper amanda_helper = {
},
};
static void __exit fini(void)
static void __exit ip_conntrack_amanda_fini(void)
{
ip_conntrack_helper_unregister(&amanda_helper);
kfree(amanda_buffer);
}
static int __init init(void)
static int __init ip_conntrack_amanda_init(void)
{
int ret;
@ -177,5 +177,5 @@ static int __init init(void)
}
module_init(init);
module_exit(fini);
module_init(ip_conntrack_amanda_init);
module_exit(ip_conntrack_amanda_fini);

View File

@ -453,7 +453,7 @@ static struct ip_conntrack_helper ftp[MAX_PORTS];
static char ftp_names[MAX_PORTS][sizeof("ftp-65535")];
/* Not __exit: called from init() */
static void fini(void)
static void ip_conntrack_ftp_fini(void)
{
int i;
for (i = 0; i < ports_c; i++) {
@ -465,7 +465,7 @@ static void fini(void)
kfree(ftp_buffer);
}
static int __init init(void)
static int __init ip_conntrack_ftp_init(void)
{
int i, ret;
char *tmpname;
@ -499,12 +499,12 @@ static int __init init(void)
ret = ip_conntrack_helper_register(&ftp[i]);
if (ret) {
fini();
ip_conntrack_ftp_fini();
return ret;
}
}
return 0;
}
module_init(init);
module_exit(fini);
module_init(ip_conntrack_ftp_init);
module_exit(ip_conntrack_ftp_fini);

View File

@ -766,7 +766,7 @@ extern void ip_ct_proto_gre_fini(void);
extern int __init ip_ct_proto_gre_init(void);
/* ip_conntrack_pptp initialization */
static int __init init(void)
static int __init ip_conntrack_helper_pptp_init(void)
{
int retcode;
@ -786,15 +786,15 @@ static int __init init(void)
return 0;
}
static void __exit fini(void)
static void __exit ip_conntrack_helper_pptp_fini(void)
{
ip_conntrack_helper_unregister(&pptp);
ip_ct_proto_gre_fini();
printk("ip_conntrack_pptp version %s unloaded\n", IP_CT_PPTP_VERSION);
}
module_init(init);
module_exit(fini);
module_init(ip_conntrack_helper_pptp_init);
module_exit(ip_conntrack_helper_pptp_fini);
EXPORT_SYMBOL(ip_nat_pptp_hook_outbound);
EXPORT_SYMBOL(ip_nat_pptp_hook_inbound);

View File

@ -242,9 +242,9 @@ static int help(struct sk_buff **pskb,
static struct ip_conntrack_helper irc_helpers[MAX_PORTS];
static char irc_names[MAX_PORTS][sizeof("irc-65535")];
static void fini(void);
static void ip_conntrack_irc_fini(void);
static int __init init(void)
static int __init ip_conntrack_irc_init(void)
{
int i, ret;
struct ip_conntrack_helper *hlpr;
@ -288,7 +288,7 @@ static int __init init(void)
if (ret) {
printk("ip_conntrack_irc: ERROR registering port %d\n",
ports[i]);
fini();
ip_conntrack_irc_fini();
return -EBUSY;
}
}
@ -297,7 +297,7 @@ static int __init init(void)
/* This function is intentionally _NOT_ defined as __exit, because
* it is needed by the init function */
static void fini(void)
static void ip_conntrack_irc_fini(void)
{
int i;
for (i = 0; i < ports_c; i++) {
@ -308,5 +308,5 @@ static void fini(void)
kfree(irc_buffer);
}
module_init(init);
module_exit(fini);
module_init(ip_conntrack_irc_init);
module_exit(ip_conntrack_irc_fini);

View File

@ -127,16 +127,16 @@ static struct ip_conntrack_helper helper = {
.help = help,
};
static int __init init(void)
static int __init ip_conntrack_netbios_ns_init(void)
{
helper.timeout = timeout;
return ip_conntrack_helper_register(&helper);
}
static void __exit fini(void)
static void __exit ip_conntrack_netbios_ns_fini(void)
{
ip_conntrack_helper_unregister(&helper);
}
module_init(init);
module_exit(fini);
module_init(ip_conntrack_netbios_ns_init);
module_exit(ip_conntrack_netbios_ns_fini);

View File

@ -609,7 +609,7 @@ static ctl_table ip_ct_net_table[] = {
static struct ctl_table_header *ip_ct_sysctl_header;
#endif
static int __init init(void)
static int __init ip_conntrack_proto_sctp_init(void)
{
int ret;
@ -640,7 +640,7 @@ static int __init init(void)
return ret;
}
static void __exit fini(void)
static void __exit ip_conntrack_proto_sctp_fini(void)
{
ip_conntrack_protocol_unregister(&ip_conntrack_protocol_sctp);
#ifdef CONFIG_SYSCTL
@ -649,8 +649,8 @@ static void __exit fini(void)
DEBUGP("SCTP conntrack module unloaded\n");
}
module_init(init);
module_exit(fini);
module_init(ip_conntrack_proto_sctp_init);
module_exit(ip_conntrack_proto_sctp_fini);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Kiran Kumar Immidi");

View File

@ -929,18 +929,18 @@ void ip_conntrack_protocol_unregister(struct ip_conntrack_protocol *proto)
ip_ct_iterate_cleanup(kill_proto, &proto->proto);
}
static int __init init(void)
static int __init ip_conntrack_standalone_init(void)
{
return init_or_cleanup(1);
}
static void __exit fini(void)
static void __exit ip_conntrack_standalone_fini(void)
{
init_or_cleanup(0);
}
module_init(init);
module_exit(fini);
module_init(ip_conntrack_standalone_init);
module_exit(ip_conntrack_standalone_fini);
/* Some modules need us, but don't depend directly on any symbol.
They should call this. */

View File

@ -103,7 +103,7 @@ static int tftp_help(struct sk_buff **pskb,
static struct ip_conntrack_helper tftp[MAX_PORTS];
static char tftp_names[MAX_PORTS][sizeof("tftp-65535")];
static void fini(void)
static void ip_conntrack_tftp_fini(void)
{
int i;
@ -114,7 +114,7 @@ static void fini(void)
}
}
static int __init init(void)
static int __init ip_conntrack_tftp_init(void)
{
int i, ret;
char *tmpname;
@ -148,12 +148,12 @@ static int __init init(void)
if (ret) {
printk("ERROR registering helper for port %d\n",
ports[i]);
fini();
ip_conntrack_tftp_fini();
return(ret);
}
}
return(0);
}
module_init(init);
module_exit(fini);
module_init(ip_conntrack_tftp_init);
module_exit(ip_conntrack_tftp_fini);

View File

@ -68,19 +68,19 @@ static unsigned int help(struct sk_buff **pskb,
return ret;
}
static void __exit fini(void)
static void __exit ip_nat_amanda_fini(void)
{
ip_nat_amanda_hook = NULL;
/* Make sure noone calls it, meanwhile. */
synchronize_net();
}
static int __init init(void)
static int __init ip_nat_amanda_init(void)
{
BUG_ON(ip_nat_amanda_hook);
ip_nat_amanda_hook = help;
return 0;
}
module_init(init);
module_exit(fini);
module_init(ip_nat_amanda_init);
module_exit(ip_nat_amanda_fini);

View File

@ -154,14 +154,14 @@ static unsigned int ip_nat_ftp(struct sk_buff **pskb,
return NF_ACCEPT;
}
static void __exit fini(void)
static void __exit ip_nat_ftp_fini(void)
{
ip_nat_ftp_hook = NULL;
/* Make sure noone calls it, meanwhile. */
synchronize_net();
}
static int __init init(void)
static int __init ip_nat_ftp_init(void)
{
BUG_ON(ip_nat_ftp_hook);
ip_nat_ftp_hook = ip_nat_ftp;
@ -177,5 +177,5 @@ static int warn_set(const char *val, struct kernel_param *kp)
}
module_param_call(ports, warn_set, NULL, NULL, 0);
module_init(init);
module_exit(fini);
module_init(ip_nat_ftp_init);
module_exit(ip_nat_ftp_fini);

View File

@ -370,7 +370,7 @@ pptp_inbound_pkt(struct sk_buff **pskb,
extern int __init ip_nat_proto_gre_init(void);
extern void __exit ip_nat_proto_gre_fini(void);
static int __init init(void)
static int __init ip_nat_helper_pptp_init(void)
{
int ret;
@ -396,7 +396,7 @@ static int __init init(void)
return 0;
}
static void __exit fini(void)
static void __exit ip_nat_helper_pptp_fini(void)
{
DEBUGP("cleanup_module\n" );
@ -412,5 +412,5 @@ static void __exit fini(void)
printk("ip_nat_pptp version %s unloaded\n", IP_NAT_PPTP_VERSION);
}
module_init(init);
module_exit(fini);
module_init(ip_nat_helper_pptp_init);
module_exit(ip_nat_helper_pptp_fini);

View File

@ -96,14 +96,14 @@ static unsigned int help(struct sk_buff **pskb,
return ret;
}
static void __exit fini(void)
static void __exit ip_nat_irc_fini(void)
{
ip_nat_irc_hook = NULL;
/* Make sure noone calls it, meanwhile. */
synchronize_net();
}
static int __init init(void)
static int __init ip_nat_irc_init(void)
{
BUG_ON(ip_nat_irc_hook);
ip_nat_irc_hook = help;
@ -119,5 +119,5 @@ static int warn_set(const char *val, struct kernel_param *kp)
}
module_param_call(ports, warn_set, NULL, NULL, 0);
module_init(init);
module_exit(fini);
module_init(ip_nat_irc_init);
module_exit(ip_nat_irc_fini);

View File

@ -1324,7 +1324,7 @@ static struct ip_conntrack_helper snmp_trap_helper = {
*
*****************************************************************************/
static int __init init(void)
static int __init ip_nat_snmp_basic_init(void)
{
int ret = 0;
@ -1339,13 +1339,13 @@ static int __init init(void)
return ret;
}
static void __exit fini(void)
static void __exit ip_nat_snmp_basic_fini(void)
{
ip_conntrack_helper_unregister(&snmp_helper);
ip_conntrack_helper_unregister(&snmp_trap_helper);
}
module_init(init);
module_exit(fini);
module_init(ip_nat_snmp_basic_init);
module_exit(ip_nat_snmp_basic_fini);
module_param(debug, bool, 0600);

View File

@ -425,17 +425,17 @@ static int init_or_cleanup(int init)
return ret;
}
static int __init init(void)
static int __init ip_nat_standalone_init(void)
{
return init_or_cleanup(1);
}
static void __exit fini(void)
static void __exit ip_nat_standalone_fini(void)
{
init_or_cleanup(0);
}
module_init(init);
module_exit(fini);
module_init(ip_nat_standalone_init);
module_exit(ip_nat_standalone_fini);
MODULE_LICENSE("GPL");

View File

@ -53,19 +53,19 @@ static unsigned int help(struct sk_buff **pskb,
return NF_ACCEPT;
}
static void __exit fini(void)
static void __exit ip_nat_tftp_fini(void)
{
ip_nat_tftp_hook = NULL;
/* Make sure noone calls it, meanwhile. */
synchronize_net();
}
static int __init init(void)
static int __init ip_nat_tftp_init(void)
{
BUG_ON(ip_nat_tftp_hook);
ip_nat_tftp_hook = help;
return 0;
}
module_init(init);
module_exit(fini);
module_init(ip_nat_tftp_init);
module_exit(ip_nat_tftp_fini);

View File

@ -717,13 +717,13 @@ init_or_cleanup(int init)
return status;
}
static int __init init(void)
static int __init ip_queue_init(void)
{
return init_or_cleanup(1);
}
static void __exit fini(void)
static void __exit ip_queue_fini(void)
{
init_or_cleanup(0);
}
@ -732,5 +732,5 @@ MODULE_DESCRIPTION("IPv4 packet queue handler");
MODULE_AUTHOR("James Morris <jmorris@intercode.com.au>");
MODULE_LICENSE("GPL");
module_init(init);
module_exit(fini);
module_init(ip_queue_init);
module_exit(ip_queue_fini);

View File

@ -1364,7 +1364,7 @@ static struct ipt_match icmp_matchstruct = {
.checkentry = icmp_checkentry,
};
static int __init init(void)
static int __init ip_tables_init(void)
{
int ret;
@ -1386,7 +1386,7 @@ static int __init init(void)
return 0;
}
static void __exit fini(void)
static void __exit ip_tables_fini(void)
{
nf_unregister_sockopt(&ipt_sockopts);
@ -1400,5 +1400,5 @@ static void __exit fini(void)
EXPORT_SYMBOL(ipt_register_table);
EXPORT_SYMBOL(ipt_unregister_table);
EXPORT_SYMBOL(ipt_do_table);
module_init(init);
module_exit(fini);
module_init(ip_tables_init);
module_exit(ip_tables_fini);

View File

@ -770,15 +770,15 @@ static int init_or_cleanup(int fini)
return -EINVAL;
}
static int __init init(void)
static int __init ipt_clusterip_init(void)
{
return init_or_cleanup(0);
}
static void __exit fini(void)
static void __exit ipt_clusterip_fini(void)
{
init_or_cleanup(1);
}
module_init(init);
module_exit(fini);
module_init(ipt_clusterip_init);
module_exit(ipt_clusterip_fini);

View File

@ -82,15 +82,15 @@ static struct ipt_target ipt_dscp_reg = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_dscp_init(void)
{
return ipt_register_target(&ipt_dscp_reg);
}
static void __exit fini(void)
static void __exit ipt_dscp_fini(void)
{
ipt_unregister_target(&ipt_dscp_reg);
}
module_init(init);
module_exit(fini);
module_init(ipt_dscp_init);
module_exit(ipt_dscp_fini);

View File

@ -151,15 +151,15 @@ static struct ipt_target ipt_ecn_reg = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_ecn_init(void)
{
return ipt_register_target(&ipt_ecn_reg);
}
static void __exit fini(void)
static void __exit ipt_ecn_fini(void)
{
ipt_unregister_target(&ipt_ecn_reg);
}
module_init(init);
module_exit(fini);
module_init(ipt_ecn_init);
module_exit(ipt_ecn_fini);

View File

@ -471,7 +471,7 @@ static struct nf_logger ipt_log_logger ={
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_log_init(void)
{
if (ipt_register_target(&ipt_log_reg))
return -EINVAL;
@ -485,11 +485,11 @@ static int __init init(void)
return 0;
}
static void __exit fini(void)
static void __exit ipt_log_fini(void)
{
nf_log_unregister_logger(&ipt_log_logger);
ipt_unregister_target(&ipt_log_reg);
}
module_init(init);
module_exit(fini);
module_init(ipt_log_init);
module_exit(ipt_log_fini);

View File

@ -175,7 +175,7 @@ static struct ipt_target masquerade = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_masquerade_init(void)
{
int ret;
@ -191,12 +191,12 @@ static int __init init(void)
return ret;
}
static void __exit fini(void)
static void __exit ipt_masquerade_fini(void)
{
ipt_unregister_target(&masquerade);
unregister_netdevice_notifier(&masq_dev_notifier);
unregister_inetaddr_notifier(&masq_inet_notifier);
}
module_init(init);
module_exit(fini);
module_init(ipt_masquerade_init);
module_exit(ipt_masquerade_fini);

View File

@ -98,15 +98,15 @@ static struct ipt_target target_module = {
.me = THIS_MODULE
};
static int __init init(void)
static int __init ipt_netmap_init(void)
{
return ipt_register_target(&target_module);
}
static void __exit fini(void)
static void __exit ipt_netmap_fini(void)
{
ipt_unregister_target(&target_module);
}
module_init(init);
module_exit(fini);
module_init(ipt_netmap_init);
module_exit(ipt_netmap_fini);

View File

@ -112,15 +112,15 @@ static struct ipt_target redirect_reg = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_redirect_init(void)
{
return ipt_register_target(&redirect_reg);
}
static void __exit fini(void)
static void __exit ipt_redirect_fini(void)
{
ipt_unregister_target(&redirect_reg);
}
module_init(init);
module_exit(fini);
module_init(ipt_redirect_init);
module_exit(ipt_redirect_fini);

View File

@ -313,15 +313,15 @@ static struct ipt_target ipt_reject_reg = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_reject_init(void)
{
return ipt_register_target(&ipt_reject_reg);
}
static void __exit fini(void)
static void __exit ipt_reject_fini(void)
{
ipt_unregister_target(&ipt_reject_reg);
}
module_init(init);
module_exit(fini);
module_init(ipt_reject_init);
module_exit(ipt_reject_fini);

View File

@ -189,16 +189,16 @@ static struct ipt_target same_reg = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_same_init(void)
{
return ipt_register_target(&same_reg);
}
static void __exit fini(void)
static void __exit ipt_same_fini(void)
{
ipt_unregister_target(&same_reg);
}
module_init(init);
module_exit(fini);
module_init(ipt_same_init);
module_exit(ipt_same_fini);

View File

@ -243,15 +243,15 @@ static struct ipt_target ipt_tcpmss_reg = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_tcpmss_init(void)
{
return ipt_register_target(&ipt_tcpmss_reg);
}
static void __exit fini(void)
static void __exit ipt_tcpmss_fini(void)
{
ipt_unregister_target(&ipt_tcpmss_reg);
}
module_init(init);
module_exit(fini);
module_init(ipt_tcpmss_init);
module_exit(ipt_tcpmss_fini);

View File

@ -81,15 +81,15 @@ static struct ipt_target ipt_tos_reg = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_tos_init(void)
{
return ipt_register_target(&ipt_tos_reg);
}
static void __exit fini(void)
static void __exit ipt_tos_fini(void)
{
ipt_unregister_target(&ipt_tos_reg);
}
module_init(init);
module_exit(fini);
module_init(ipt_tos_init);
module_exit(ipt_tos_fini);

View File

@ -94,15 +94,15 @@ static struct ipt_target ipt_TTL = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_ttl_init(void)
{
return ipt_register_target(&ipt_TTL);
}
static void __exit fini(void)
static void __exit ipt_ttl_fini(void)
{
ipt_unregister_target(&ipt_TTL);
}
module_init(init);
module_exit(fini);
module_init(ipt_ttl_init);
module_exit(ipt_ttl_fini);

View File

@ -374,7 +374,7 @@ static struct nf_logger ipt_ulog_logger = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_ulog_init(void)
{
int i;
@ -407,7 +407,7 @@ static int __init init(void)
return 0;
}
static void __exit fini(void)
static void __exit ipt_ulog_fini(void)
{
ulog_buff_t *ub;
int i;
@ -435,5 +435,5 @@ static void __exit fini(void)
}
module_init(init);
module_exit(fini);
module_init(ipt_ulog_init);
module_exit(ipt_ulog_fini);

View File

@ -51,15 +51,15 @@ static struct ipt_match addrtype_match = {
.me = THIS_MODULE
};
static int __init init(void)
static int __init ipt_addrtype_init(void)
{
return ipt_register_match(&addrtype_match);
}
static void __exit fini(void)
static void __exit ipt_addrtype_fini(void)
{
ipt_unregister_match(&addrtype_match);
}
module_init(init);
module_exit(fini);
module_init(ipt_addrtype_init);
module_exit(ipt_addrtype_fini);

View File

@ -96,15 +96,15 @@ static struct ipt_match ah_match = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_ah_init(void)
{
return ipt_register_match(&ah_match);
}
static void __exit cleanup(void)
static void __exit ipt_ah_fini(void)
{
ipt_unregister_match(&ah_match);
}
module_init(init);
module_exit(cleanup);
module_init(ipt_ah_init);
module_exit(ipt_ah_fini);

View File

@ -39,16 +39,16 @@ static struct ipt_match dscp_match = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_dscp_init(void)
{
return ipt_register_match(&dscp_match);
}
static void __exit fini(void)
static void __exit ipt_dscp_fini(void)
{
ipt_unregister_match(&dscp_match);
}
module_init(init);
module_exit(fini);
module_init(ipt_dscp_init);
module_exit(ipt_dscp_fini);

View File

@ -118,15 +118,15 @@ static struct ipt_match ecn_match = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_ecn_init(void)
{
return ipt_register_match(&ecn_match);
}
static void __exit fini(void)
static void __exit ipt_ecn_fini(void)
{
ipt_unregister_match(&ecn_match);
}
module_init(init);
module_exit(fini);
module_init(ipt_ecn_init);
module_exit(ipt_ecn_fini);

View File

@ -97,15 +97,15 @@ static struct ipt_match esp_match = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_esp_init(void)
{
return ipt_register_match(&esp_match);
}
static void __exit cleanup(void)
static void __exit ipt_esp_fini(void)
{
ipt_unregister_match(&esp_match);
}
module_init(init);
module_exit(cleanup);
module_init(ipt_esp_init);
module_exit(ipt_esp_fini);

View File

@ -719,15 +719,15 @@ static int init_or_fini(int fini)
}
static int __init init(void)
static int __init ipt_hashlimit_init(void)
{
return init_or_fini(0);
}
static void __exit fini(void)
static void __exit ipt_hashlimit_fini(void)
{
init_or_fini(1);
}
module_init(init);
module_exit(fini);
module_init(ipt_hashlimit_init);
module_exit(ipt_hashlimit_fini);

View File

@ -71,15 +71,15 @@ static struct ipt_match iprange_match = {
.me = THIS_MODULE
};
static int __init init(void)
static int __init ipt_iprange_init(void)
{
return ipt_register_match(&iprange_match);
}
static void __exit fini(void)
static void __exit ipt_iprange_fini(void)
{
ipt_unregister_match(&iprange_match);
}
module_init(init);
module_exit(fini);
module_init(ipt_iprange_init);
module_exit(ipt_iprange_fini);

View File

@ -171,7 +171,7 @@ static struct ipt_match multiport_match_v1 = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_multiport_init(void)
{
int err;
@ -185,11 +185,11 @@ static int __init init(void)
return err;
}
static void __exit fini(void)
static void __exit ipt_multiport_fini(void)
{
ipt_unregister_match(&multiport_match);
ipt_unregister_match(&multiport_match_v1);
}
module_init(init);
module_exit(fini);
module_init(ipt_multiport_init);
module_exit(ipt_multiport_fini);

View File

@ -78,15 +78,15 @@ static struct ipt_match owner_match = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_owner_init(void)
{
return ipt_register_match(&owner_match);
}
static void __exit fini(void)
static void __exit ipt_owner_fini(void)
{
ipt_unregister_match(&owner_match);
}
module_init(init);
module_exit(fini);
module_init(ipt_owner_init);
module_exit(ipt_owner_fini);

View File

@ -962,7 +962,7 @@ static struct ipt_match recent_match = {
};
/* Kernel module initialization. */
static int __init init(void)
static int __init ipt_recent_init(void)
{
int err, count;
@ -995,7 +995,7 @@ static int __init init(void)
}
/* Kernel module destruction. */
static void __exit fini(void)
static void __exit ipt_recent_fini(void)
{
ipt_unregister_match(&recent_match);
@ -1003,5 +1003,5 @@ static void __exit fini(void)
}
/* Register our module with the kernel. */
module_init(init);
module_exit(fini);
module_init(ipt_recent_init);
module_exit(ipt_recent_fini);

View File

@ -39,15 +39,15 @@ static struct ipt_match tos_match = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_multiport_init(void)
{
return ipt_register_match(&tos_match);
}
static void __exit fini(void)
static void __exit ipt_multiport_fini(void)
{
ipt_unregister_match(&tos_match);
}
module_init(init);
module_exit(fini);
module_init(ipt_multiport_init);
module_exit(ipt_multiport_fini);

View File

@ -55,16 +55,16 @@ static struct ipt_match ttl_match = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ipt_ttl_init(void)
{
return ipt_register_match(&ttl_match);
}
static void __exit fini(void)
static void __exit ipt_ttl_fini(void)
{
ipt_unregister_match(&ttl_match);
}
module_init(init);
module_exit(fini);
module_init(ipt_ttl_init);
module_exit(ipt_ttl_fini);

View File

@ -139,7 +139,7 @@ static struct nf_hook_ops ipt_ops[] = {
static int forward = NF_ACCEPT;
module_param(forward, bool, 0000);
static int __init init(void)
static int __init iptable_filter_init(void)
{
int ret;
@ -181,7 +181,7 @@ static int __init init(void)
return ret;
}
static void __exit fini(void)
static void __exit iptable_filter_fini(void)
{
unsigned int i;
@ -191,5 +191,5 @@ static void __exit fini(void)
ipt_unregister_table(&packet_filter);
}
module_init(init);
module_exit(fini);
module_init(iptable_filter_init);
module_exit(iptable_filter_fini);

View File

@ -201,7 +201,7 @@ static struct nf_hook_ops ipt_ops[] = {
},
};
static int __init init(void)
static int __init iptable_mangle_init(void)
{
int ret;
@ -247,7 +247,7 @@ static int __init init(void)
return ret;
}
static void __exit fini(void)
static void __exit iptable_mangle_fini(void)
{
unsigned int i;
@ -257,5 +257,5 @@ static void __exit fini(void)
ipt_unregister_table(&packet_mangler);
}
module_init(init);
module_exit(fini);
module_init(iptable_mangle_init);
module_exit(iptable_mangle_fini);

View File

@ -116,7 +116,7 @@ static struct nf_hook_ops ipt_ops[] = {
},
};
static int __init init(void)
static int __init iptable_raw_init(void)
{
int ret;
@ -144,7 +144,7 @@ static int __init init(void)
return ret;
}
static void __exit fini(void)
static void __exit iptable_raw_fini(void)
{
unsigned int i;
@ -154,6 +154,6 @@ static void __exit fini(void)
ipt_unregister_table(&packet_raw);
}
module_init(init);
module_exit(fini);
module_init(iptable_raw_init);
module_exit(iptable_raw_fini);
MODULE_LICENSE("GPL");

View File

@ -571,18 +571,18 @@ static int init_or_cleanup(int init)
MODULE_ALIAS("nf_conntrack-" __stringify(AF_INET));
MODULE_LICENSE("GPL");
static int __init init(void)
static int __init nf_conntrack_l3proto_ipv4_init(void)
{
need_conntrack();
return init_or_cleanup(1);
}
static void __exit fini(void)
static void __exit nf_conntrack_l3proto_ipv4_fini(void)
{
init_or_cleanup(0);
}
module_init(init);
module_exit(fini);
module_init(nf_conntrack_l3proto_ipv4_init);
module_exit(nf_conntrack_l3proto_ipv4_fini);
EXPORT_SYMBOL(nf_ct_ipv4_gather_frags);

View File

@ -223,7 +223,7 @@ void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 rtt, u32 in_flight,
/* In dangerous area, increase slowly. */
else if (sysctl_tcp_abc) {
/* RFC3465: Apppriate Byte Count
/* RFC3465: Appropriate Byte Count
* increase once for each full cwnd acked
*/
if (tp->bytes_acked >= tp->snd_cwnd*tp->mss_cache) {

113
net/ipv4/tunnel4.c Normal file
View File

@ -0,0 +1,113 @@
/* tunnel4.c: Generic IP tunnel transformer.
*
* Copyright (C) 2003 David S. Miller (davem@redhat.com)
*/
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <net/protocol.h>
#include <net/xfrm.h>
static struct xfrm_tunnel *tunnel4_handlers;
static DEFINE_MUTEX(tunnel4_mutex);
int xfrm4_tunnel_register(struct xfrm_tunnel *handler)
{
struct xfrm_tunnel **pprev;
int ret = -EEXIST;
int priority = handler->priority;
mutex_lock(&tunnel4_mutex);
for (pprev = &tunnel4_handlers; *pprev; pprev = &(*pprev)->next) {
if ((*pprev)->priority > priority)
break;
if ((*pprev)->priority == priority)
goto err;
}
handler->next = *pprev;
*pprev = handler;
ret = 0;
err:
mutex_unlock(&tunnel4_mutex);
return ret;
}
EXPORT_SYMBOL(xfrm4_tunnel_register);
int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler)
{
struct xfrm_tunnel **pprev;
int ret = -ENOENT;
mutex_lock(&tunnel4_mutex);
for (pprev = &tunnel4_handlers; *pprev; pprev = &(*pprev)->next) {
if (*pprev == handler) {
*pprev = handler->next;
ret = 0;
break;
}
}
mutex_unlock(&tunnel4_mutex);
synchronize_net();
return ret;
}
EXPORT_SYMBOL(xfrm4_tunnel_deregister);
static int tunnel4_rcv(struct sk_buff *skb)
{
struct xfrm_tunnel *handler;
for (handler = tunnel4_handlers; handler; handler = handler->next)
if (!handler->handler(skb))
return 0;
kfree_skb(skb);
return 0;
}
static void tunnel4_err(struct sk_buff *skb, u32 info)
{
struct xfrm_tunnel *handler;
for (handler = tunnel4_handlers; handler; handler = handler->next)
if (!handler->err_handler(skb, info))
break;
}
static struct net_protocol tunnel4_protocol = {
.handler = tunnel4_rcv,
.err_handler = tunnel4_err,
.no_policy = 1,
};
static int __init tunnel4_init(void)
{
if (inet_add_protocol(&tunnel4_protocol, IPPROTO_IPIP)) {
printk(KERN_ERR "tunnel4 init: can't add protocol\n");
return -EAGAIN;
}
return 0;
}
static void __exit tunnel4_fini(void)
{
if (inet_del_protocol(&tunnel4_protocol, IPPROTO_IPIP))
printk(KERN_ERR "tunnel4 close: can't remove protocol\n");
}
module_init(tunnel4_init);
module_exit(tunnel4_fini);
MODULE_LICENSE("GPL");

View File

@ -26,64 +26,6 @@ static int ipip_xfrm_rcv(struct xfrm_state *x, struct xfrm_decap_state *decap, s
return 0;
}
static struct xfrm_tunnel *ipip_handler;
static DEFINE_MUTEX(xfrm4_tunnel_mutex);
int xfrm4_tunnel_register(struct xfrm_tunnel *handler)
{
int ret;
mutex_lock(&xfrm4_tunnel_mutex);
ret = 0;
if (ipip_handler != NULL)
ret = -EINVAL;
if (!ret)
ipip_handler = handler;
mutex_unlock(&xfrm4_tunnel_mutex);
return ret;
}
EXPORT_SYMBOL(xfrm4_tunnel_register);
int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler)
{
int ret;
mutex_lock(&xfrm4_tunnel_mutex);
ret = 0;
if (ipip_handler != handler)
ret = -EINVAL;
if (!ret)
ipip_handler = NULL;
mutex_unlock(&xfrm4_tunnel_mutex);
synchronize_net();
return ret;
}
EXPORT_SYMBOL(xfrm4_tunnel_deregister);
static int ipip_rcv(struct sk_buff *skb)
{
struct xfrm_tunnel *handler = ipip_handler;
/* Tunnel devices take precedence. */
if (handler && handler->handler(skb) == 0)
return 0;
return xfrm4_rcv(skb);
}
static void ipip_err(struct sk_buff *skb, u32 info)
{
struct xfrm_tunnel *handler = ipip_handler;
if (handler)
handler->err_handler(skb, info);
}
static int ipip_init_state(struct xfrm_state *x)
{
if (!x->props.mode)
@ -111,10 +53,15 @@ static struct xfrm_type ipip_type = {
.output = ipip_output
};
static struct net_protocol ipip_protocol = {
.handler = ipip_rcv,
.err_handler = ipip_err,
.no_policy = 1,
static int xfrm_tunnel_err(struct sk_buff *skb, u32 info)
{
return -ENOENT;
}
static struct xfrm_tunnel xfrm_tunnel_handler = {
.handler = xfrm4_rcv,
.err_handler = xfrm_tunnel_err,
.priority = 2,
};
static int __init ipip_init(void)
@ -123,8 +70,8 @@ static int __init ipip_init(void)
printk(KERN_INFO "ipip init: can't add xfrm type\n");
return -EAGAIN;
}
if (inet_add_protocol(&ipip_protocol, IPPROTO_IPIP) < 0) {
printk(KERN_INFO "ipip init: can't add protocol\n");
if (xfrm4_tunnel_register(&xfrm_tunnel_handler)) {
printk(KERN_INFO "ipip init: can't add xfrm handler\n");
xfrm_unregister_type(&ipip_type, AF_INET);
return -EAGAIN;
}
@ -133,8 +80,8 @@ static int __init ipip_init(void)
static void __exit ipip_fini(void)
{
if (inet_del_protocol(&ipip_protocol, IPPROTO_IPIP) < 0)
printk(KERN_INFO "ipip close: can't remove protocol\n");
if (xfrm4_tunnel_deregister(&xfrm_tunnel_handler))
printk(KERN_INFO "ipip close: can't remove xfrm handler\n");
if (xfrm_unregister_type(&ipip_type, AF_INET) < 0)
printk(KERN_INFO "ipip close: can't remove xfrm type\n");
}

View File

@ -88,7 +88,7 @@ config INET6_IPCOMP
tristate "IPv6: IPComp transformation"
depends on IPV6
select XFRM
select INET6_TUNNEL
select INET6_XFRM_TUNNEL
select CRYPTO
select CRYPTO_DEFLATE
---help---
@ -97,19 +97,18 @@ config INET6_IPCOMP
If unsure, say Y.
config INET6_XFRM_TUNNEL
tristate
select INET6_TUNNEL
default n
config INET6_TUNNEL
tristate "IPv6: tunnel transformation"
depends on IPV6
select XFRM
---help---
Support for generic IPv6-in-IPv6 tunnel transformation, which is
required by the IPv6-in-IPv6 tunneling module as well as tunnel mode
IPComp.
If unsure, say Y.
tristate
default n
config IPV6_TUNNEL
tristate "IPv6: IPv6-in-IPv6 tunnel"
select INET6_TUNNEL
depends on IPV6
---help---
Support for IPv6-in-IPv6 tunnels described in RFC 2473.

View File

@ -18,7 +18,8 @@ ipv6-objs += $(ipv6-y)
obj-$(CONFIG_INET6_AH) += ah6.o
obj-$(CONFIG_INET6_ESP) += esp6.o
obj-$(CONFIG_INET6_IPCOMP) += ipcomp6.o
obj-$(CONFIG_INET6_TUNNEL) += xfrm6_tunnel.o
obj-$(CONFIG_INET6_XFRM_TUNNEL) += xfrm6_tunnel.o
obj-$(CONFIG_INET6_TUNNEL) += tunnel6.o
obj-$(CONFIG_NETFILTER) += netfilter/
obj-$(CONFIG_IPV6_TUNNEL) += ip6_tunnel.o

View File

@ -44,7 +44,6 @@
#include <net/ip.h>
#include <net/ipv6.h>
#include <net/protocol.h>
#include <net/ip6_route.h>
#include <net/addrconf.h>
#include <net/ip6_tunnel.h>
@ -391,7 +390,7 @@ parse_tlv_tnl_enc_lim(struct sk_buff *skb, __u8 * raw)
* to the specifications in RFC 2473.
**/
static void
static int
ip6ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
int type, int code, int offset, __u32 info)
{
@ -402,6 +401,7 @@ ip6ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
int rel_code = ICMPV6_ADDR_UNREACH;
__u32 rel_info = 0;
__u16 len;
int err = -ENOENT;
/* If the packet doesn't contain the original IPv6 header we are
in trouble since we might need the source address for further
@ -411,6 +411,8 @@ ip6ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
if ((t = ip6ip6_tnl_lookup(&ipv6h->daddr, &ipv6h->saddr)) == NULL)
goto out;
err = 0;
switch (type) {
__u32 teli;
struct ipv6_tlv_tnl_enc_lim *tel;
@ -492,6 +494,7 @@ ip6ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
}
out:
read_unlock(&ip6ip6_lock);
return err;
}
static inline void ip6ip6_ecn_decapsulate(struct ipv6hdr *outer_iph,
@ -511,9 +514,8 @@ static inline void ip6ip6_ecn_decapsulate(struct ipv6hdr *outer_iph,
**/
static int
ip6ip6_rcv(struct sk_buff **pskb)
ip6ip6_rcv(struct sk_buff *skb)
{
struct sk_buff *skb = *pskb;
struct ipv6hdr *ipv6h;
struct ip6_tnl *t;
@ -1112,39 +1114,12 @@ ip6ip6_fb_tnl_dev_init(struct net_device *dev)
return 0;
}
#ifdef CONFIG_INET6_TUNNEL
static struct xfrm6_tunnel ip6ip6_handler = {
.handler = ip6ip6_rcv,
.err_handler = ip6ip6_err,
.priority = 1,
};
static inline int ip6ip6_register(void)
{
return xfrm6_tunnel_register(&ip6ip6_handler);
}
static inline int ip6ip6_unregister(void)
{
return xfrm6_tunnel_deregister(&ip6ip6_handler);
}
#else
static struct inet6_protocol xfrm6_tunnel_protocol = {
.handler = ip6ip6_rcv,
.err_handler = ip6ip6_err,
.flags = INET6_PROTO_NOPOLICY|INET6_PROTO_FINAL,
};
static inline int ip6ip6_register(void)
{
return inet6_add_protocol(&xfrm6_tunnel_protocol, IPPROTO_IPV6);
}
static inline int ip6ip6_unregister(void)
{
return inet6_del_protocol(&xfrm6_tunnel_protocol, IPPROTO_IPV6);
}
#endif
/**
* ip6_tunnel_init - register protocol and reserve needed resources
*
@ -1155,7 +1130,7 @@ static int __init ip6_tunnel_init(void)
{
int err;
if (ip6ip6_register() < 0) {
if (xfrm6_tunnel_register(&ip6ip6_handler)) {
printk(KERN_ERR "ip6ip6 init: can't register tunnel\n");
return -EAGAIN;
}
@ -1174,7 +1149,7 @@ static int __init ip6_tunnel_init(void)
}
return 0;
fail:
ip6ip6_unregister();
xfrm6_tunnel_deregister(&ip6ip6_handler);
return err;
}
@ -1184,7 +1159,7 @@ static int __init ip6_tunnel_init(void)
static void __exit ip6_tunnel_cleanup(void)
{
if (ip6ip6_unregister() < 0)
if (xfrm6_tunnel_deregister(&ip6ip6_handler))
printk(KERN_INFO "ip6ip6 close: can't deregister tunnel\n");
unregister_netdev(ip6ip6_fb_tnl_dev);

View File

@ -713,13 +713,13 @@ init_or_cleanup(int init)
return status;
}
static int __init init(void)
static int __init ip6_queue_init(void)
{
return init_or_cleanup(1);
}
static void __exit fini(void)
static void __exit ip6_queue_fini(void)
{
init_or_cleanup(0);
}
@ -727,5 +727,5 @@ static void __exit fini(void)
MODULE_DESCRIPTION("IPv6 packet queue handler");
MODULE_LICENSE("GPL");
module_init(init);
module_exit(fini);
module_init(ip6_queue_init);
module_exit(ip6_queue_fini);

View File

@ -1406,7 +1406,7 @@ static struct ip6t_match icmp6_matchstruct = {
.family = AF_INET6,
};
static int __init init(void)
static int __init ip6_tables_init(void)
{
int ret;
@ -1429,7 +1429,7 @@ static int __init init(void)
return 0;
}
static void __exit fini(void)
static void __exit ip6_tables_fini(void)
{
nf_unregister_sockopt(&ip6t_sockopts);
xt_unregister_match(&icmp6_matchstruct);
@ -1517,5 +1517,5 @@ EXPORT_SYMBOL(ip6t_do_table);
EXPORT_SYMBOL(ip6t_ext_hdr);
EXPORT_SYMBOL(ipv6_find_hdr);
module_init(init);
module_exit(fini);
module_init(ip6_tables_init);
module_exit(ip6_tables_fini);

View File

@ -93,15 +93,15 @@ static struct ip6t_target ip6t_HL = {
.me = THIS_MODULE
};
static int __init init(void)
static int __init ip6t_hl_init(void)
{
return ip6t_register_target(&ip6t_HL);
}
static void __exit fini(void)
static void __exit ip6t_hl_fini(void)
{
ip6t_unregister_target(&ip6t_HL);
}
module_init(init);
module_exit(fini);
module_init(ip6t_hl_init);
module_exit(ip6t_hl_fini);

View File

@ -483,7 +483,7 @@ static struct nf_logger ip6t_logger = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ip6t_log_init(void)
{
if (ip6t_register_target(&ip6t_log_reg))
return -EINVAL;
@ -497,11 +497,11 @@ static int __init init(void)
return 0;
}
static void __exit fini(void)
static void __exit ip6t_log_fini(void)
{
nf_log_unregister_logger(&ip6t_logger);
ip6t_unregister_target(&ip6t_log_reg);
}
module_init(init);
module_exit(fini);
module_init(ip6t_log_init);
module_exit(ip6t_log_fini);

View File

@ -255,17 +255,17 @@ static struct ip6t_target ip6t_reject_reg = {
.me = THIS_MODULE
};
static int __init init(void)
static int __init ip6t_reject_init(void)
{
if (ip6t_register_target(&ip6t_reject_reg))
return -EINVAL;
return 0;
}
static void __exit fini(void)
static void __exit ip6t_reject_fini(void)
{
ip6t_unregister_target(&ip6t_reject_reg);
}
module_init(init);
module_exit(fini);
module_init(ip6t_reject_init);
module_exit(ip6t_reject_fini);

View File

@ -122,15 +122,15 @@ static struct ip6t_match ah_match = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ip6t_ah_init(void)
{
return ip6t_register_match(&ah_match);
}
static void __exit cleanup(void)
static void __exit ip6t_ah_fini(void)
{
ip6t_unregister_match(&ah_match);
}
module_init(init);
module_exit(cleanup);
module_init(ip6t_ah_init);
module_exit(ip6t_ah_fini);

View File

@ -206,15 +206,15 @@ static struct ip6t_match opts_match = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ip6t_dst_init(void)
{
return ip6t_register_match(&opts_match);
}
static void __exit cleanup(void)
static void __exit ip6t_dst_fini(void)
{
ip6t_unregister_match(&opts_match);
}
module_init(init);
module_exit(cleanup);
module_init(ip6t_dst_init);
module_exit(ip6t_dst_fini);

View File

@ -101,15 +101,15 @@ static struct ip6t_match esp_match = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ip6t_esp_init(void)
{
return ip6t_register_match(&esp_match);
}
static void __exit cleanup(void)
static void __exit ip6t_esp_fini(void)
{
ip6t_unregister_match(&esp_match);
}
module_init(init);
module_exit(cleanup);
module_init(ip6t_esp_init);
module_exit(ip6t_esp_fini);

View File

@ -70,15 +70,15 @@ static struct ip6t_match eui64_match = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ip6t_eui64_init(void)
{
return ip6t_register_match(&eui64_match);
}
static void __exit fini(void)
static void __exit ip6t_eui64_fini(void)
{
ip6t_unregister_match(&eui64_match);
}
module_init(init);
module_exit(fini);
module_init(ip6t_eui64_init);
module_exit(ip6t_eui64_fini);

View File

@ -139,15 +139,15 @@ static struct ip6t_match frag_match = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ip6t_frag_init(void)
{
return ip6t_register_match(&frag_match);
}
static void __exit cleanup(void)
static void __exit ip6t_frag_fini(void)
{
ip6t_unregister_match(&frag_match);
}
module_init(init);
module_exit(cleanup);
module_init(ip6t_frag_init);
module_exit(ip6t_frag_fini);

View File

@ -206,15 +206,15 @@ static struct ip6t_match opts_match = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ip6t_hbh_init(void)
{
return ip6t_register_match(&opts_match);
}
static void __exit cleanup(void)
static void __exit ip6t_hbh_fini(void)
{
ip6t_unregister_match(&opts_match);
}
module_init(init);
module_exit(cleanup);
module_init(ip6t_hbh_init);
module_exit(ip6t_hbh_fini);

View File

@ -55,16 +55,16 @@ static struct ip6t_match hl_match = {
.me = THIS_MODULE,
};
static int __init init(void)
static int __init ip6t_hl_init(void)
{
return ip6t_register_match(&hl_match);
}
static void __exit fini(void)
static void __exit ip6t_hl_fini(void)
{
ip6t_unregister_match(&hl_match);
}
module_init(init);
module_exit(fini);
module_init(ip6t_hl_init);
module_exit(ip6t_hl_fini);

Some files were not shown because too many files have changed in this diff Show More