Commit 936ef1d4 authored by Linus Torvalds's avatar Linus Torvalds

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:
  [DECNET]: Fix level1 router hello
  [TCP]: Fix sock_orphan dead lock
  [ROSE]: Eleminate HZ from ROSE kernel interfaces
  [NETROM]: Eleminate HZ from NET/ROM kernel interfaces
  [AX.25]: Eleminate HZ from AX.25 kernel interfaces
  [ROSE]: Fix routing table locking in rose_remove_neigh.
  [AX.25]: Move AX.25 symbol exports
  [HAMRADIO]: Remove remaining SET_MODULE_OWNER calls from hamradio drivers.
  [AX25, ROSE]: Remove useless SET_MODULE_OWNER calls.
  [AX.25]: Spelling fix
  [ROSE]: Remove useless prototype for rose_remove_neigh().
  [NETFILTER]: x_tables: don't use __copy_{from,to}_user on unchecked memory in compat layer
  [NETFILTER]: H.323 helper: Change author's email address
  [NETFILTER]: NAT: silence unused variable warnings with CONFIG_XFRM=n
  [NETFILTER]: H.323 helper: fix use of uninitialized data
  [NETFILTER]: H.323 helper: fix endless loop caused by invalid TPKT len
parents 0de2a93e d1a64983
...@@ -582,7 +582,6 @@ static int __init setup_adapter(int card_base, int type, int n) ...@@ -582,7 +582,6 @@ static int __init setup_adapter(int card_base, int type, int n)
INIT_WORK(&priv->rx_work, rx_bh, priv); INIT_WORK(&priv->rx_work, rx_bh, priv);
dev->priv = priv; dev->priv = priv;
sprintf(dev->name, "dmascc%i", 2 * n + i); sprintf(dev->name, "dmascc%i", 2 * n + i);
SET_MODULE_OWNER(dev);
dev->base_addr = card_base; dev->base_addr = card_base;
dev->irq = irq; dev->irq = irq;
dev->open = scc_open; dev->open = scc_open;
......
...@@ -1550,7 +1550,6 @@ static unsigned char ax25_nocall[AX25_ADDR_LEN] = ...@@ -1550,7 +1550,6 @@ static unsigned char ax25_nocall[AX25_ADDR_LEN] =
static void scc_net_setup(struct net_device *dev) static void scc_net_setup(struct net_device *dev)
{ {
SET_MODULE_OWNER(dev);
dev->tx_queue_len = 16; /* should be enough... */ dev->tx_queue_len = 16; /* should be enough... */
dev->open = scc_net_open; dev->open = scc_net_open;
......
...@@ -1098,7 +1098,6 @@ static void yam_setup(struct net_device *dev) ...@@ -1098,7 +1098,6 @@ static void yam_setup(struct net_device *dev)
dev->base_addr = yp->iobase; dev->base_addr = yp->iobase;
dev->irq = yp->irq; dev->irq = yp->irq;
SET_MODULE_OWNER(dev);
dev->open = yam_open; dev->open = yam_open;
dev->stop = yam_close; dev->stop = yam_close;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ip_conntrack_helper_h323_asn1.h - BER and PER decoding library for H.323 * ip_conntrack_helper_h323_asn1.h - BER and PER decoding library for H.323
* conntrack/NAT module. * conntrack/NAT module.
* *
* Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@hotmail.com> * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@users.sourceforge.net>
* *
* This source code is licensed under General Public License version 2. * This source code is licensed under General Public License version 2.
* *
......
...@@ -145,14 +145,14 @@ enum { ...@@ -145,14 +145,14 @@ enum {
#define AX25_DEF_CONMODE 2 /* Connected mode allowed */ #define AX25_DEF_CONMODE 2 /* Connected mode allowed */
#define AX25_DEF_WINDOW 2 /* Window=2 */ #define AX25_DEF_WINDOW 2 /* Window=2 */
#define AX25_DEF_EWINDOW 32 /* Module-128 Window=32 */ #define AX25_DEF_EWINDOW 32 /* Module-128 Window=32 */
#define AX25_DEF_T1 (10 * HZ) /* T1=10s */ #define AX25_DEF_T1 10000 /* T1=10s */
#define AX25_DEF_T2 (3 * HZ) /* T2=3s */ #define AX25_DEF_T2 3000 /* T2=3s */
#define AX25_DEF_T3 (300 * HZ) /* T3=300s */ #define AX25_DEF_T3 300000 /* T3=300s */
#define AX25_DEF_N2 10 /* N2=10 */ #define AX25_DEF_N2 10 /* N2=10 */
#define AX25_DEF_IDLE (0 * 60 * HZ) /* Idle=None */ #define AX25_DEF_IDLE 0 /* Idle=None */
#define AX25_DEF_PACLEN 256 /* Paclen=256 */ #define AX25_DEF_PACLEN 256 /* Paclen=256 */
#define AX25_DEF_PROTOCOL AX25_PROTO_STD_SIMPLEX /* Standard AX.25 */ #define AX25_DEF_PROTOCOL AX25_PROTO_STD_SIMPLEX /* Standard AX.25 */
#define AX25_DEF_DS_TIMEOUT (3 * 60 * HZ) /* DAMA timeout 3 minutes */ #define AX25_DEF_DS_TIMEOUT 180000 /* DAMA timeout 3 minutes */
typedef struct ax25_uid_assoc { typedef struct ax25_uid_assoc {
struct hlist_node uid_node; struct hlist_node uid_node;
......
...@@ -42,11 +42,11 @@ enum { ...@@ -42,11 +42,11 @@ enum {
#define NR_COND_PEER_RX_BUSY 0x04 #define NR_COND_PEER_RX_BUSY 0x04
#define NR_COND_OWN_RX_BUSY 0x08 #define NR_COND_OWN_RX_BUSY 0x08
#define NR_DEFAULT_T1 (120 * HZ) /* Outstanding frames - 120 seconds */ #define NR_DEFAULT_T1 120000 /* Outstanding frames - 120 seconds */
#define NR_DEFAULT_T2 (5 * HZ) /* Response delay - 5 seconds */ #define NR_DEFAULT_T2 5000 /* Response delay - 5 seconds */
#define NR_DEFAULT_N2 3 /* Number of Retries - 3 */ #define NR_DEFAULT_N2 3 /* Number of Retries - 3 */
#define NR_DEFAULT_T4 (180 * HZ) /* Busy Delay - 180 seconds */ #define NR_DEFAULT_T4 180000 /* Busy Delay - 180 seconds */
#define NR_DEFAULT_IDLE (0 * 60 * HZ) /* No Activity Timeout - none */ #define NR_DEFAULT_IDLE 0 /* No Activity Timeout - none */
#define NR_DEFAULT_WINDOW 4 /* Default Window Size - 4 */ #define NR_DEFAULT_WINDOW 4 /* Default Window Size - 4 */
#define NR_DEFAULT_OBS 6 /* Default Obsolescence Count - 6 */ #define NR_DEFAULT_OBS 6 /* Default Obsolescence Count - 6 */
#define NR_DEFAULT_QUAL 10 /* Default Neighbour Quality - 10 */ #define NR_DEFAULT_QUAL 10 /* Default Neighbour Quality - 10 */
......
...@@ -49,14 +49,14 @@ enum { ...@@ -49,14 +49,14 @@ enum {
ROSE_STATE_5 /* Deferred Call Acceptance */ ROSE_STATE_5 /* Deferred Call Acceptance */
}; };
#define ROSE_DEFAULT_T0 (180 * HZ) /* Default T10 T20 value */ #define ROSE_DEFAULT_T0 180000 /* Default T10 T20 value */
#define ROSE_DEFAULT_T1 (200 * HZ) /* Default T11 T21 value */ #define ROSE_DEFAULT_T1 200000 /* Default T11 T21 value */
#define ROSE_DEFAULT_T2 (180 * HZ) /* Default T12 T22 value */ #define ROSE_DEFAULT_T2 180000 /* Default T12 T22 value */
#define ROSE_DEFAULT_T3 (180 * HZ) /* Default T13 T23 value */ #define ROSE_DEFAULT_T3 180000 /* Default T13 T23 value */
#define ROSE_DEFAULT_HB (5 * HZ) /* Default Holdback value */ #define ROSE_DEFAULT_HB 5000 /* Default Holdback value */
#define ROSE_DEFAULT_IDLE (0 * 60 * HZ) /* No Activity Timeout - none */ #define ROSE_DEFAULT_IDLE 0 /* No Activity Timeout - none */
#define ROSE_DEFAULT_ROUTING 1 /* Default routing flag */ #define ROSE_DEFAULT_ROUTING 1 /* Default routing flag */
#define ROSE_DEFAULT_FAIL_TIMEOUT (120 * HZ) /* Time until link considered usable */ #define ROSE_DEFAULT_FAIL_TIMEOUT 120000 /* Time until link considered usable */
#define ROSE_DEFAULT_MAXVC 50 /* Maximum number of VCs per neighbour */ #define ROSE_DEFAULT_MAXVC 50 /* Maximum number of VCs per neighbour */
#define ROSE_DEFAULT_WINDOW_SIZE 7 /* Default window size */ #define ROSE_DEFAULT_WINDOW_SIZE 7 /* Default window size */
......
...@@ -228,6 +228,8 @@ ax25_cb *ax25_find_cb(ax25_address *src_addr, ax25_address *dest_addr, ...@@ -228,6 +228,8 @@ ax25_cb *ax25_find_cb(ax25_address *src_addr, ax25_address *dest_addr,
return NULL; return NULL;
} }
EXPORT_SYMBOL(ax25_find_cb);
void ax25_send_to_raw(ax25_address *addr, struct sk_buff *skb, int proto) void ax25_send_to_raw(ax25_address *addr, struct sk_buff *skb, int proto)
{ {
ax25_cb *s; ax25_cb *s;
...@@ -424,22 +426,15 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg) ...@@ -424,22 +426,15 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
return 0; return 0;
} }
/* static void ax25_fillin_cb_from_dev(ax25_cb *ax25, ax25_dev *ax25_dev)
* Fill in a created AX.25 created control block with the default
* values for a particular device.
*/
void ax25_fillin_cb(ax25_cb *ax25, ax25_dev *ax25_dev)
{ {
ax25->ax25_dev = ax25_dev; ax25->rtt = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_T1]) / 2;
ax25->t1 = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_T1]);
if (ax25->ax25_dev != NULL) { ax25->t2 = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_T2]);
ax25->rtt = ax25_dev->values[AX25_VALUES_T1] / 2; ax25->t3 = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_T3]);
ax25->t1 = ax25_dev->values[AX25_VALUES_T1];
ax25->t2 = ax25_dev->values[AX25_VALUES_T2];
ax25->t3 = ax25_dev->values[AX25_VALUES_T3];
ax25->n2 = ax25_dev->values[AX25_VALUES_N2]; ax25->n2 = ax25_dev->values[AX25_VALUES_N2];
ax25->paclen = ax25_dev->values[AX25_VALUES_PACLEN]; ax25->paclen = ax25_dev->values[AX25_VALUES_PACLEN];
ax25->idle = ax25_dev->values[AX25_VALUES_IDLE]; ax25->idle = msecs_to_jiffies(ax25_dev->values[AX25_VALUES_IDLE]);
ax25->backoff = ax25_dev->values[AX25_VALUES_BACKOFF]; ax25->backoff = ax25_dev->values[AX25_VALUES_BACKOFF];
if (ax25_dev->values[AX25_VALUES_AXDEFMODE]) { if (ax25_dev->values[AX25_VALUES_AXDEFMODE]) {
...@@ -449,14 +444,31 @@ void ax25_fillin_cb(ax25_cb *ax25, ax25_dev *ax25_dev) ...@@ -449,14 +444,31 @@ void ax25_fillin_cb(ax25_cb *ax25, ax25_dev *ax25_dev)
ax25->modulus = AX25_MODULUS; ax25->modulus = AX25_MODULUS;
ax25->window = ax25_dev->values[AX25_VALUES_WINDOW]; ax25->window = ax25_dev->values[AX25_VALUES_WINDOW];
} }
} else { }
ax25->rtt = AX25_DEF_T1 / 2;
ax25->t1 = AX25_DEF_T1; /*
ax25->t2 = AX25_DEF_T2; * Fill in a created AX.25 created control block with the default
ax25->t3 = AX25_DEF_T3; * values for a particular device.
*/
void ax25_fillin_cb(ax25_cb *ax25, ax25_dev *ax25_dev)
{
ax25->ax25_dev = ax25_dev;
if (ax25->ax25_dev != NULL) {
ax25_fillin_cb_from_dev(ax25, ax25_dev);
return;
}
/*
* No device, use kernel / AX.25 spec default values
*/
ax25->rtt = msecs_to_jiffies(AX25_DEF_T1) / 2;
ax25->t1 = msecs_to_jiffies(AX25_DEF_T1);
ax25->t2 = msecs_to_jiffies(AX25_DEF_T2);
ax25->t3 = msecs_to_jiffies(AX25_DEF_T3);
ax25->n2 = AX25_DEF_N2; ax25->n2 = AX25_DEF_N2;
ax25->paclen = AX25_DEF_PACLEN; ax25->paclen = AX25_DEF_PACLEN;
ax25->idle = AX25_DEF_IDLE; ax25->idle = msecs_to_jiffies(AX25_DEF_IDLE);
ax25->backoff = AX25_DEF_BACKOFF; ax25->backoff = AX25_DEF_BACKOFF;
if (AX25_DEF_AXDEFMODE) { if (AX25_DEF_AXDEFMODE) {
...@@ -466,7 +478,6 @@ void ax25_fillin_cb(ax25_cb *ax25, ax25_dev *ax25_dev) ...@@ -466,7 +478,6 @@ void ax25_fillin_cb(ax25_cb *ax25, ax25_dev *ax25_dev)
ax25->modulus = AX25_MODULUS; ax25->modulus = AX25_MODULUS;
ax25->window = AX25_DEF_WINDOW; ax25->window = AX25_DEF_WINDOW;
} }
}
} }
/* /*
...@@ -1979,24 +1990,6 @@ static struct notifier_block ax25_dev_notifier = { ...@@ -1979,24 +1990,6 @@ static struct notifier_block ax25_dev_notifier = {
.notifier_call =ax25_device_event, .notifier_call =ax25_device_event,
}; };
EXPORT_SYMBOL(ax25_hard_header);
EXPORT_SYMBOL(ax25_rebuild_header);
EXPORT_SYMBOL(ax25_findbyuid);
EXPORT_SYMBOL(ax25_find_cb);
EXPORT_SYMBOL(ax25_linkfail_register);
EXPORT_SYMBOL(ax25_linkfail_release);
EXPORT_SYMBOL(ax25_listen_register);
EXPORT_SYMBOL(ax25_listen_release);
EXPORT_SYMBOL(ax25_protocol_register);
EXPORT_SYMBOL(ax25_protocol_release);
EXPORT_SYMBOL(ax25_send_frame);
EXPORT_SYMBOL(ax25_uid_policy);
EXPORT_SYMBOL(ax25cmp);
EXPORT_SYMBOL(ax2asc);
EXPORT_SYMBOL(asc2ax);
EXPORT_SYMBOL(null_ax25_address);
EXPORT_SYMBOL(ax25_display_timer);
static int __init ax25_init(void) static int __init ax25_init(void)
{ {
int rc = proto_register(&ax25_proto, 0); int rc = proto_register(&ax25_proto, 0);
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/socket.h> #include <linux/socket.h>
#include <linux/in.h> #include <linux/in.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -33,6 +34,8 @@ ...@@ -33,6 +34,8 @@
*/ */
ax25_address null_ax25_address = {{0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00}}; ax25_address null_ax25_address = {{0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00}};
EXPORT_SYMBOL(null_ax25_address);
/* /*
* ax25 -> ascii conversion * ax25 -> ascii conversion
*/ */
...@@ -64,6 +67,8 @@ char *ax2asc(char *buf, ax25_address *a) ...@@ -64,6 +67,8 @@ char *ax2asc(char *buf, ax25_address *a)
} }
EXPORT_SYMBOL(ax2asc);
/* /*
* ascii -> ax25 conversion * ascii -> ax25 conversion
*/ */
...@@ -97,6 +102,8 @@ void asc2ax(ax25_address *addr, char *callsign) ...@@ -97,6 +102,8 @@ void asc2ax(ax25_address *addr, char *callsign)
addr->ax25_call[6] &= 0x1E; addr->ax25_call[6] &= 0x1E;
} }
EXPORT_SYMBOL(asc2ax);
/* /*
* Compare two ax.25 addresses * Compare two ax.25 addresses
*/ */
...@@ -116,6 +123,8 @@ int ax25cmp(ax25_address *a, ax25_address *b) ...@@ -116,6 +123,8 @@ int ax25cmp(ax25_address *a, ax25_address *b)
return 2; /* Partial match */ return 2; /* Partial match */
} }
EXPORT_SYMBOL(ax25cmp);
/* /*
* Compare two AX.25 digipeater paths. * Compare two AX.25 digipeater paths.
*/ */
......
...@@ -61,7 +61,8 @@ void ax25_ds_set_timer(ax25_dev *ax25_dev) ...@@ -61,7 +61,8 @@ void ax25_ds_set_timer(ax25_dev *ax25_dev)
return; return;
del_timer(&ax25_dev->dama.slave_timer); del_timer(&ax25_dev->dama.slave_timer);
ax25_dev->dama.slave_timeout = ax25_dev->values[AX25_VALUES_DS_TIMEOUT] / 10; ax25_dev->dama.slave_timeout =
msecs_to_jiffies(ax25_dev->values[AX25_VALUES_DS_TIMEOUT]) / 10;
ax25_ds_add_timer(ax25_dev); ax25_ds_add_timer(ax25_dev);
} }
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/socket.h> #include <linux/socket.h>
#include <linux/in.h> #include <linux/in.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/timer.h> #include <linux/timer.h>
...@@ -74,6 +75,8 @@ int ax25_protocol_register(unsigned int pid, ...@@ -74,6 +75,8 @@ int ax25_protocol_register(unsigned int pid,
return 1; return 1;
} }
EXPORT_SYMBOL(ax25_protocol_register);
void ax25_protocol_release(unsigned int pid) void ax25_protocol_release(unsigned int pid)
{ {
struct protocol_struct *s, *protocol; struct protocol_struct *s, *protocol;
...@@ -106,6 +109,8 @@ void ax25_protocol_release(unsigned int pid) ...@@ -106,6 +109,8 @@ void ax25_protocol_release(unsigned int pid)
write_unlock(&protocol_list_lock); write_unlock(&protocol_list_lock);
} }
EXPORT_SYMBOL(ax25_protocol_release);
int ax25_linkfail_register(void (*func)(ax25_cb *, int)) int ax25_linkfail_register(void (*func)(ax25_cb *, int))
{ {
struct linkfail_struct *linkfail; struct linkfail_struct *linkfail;
...@@ -123,6 +128,8 @@ int ax25_linkfail_register(void (*func)(ax25_cb *, int)) ...@@ -123,6 +128,8 @@ int ax25_linkfail_register(void (*func)(ax25_cb *, int))
return 1; return 1;
} }
EXPORT_SYMBOL(ax25_linkfail_register);
void ax25_linkfail_release(void (*func)(ax25_cb *, int)) void ax25_linkfail_release(void (*func)(ax25_cb *, int))
{ {
struct linkfail_struct *s, *linkfail; struct linkfail_struct *s, *linkfail;
...@@ -155,6 +162,8 @@ void ax25_linkfail_release(void (*func)(ax25_cb *, int)) ...@@ -155,6 +162,8 @@ void ax25_linkfail_release(void (*func)(ax25_cb *, int))
spin_unlock_bh(&linkfail_lock); spin_unlock_bh(&linkfail_lock);
} }
EXPORT_SYMBOL(ax25_linkfail_release);
int ax25_listen_register(ax25_address *callsign, struct net_device *dev) int ax25_listen_register(ax25_address *callsign, struct net_device *dev)
{ {
struct listen_struct *listen; struct listen_struct *listen;
...@@ -176,6 +185,8 @@ int ax25_listen_register(ax25_address *callsign, struct net_device *dev) ...@@ -176,6 +185,8 @@ int ax25_listen_register(ax25_address *callsign, struct net_device *dev)
return 1; return 1;
} }
EXPORT_SYMBOL(ax25_listen_register);
void ax25_listen_release(ax25_address *callsign, struct net_device *dev) void ax25_listen_release(ax25_address *callsign, struct net_device *dev)
{ {
struct listen_struct *s, *listen; struct listen_struct *s, *listen;
...@@ -208,6 +219,8 @@ void ax25_listen_release(ax25_address *callsign, struct net_device *dev) ...@@ -208,6 +219,8 @@ void ax25_listen_release(ax25_address *callsign, struct net_device *dev)
spin_unlock_bh(&listen_lock); spin_unlock_bh(&listen_lock);
} }
EXPORT_SYMBOL(ax25_listen_release);
int (*ax25_protocol_function(unsigned int pid))(struct sk_buff *, ax25_cb *) int (*ax25_protocol_function(unsigned int pid))(struct sk_buff *, ax25_cb *)
{ {
int (*res)(struct sk_buff *, ax25_cb *) = NULL; int (*res)(struct sk_buff *, ax25_cb *) = NULL;
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/socket.h> #include <linux/socket.h>
#include <linux/in.h> #include <linux/in.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -221,3 +222,5 @@ int ax25_rebuild_header(struct sk_buff *skb) ...@@ -221,3 +222,5 @@ int ax25_rebuild_header(struct sk_buff *skb)
#endif #endif
EXPORT_SYMBOL(ax25_hard_header);
EXPORT_SYMBOL(ax25_rebuild_header);
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/socket.h> #include <linux/socket.h>
#include <linux/in.h> #include <linux/in.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -104,6 +105,8 @@ ax25_cb *ax25_send_frame(struct sk_buff *skb, int paclen, ax25_address *src, ax2 ...@@ -104,6 +105,8 @@ ax25_cb *ax25_send_frame(struct sk_buff *skb, int paclen, ax25_address *src, ax2
return ax25; /* We had to create it */ return ax25; /* We had to create it */
} }
EXPORT_SYMBOL(ax25_send_frame);
/* /*
* All outgoing AX.25 I frames pass via this routine. Therefore this is * All outgoing AX.25 I frames pass via this routine. Therefore this is
* where the fragmentation of frames takes place. If fragment is set to * where the fragmentation of frames takes place. If fragment is set to
......
...@@ -360,7 +360,7 @@ struct file_operations ax25_route_fops = { ...@@ -360,7 +360,7 @@ struct file_operations ax25_route_fops = {
/* /*
* Find AX.25 route * Find AX.25 route
* *
* Only routes with a refernce rout of zero can be destroyed. * Only routes with a reference count of zero can be destroyed.
*/ */
static ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev) static ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev)
{ {
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/socket.h> #include <linux/socket.h>
#include <linux/in.h> #include <linux/in.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -137,6 +138,8 @@ unsigned long ax25_display_timer(struct timer_list *timer) ...@@ -137,6 +138,8 @@ unsigned long ax25_display_timer(struct timer_list *timer)
return timer->expires - jiffies; return timer->expires - jiffies;
} }
EXPORT_SYMBOL(ax25_display_timer);
static void ax25_heartbeat_expiry(unsigned long param) static void ax25_heartbeat_expiry(unsigned long param)
{ {
int proto = AX25_PROTO_STD_SIMPLEX; int proto = AX25_PROTO_STD_SIMPLEX;
......
...@@ -49,6 +49,8 @@ static DEFINE_RWLOCK(ax25_uid_lock); ...@@ -49,6 +49,8 @@ static DEFINE_RWLOCK(ax25_uid_lock);
int ax25_uid_policy = 0; int ax25_uid_policy = 0;
EXPORT_SYMBOL(ax25_uid_policy);
ax25_uid_assoc *ax25_findbyuid(uid_t uid) ax25_uid_assoc *ax25_findbyuid(uid_t uid)
{ {
ax25_uid_assoc *ax25_uid, *res = NULL; ax25_uid_assoc *ax25_uid, *res = NULL;
...@@ -67,6 +69,8 @@ ax25_uid_assoc *ax25_findbyuid(uid_t uid) ...@@ -67,6 +69,8 @@ ax25_uid_assoc *ax25_findbyuid(uid_t uid)
return res; return res;
} }
EXPORT_SYMBOL(ax25_findbyuid);
int ax25_uid_ioctl(int cmd, struct sockaddr_ax25 *sax) int ax25_uid_ioctl(int cmd, struct sockaddr_ax25 *sax)
{ {
ax25_uid_assoc *ax25_uid; ax25_uid_assoc *ax25_uid;
......
...@@ -18,14 +18,14 @@ static int min_backoff[1], max_backoff[] = {2}; ...@@ -18,14 +18,14 @@ static int min_backoff[1], max_backoff[] = {2};
static int min_conmode[1], max_conmode[] = {2}; static int min_conmode[1], max_conmode[] = {2};
static int min_window[] = {1}, max_window[] = {7}; static int min_window[] = {1}, max_window[] = {7};
static int min_ewindow[] = {1}, max_ewindow[] = {63}; static int min_ewindow[] = {1}, max_ewindow[] = {63};
static int min_t1[] = {1}, max_t1[] = {30 * HZ}; static int min_t1[] = {1}, max_t1[] = {30000};
static int min_t2[] = {1}, max_t2[] = {20 * HZ}; static int min_t2[] = {1}, max_t2[] = {20000};
static int min_t3[1], max_t3[] = {3600 * HZ}; static int min_t3[1], max_t3[] = {3600000};
static int min_idle[1], max_idle[] = {65535 * HZ}; static int min_idle[1], max_idle[] = {65535000};
static int min_n2[] = {1}, max_n2[] = {31}; static int min_n2[] = {1}, max_n2[] = {31};
static int min_paclen[] = {1}, max_paclen[] = {512}; static int min_paclen[] = {1}, max_paclen[] = {512};
static int min_proto[1], max_proto[] = { AX25_PROTO_MAX }; static int min_proto[1], max_proto[] = { AX25_PROTO_MAX };
static int min_ds_timeout[1], max_ds_timeout[] = {65535 * HZ}; static int min_ds_timeout[1], max_ds_timeout[] = {65535000};
static struct ctl_table_header *ax25_table_header; static struct ctl_table_header *ax25_table_header;
......
...@@ -493,7 +493,6 @@ struct elist_cb_state { ...@@ -493,7 +493,6 @@ struct elist_cb_state {
static void neigh_elist_cb(struct neighbour *neigh, void *_info) static void neigh_elist_cb(struct neighbour *neigh, void *_info)
{ {
struct elist_cb_state *s = _info; struct elist_cb_state *s = _info;
struct dn_dev *dn_db;
struct dn_neigh *dn; struct dn_neigh *dn;
if (neigh->dev != s->dev) if (neigh->dev != s->dev)
...@@ -503,10 +502,6 @@ static void neigh_elist_cb(struct neighbour *neigh, void *_info) ...@@ -503,10 +502,6 @@ static void neigh_elist_cb(struct neighbour *neigh, void *_info)
if (!(dn->flags & (DN_NDFLAG_R1|DN_NDFLAG_R2))) if (!(dn->flags & (DN_NDFLAG_R1|DN_NDFLAG_R2)))
return; return;
dn_db = (struct dn_dev *) s->dev->dn_ptr;
if (dn_db->parms.forwarding == 1 && (dn->flags & DN_NDFLAG_R2))
return;
if (s->t == s->n) if (s->t == s->n)
s->rs = dn_find_slot(s->ptr, s->n, dn->priority); s->rs = dn_find_slot(s->ptr, s->n, dn->priority);
else else
......
...@@ -162,6 +162,8 @@ static int get_tpkt_data(struct sk_buff **pskb, struct ip_conntrack *ct, ...@@ -162,6 +162,8 @@ static int get_tpkt_data(struct sk_buff **pskb, struct ip_conntrack *ct,
/* Validate TPKT length */ /* Validate TPKT length */
tpktlen = tpkt[2] * 256 + tpkt[3]; tpktlen = tpkt[2] * 256 + tpkt[3];
if (tpktlen < 4)
goto clear_out;
if (tpktlen > tcpdatalen) { if (tpktlen > tcpdatalen) {
if (tcpdatalen == 4) { /* Separate TPKT header */ if (tcpdatalen == 4) { /* Separate TPKT header */
/* Netmeeting sends TPKT header and data separately */ /* Netmeeting sends TPKT header and data separately */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ip_conntrack_helper_h323_asn1.c - BER and PER decoding library for H.323 * ip_conntrack_helper_h323_asn1.c - BER and PER decoding library for H.323
* conntrack/NAT module. * conntrack/NAT module.
* *
* Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@hotmail.com> * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@users.sourceforge.net>
* *
* This source code is licensed under General Public License version 2. * This source code is licensed under General Public License version 2.
* *
...@@ -703,6 +703,10 @@ int decode_choice(bitstr_t * bs, field_t * f, char *base, int level) ...@@ -703,6 +703,10 @@ int decode_choice(bitstr_t * bs, field_t * f, char *base, int level)
type = get_bits(bs, f->sz); type = get_bits(bs, f->sz);
} }
/* Write Type */
if (base)
*(unsigned *) base = type;
/* Check Range */ /* Check Range */
if (type >= f->ub) { /* Newer version? */ if (type >= f->ub) { /* Newer version? */
BYTE_ALIGN(bs); BYTE_ALIGN(bs);
...@@ -712,10 +716,6 @@ int decode_choice(bitstr_t * bs, field_t * f, char *base, int level) ...@@ -712,10 +716,6 @@ int decode_choice(bitstr_t * bs, field_t * f, char *base, int level)
return H323_ERROR_NONE; return H323_ERROR_NONE;
} }
/* Write Type */
if (base)
*(unsigned *) base = type;
/* Transfer to son level */ /* Transfer to son level */
son = &f->fields[type]; son = &f->fields[type];
if (son->attr & STOP) { if (son->attr & STOP) {
......
...@@ -219,8 +219,10 @@ ip_nat_out(unsigned int hooknum, ...@@ -219,8 +219,10 @@ ip_nat_out(unsigned int hooknum,
const struct net_device *out, const struct net_device *out,
int (*okfn)(struct sk_buff *)) int (*okfn)(struct sk_buff *))
{ {
#ifdef CONFIG_XFRM
struct ip_conntrack *ct; struct ip_conntrack *ct;
enum ip_conntrack_info ctinfo; enum ip_conntrack_info ctinfo;
#endif
unsigned int ret; unsigned int ret;
/* root is playing with raw sockets. */ /* root is playing with raw sockets. */
......
...@@ -1441,7 +1441,7 @@ static int compat_copy_entry_to_user(struct ipt_entry *e, ...@@ -1441,7 +1441,7 @@ static int compat_copy_entry_to_user(struct ipt_entry *e,
ret = -EFAULT; ret = -EFAULT;
origsize = *size; origsize = *size;
ce = (struct compat_ipt_entry __user *)*dstptr; ce = (struct compat_ipt_entry __user *)*dstptr;
if (__copy_to_user(ce, e, sizeof(struct ipt_entry))) if (copy_to_user(ce, e, sizeof(struct ipt_entry)))
goto out; goto out;
*dstptr += sizeof(struct compat_ipt_entry); *dstptr += sizeof(struct compat_ipt_entry);
...@@ -1459,9 +1459,9 @@ static int compat_copy_entry_to_user(struct ipt_entry *e, ...@@ -1459,9 +1459,9 @@ static int compat_copy_entry_to_user(struct ipt_entry *e,
goto out; goto out;
ret = -EFAULT; ret = -EFAULT;
next_offset = e->next_offset - (origsize - *size); next_offset = e->next_offset - (origsize - *size);
if (__put_user(target_offset, &ce->target_offset)) if (put_user(target_offset, &ce->target_offset))
goto out; goto out;
if (__put_user(next_offset, &ce->next_offset)) if (put_user(next_offset, &ce->next_offset))
goto out; goto out;
return 0; return 0;
out: out:
......
...@@ -1468,6 +1468,7 @@ void tcp_close(struct sock *sk, long timeout) ...@@ -1468,6 +1468,7 @@ void tcp_close(struct sock *sk, long timeout)
{ {
struct sk_buff *skb; struct sk_buff *skb;
int data_was_unread = 0; int data_was_unread = 0;
int state;
lock_sock(sk); lock_sock(sk);
sk->sk_shutdown = SHUTDOWN_MASK; sk->sk_shutdown = SHUTDOWN_MASK;
...@@ -1544,6 +1545,11 @@ void tcp_close(struct sock *sk, long timeout) ...@@ -1544,6 +1545,11 @@ void tcp_close(struct sock *sk, long timeout)
sk_stream_wait_close(sk, timeout); sk_stream_wait_close(sk, timeout);
adjudge_to_death: adjudge_to_death:
state = sk->sk_state;
sock_hold(sk);
sock_orphan(sk);
atomic_inc(sk->sk_prot->orphan_count);
/* It is the last release_sock in its life. It will remove backlog. */ /* It is the last release_sock in its life. It will remove backlog. */
release_sock(sk); release_sock(sk);
...@@ -1555,8 +1561,9 @@ void tcp_close(struct sock *sk, long timeout) ...@@ -1555,8 +1561,9 @@ void tcp_close(struct sock *sk, long timeout)
bh_lock_sock(sk); bh_lock_sock(sk);
BUG_TRAP(!sock_owned_by_user(sk)); BUG_TRAP(!sock_owned_by_user(sk));
sock_hold(sk); /* Have we already been destroyed by a softirq or backlog? */
sock_orphan(sk); if (state != TCP_CLOSE && sk->sk_state == TCP_CLOSE)
goto out;
/* This is a (useful) BSD violating of the RFC. There is a /* This is a (useful) BSD violating of the RFC. There is a
* problem with TCP as specified in that the other end could * problem with TCP as specified in that the other end could
...@@ -1584,7 +1591,6 @@ void tcp_close(struct sock *sk, long timeout) ...@@ -1584,7 +1591,6 @@ void tcp_close(struct sock *sk, long timeout)
if (tmo > TCP_TIMEWAIT_LEN) { if (tmo > TCP_TIMEWAIT_LEN) {
inet_csk_reset_keepalive_timer(sk, tcp_fin_time(sk)); inet_csk_reset_keepalive_timer(sk, tcp_fin_time(sk));
} else { } else {
atomic_inc(sk->sk_prot->orphan_count);
tcp_time_wait(sk, TCP_FIN_WAIT2, tmo); tcp_time_wait(sk, TCP_FIN_WAIT2, tmo);
goto out; goto out;
} }
...@@ -1603,7 +1609,6 @@ void tcp_close(struct sock *sk, long timeout) ...@@ -1603,7 +1609,6 @@ void tcp_close(struct sock *sk, long timeout)
NET_INC_STATS_BH(LINUX_MIB_TCPABORTONMEMORY); NET_INC_STATS_BH(LINUX_MIB_TCPABORTONMEMORY);
} }
} }
atomic_inc(sk->sk_prot->orphan_count);
if (sk->sk_state == TCP_CLOSE) if (sk->sk_state == TCP_CLOSE)
inet_csk_destroy_sock(sk); inet_csk_destroy_sock(sk);
......
...@@ -289,7 +289,7 @@ int xt_compat_match(void *match, void **dstptr, int *size, int convert) ...@@ -289,7 +289,7 @@ int xt_compat_match(void *match, void **dstptr, int *size, int convert)
case COMPAT_TO_USER: case COMPAT_TO_USER:
pm = (struct xt_entry_match *)match; pm = (struct xt_entry_match *)match;
msize = pm->u.user.match_size; msize = pm->u.user.match_size;
if (__copy_to_user(*dstptr, pm, msize)) { if (copy_to_user(*dstptr, pm, msize)) {
ret = -EFAULT; ret = -EFAULT;
break; break;
} }
...@@ -366,7 +366,7 @@ int xt_compat_target(void *target, void **dstptr, int *size, int convert) ...@@ -366,7 +366,7 @@ int xt_compat_target(void *target, void **dstptr, int *size, int convert)
case COMPAT_TO_USER: case COMPAT_TO_USER:
pt = (struct xt_entry_target *)target; pt = (struct xt_entry_target *)target;
tsize = pt->u.user.target_size; tsize = pt->u.user.target_size;
if (__copy_to_user(*dstptr, pt, tsize)) { if (copy_to_user(*dstptr, pt, tsize)) {
ret = -EFAULT; ret = -EFAULT;
break; break;
} }
......
...@@ -425,11 +425,16 @@ static int nr_create(struct socket *sock, int protocol) ...@@ -425,11 +425,16 @@ static int nr_create(struct socket *sock, int protocol)
nr_init_timers(sk); nr_init_timers(sk);
nr->t1 = sysctl_netrom_transport_timeout; nr->t1 =
nr->t2 = sysctl_netrom_transport_acknowledge_delay; msecs_to_jiffies(sysctl_netrom_transport_timeout);
nr->n2 = sysctl_netrom_transport_maximum_tries; nr->t2 =
nr->t4 = sysctl_netrom_transport_busy_delay; msecs_to_jiffies(sysctl_netrom_transport_acknowledge_delay);
nr->idle = sysctl_netrom_transport_no_activity_timeout; nr->n2 =
msecs_to_jiffies(sysctl_netrom_transport_maximum_tries);
nr->t4 =
msecs_to_jiffies(sysctl_netrom_transport_busy_delay);
nr->idle =
msecs_to_jiffies(sysctl_netrom_transport_no_activity_timeout);
nr->window = sysctl_netrom_transport_requested_window_size; nr->window = sysctl_netrom_transport_requested_window_size;
nr->bpqext = 1; nr->bpqext = 1;
......
...@@ -185,7 +185,6 @@ static struct net_device_stats *nr_get_stats(struct net_device *dev) ...@@ -185,7 +185,6 @@ static struct net_device_stats *nr_get_stats(struct net_device *dev)
void nr_setup(struct net_device *dev) void nr_setup(struct net_device *dev)
{ {
SET_MODULE_OWNER(dev);
dev->mtu = NR_MAX_PACKET_SIZE; dev->mtu = NR_MAX_PACKET_SIZE;
dev->hard_start_xmit = nr_xmit; dev->hard_start_xmit = nr_xmit;
dev->open = nr_open; dev->open = nr_open;
......
...@@ -518,11 +518,11 @@ static int rose_create(struct socket *sock, int protocol) ...@@ -518,11 +518,11 @@ static int rose_create(struct socket *sock, int protocol)
init_timer(&rose->timer); init_timer(&rose->timer);
init_timer(&rose->idletimer); init_timer(&rose->idletimer);
rose->t1 = sysctl_rose_call_request_timeout; rose->t1 = msecs_to_jiffies(sysctl_rose_call_request_timeout);
rose->t2 = sysctl_rose_reset_request_timeout; rose->t2 = msecs_to_jiffies(sysctl_rose_reset_request_timeout);
rose->t3 = sysctl_rose_clear_request_timeout; rose->t3 = msecs_to_jiffies(sysctl_rose_clear_request_timeout);
rose->hb = sysctl_rose_ack_hold_back_timeout; rose->hb = msecs_to_jiffies(sysctl_rose_ack_hold_back_timeout);
rose->idle = sysctl_rose_no_activity_timeout; rose->idle = msecs_to_jiffies(sysctl_rose_no_activity_timeout);
rose->state = ROSE_STATE_0; rose->state = ROSE_STATE_0;
......
...@@ -135,7 +135,6 @@ static struct net_device_stats *rose_get_stats(struct net_device *dev) ...@@ -135,7 +135,6 @@ static struct net_device_stats *rose_get_stats(struct net_device *dev)
void rose_setup(struct net_device *dev) void rose_setup(struct net_device *dev)
{ {
SET_MODULE_OWNER(dev);
dev->mtu = ROSE_MAX_PACKET_SIZE - 2; dev->mtu = ROSE_MAX_PACKET_SIZE - 2;
dev->hard_start_xmit = rose_xmit; dev->hard_start_xmit = rose_xmit;
dev->open = rose_open; dev->open = rose_open;
......
...@@ -40,7 +40,8 @@ void rose_start_ftimer(struct rose_neigh *neigh) ...@@ -40,7 +40,8 @@ void rose_start_ftimer(struct rose_neigh *neigh)
neigh->ftimer.data = (unsigned long)neigh; neigh->ftimer.data = (unsigned long)neigh;
neigh->ftimer.function = &rose_ftimer_expiry; neigh->ftimer.function = &rose_ftimer_expiry;
neigh->ftimer.expires = jiffies + sysctl_rose_link_fail_timeout; neigh->ftimer.expires =
jiffies + msecs_to_jiffies(sysctl_rose_link_fail_timeout);
add_timer(&neigh->ftimer); add_timer(&neigh->ftimer);
} }
...@@ -51,7 +52,8 @@ static void rose_start_t0timer(struct rose_neigh *neigh) ...@@ -51,7 +52,8 @@ static void rose_start_t0timer(struct rose_neigh *neigh)
neigh->t0timer.data = (unsigned long)neigh; neigh->t0timer.data = (unsigned long)neigh;
neigh->t0timer.function = &rose_t0timer_expiry; neigh->t0timer.function = &rose_t0timer_expiry;
neigh->t0timer.expires = jiffies + sysctl_rose_restart_request_timeout; neigh->t0timer.expires =
jiffies + msecs_to_jiffies(sysctl_rose_restart_request_timeout);
add_timer(&neigh->t0timer); add_timer(&neigh->t0timer);
} }
......
...@@ -48,8 +48,6 @@ static DEFINE_SPINLOCK(rose_route_list_lock); ...@@ -48,8 +48,6 @@ static DEFINE_SPINLOCK(rose_route_list_lock);
struct rose_neigh *rose_loopback_neigh; struct rose_neigh *rose_loopback_neigh;
static void rose_remove_neigh(struct rose_neigh *);
/* /*
* Add a new route to a node, and in the process add the node and the * Add a new route to a node, and in the process add the node and the
* neighbour if it is new. * neighbour if it is new.
...@@ -235,11 +233,8 @@ static void rose_remove_neigh(struct rose_neigh *rose_neigh) ...@@ -235,11 +233,8 @@ static void rose_remove_neigh(struct rose_neigh *rose_neigh)
skb_queue_purge(&rose_neigh->queue); skb_queue_purge(&rose_neigh->queue);
spin_lock_bh(&rose_neigh_list_lock);
if ((s = rose_neigh_list) == rose_neigh) { if ((s = rose_neigh_list) == rose_neigh) {
rose_neigh_list = rose_neigh->next; rose_neigh_list = rose_neigh->next;
spin_unlock_bh(&rose_neigh_list_lock);
kfree(rose_neigh->digipeat); kfree(rose_neigh->digipeat);
kfree(rose_neigh); kfree(rose_neigh);
return; return;
...@@ -248,7 +243,6 @@ static void rose_remove_neigh(struct rose_neigh *rose_neigh) ...@@ -248,7 +243,6 @@ static void rose_remove_neigh(struct rose_neigh *rose_neigh)
while (s != NULL && s->next != NULL) { while (s != NULL && s->next != NULL) {
if (s->next == rose_neigh) { if (s->next == rose_neigh) {
s->next = rose_neigh->next; s->next = rose_neigh->next;
spin_unlock_bh(&rose_neigh_list_lock);
kfree(rose_neigh->digipeat); kfree(rose_neigh->digipeat);
kfree(rose_neigh); kfree(rose_neigh);
return; return;
...@@ -256,7 +250,6 @@ static void rose_remove_neigh(struct rose_neigh *rose_neigh) ...@@ -256,7 +250,6 @@ static void rose_remove_neigh(struct rose_neigh *rose_neigh)
s = s->next; s = s->next;
} }
spin_unlock_bh(&rose_neigh_list_lock);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment