diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/atm/signaling.c | 10 | ||||
-rw-r--r-- | net/bridge/br_if.c | 33 | ||||
-rw-r--r-- | net/bridge/br_stp_if.c | 2 | ||||
-rw-r--r-- | net/dccp/ccids/ccid3.c | 10 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_queue.c | 2 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6_queue.c | 2 | ||||
-rw-r--r-- | net/unix/af_unix.c | 2 |
7 files changed, 30 insertions, 31 deletions
diff --git a/net/atm/signaling.c b/net/atm/signaling.c index 93ad59a28ef5..31d98b57e1de 100644 --- a/net/atm/signaling.c +++ b/net/atm/signaling.c | |||
@@ -39,25 +39,19 @@ static DECLARE_WAIT_QUEUE_HEAD(sigd_sleep); | |||
39 | static void sigd_put_skb(struct sk_buff *skb) | 39 | static void sigd_put_skb(struct sk_buff *skb) |
40 | { | 40 | { |
41 | #ifdef WAIT_FOR_DEMON | 41 | #ifdef WAIT_FOR_DEMON |
42 | static unsigned long silence; | ||
43 | DECLARE_WAITQUEUE(wait,current); | 42 | DECLARE_WAITQUEUE(wait,current); |
44 | 43 | ||
45 | add_wait_queue(&sigd_sleep,&wait); | 44 | add_wait_queue(&sigd_sleep,&wait); |
46 | while (!sigd) { | 45 | while (!sigd) { |
47 | set_current_state(TASK_UNINTERRUPTIBLE); | 46 | set_current_state(TASK_UNINTERRUPTIBLE); |
48 | if (time_after(jiffies, silence) || silence == 0) { | 47 | DPRINTK("atmsvc: waiting for signaling demon...\n"); |
49 | printk(KERN_INFO "atmsvc: waiting for signaling demon " | ||
50 | "...\n"); | ||
51 | silence = (jiffies+30*HZ)|1; | ||
52 | } | ||
53 | schedule(); | 48 | schedule(); |
54 | } | 49 | } |
55 | current->state = TASK_RUNNING; | 50 | current->state = TASK_RUNNING; |
56 | remove_wait_queue(&sigd_sleep,&wait); | 51 | remove_wait_queue(&sigd_sleep,&wait); |
57 | #else | 52 | #else |
58 | if (!sigd) { | 53 | if (!sigd) { |
59 | if (net_ratelimit()) | 54 | DPRINTK("atmsvc: no signaling demon\n"); |
60 | printk(KERN_WARNING "atmsvc: no signaling demon\n"); | ||
61 | kfree_skb(skb); | 55 | kfree_skb(skb); |
62 | return; | 56 | return; |
63 | } | 57 | } |
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 7fa3a5a9971f..f36b35edd60c 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -81,26 +81,27 @@ static void port_carrier_check(void *arg) | |||
81 | { | 81 | { |
82 | struct net_device *dev = arg; | 82 | struct net_device *dev = arg; |
83 | struct net_bridge_port *p; | 83 | struct net_bridge_port *p; |
84 | struct net_bridge *br; | ||
84 | 85 | ||
85 | rtnl_lock(); | 86 | rtnl_lock(); |
86 | p = dev->br_port; | 87 | p = dev->br_port; |
87 | if (!p) | 88 | if (!p) |
88 | goto done; | 89 | goto done; |
89 | 90 | br = p->br; | |
90 | if (netif_carrier_ok(p->dev)) { | 91 | |
91 | u32 cost = port_cost(p->dev); | 92 | if (netif_carrier_ok(dev)) |
92 | 93 | p->path_cost = port_cost(dev); | |
93 | spin_lock_bh(&p->br->lock); | 94 | |
94 | if (p->state == BR_STATE_DISABLED) { | 95 | if (br->dev->flags & IFF_UP) { |
95 | p->path_cost = cost; | 96 | spin_lock_bh(&br->lock); |
96 | br_stp_enable_port(p); | 97 | if (netif_carrier_ok(dev)) { |
98 | if (p->state == BR_STATE_DISABLED) | ||
99 | br_stp_enable_port(p); | ||
100 | } else { | ||
101 | if (p->state != BR_STATE_DISABLED) | ||
102 | br_stp_disable_port(p); | ||
97 | } | 103 | } |
98 | spin_unlock_bh(&p->br->lock); | 104 | spin_unlock_bh(&br->lock); |
99 | } else { | ||
100 | spin_lock_bh(&p->br->lock); | ||
101 | if (p->state != BR_STATE_DISABLED) | ||
102 | br_stp_disable_port(p); | ||
103 | spin_unlock_bh(&p->br->lock); | ||
104 | } | 105 | } |
105 | done: | 106 | done: |
106 | rtnl_unlock(); | 107 | rtnl_unlock(); |
@@ -168,6 +169,7 @@ static void del_nbp(struct net_bridge_port *p) | |||
168 | 169 | ||
169 | rcu_assign_pointer(dev->br_port, NULL); | 170 | rcu_assign_pointer(dev->br_port, NULL); |
170 | 171 | ||
172 | kobject_uevent(&p->kobj, KOBJ_REMOVE); | ||
171 | kobject_del(&p->kobj); | 173 | kobject_del(&p->kobj); |
172 | 174 | ||
173 | call_rcu(&p->rcu, destroy_nbp_rcu); | 175 | call_rcu(&p->rcu, destroy_nbp_rcu); |
@@ -276,8 +278,9 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br, | |||
276 | br_init_port(p); | 278 | br_init_port(p); |
277 | p->state = BR_STATE_DISABLED; | 279 | p->state = BR_STATE_DISABLED; |
278 | INIT_WORK(&p->carrier_check, port_carrier_check, dev); | 280 | INIT_WORK(&p->carrier_check, port_carrier_check, dev); |
279 | kobject_init(&p->kobj); | 281 | br_stp_port_timer_init(p); |
280 | 282 | ||
283 | kobject_init(&p->kobj); | ||
281 | kobject_set_name(&p->kobj, SYSFS_BRIDGE_PORT_ATTR); | 284 | kobject_set_name(&p->kobj, SYSFS_BRIDGE_PORT_ATTR); |
282 | p->kobj.ktype = &brport_ktype; | 285 | p->kobj.ktype = &brport_ktype; |
283 | p->kobj.parent = &(dev->class_dev.kobj); | 286 | p->kobj.parent = &(dev->class_dev.kobj); |
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c index 35cf3a074087..23dea1422c9a 100644 --- a/net/bridge/br_stp_if.c +++ b/net/bridge/br_stp_if.c | |||
@@ -39,8 +39,6 @@ void br_init_port(struct net_bridge_port *p) | |||
39 | p->state = BR_STATE_BLOCKING; | 39 | p->state = BR_STATE_BLOCKING; |
40 | p->topology_change_ack = 0; | 40 | p->topology_change_ack = 0; |
41 | p->config_pending = 0; | 41 | p->config_pending = 0; |
42 | |||
43 | br_stp_port_timer_init(p); | ||
44 | } | 42 | } |
45 | 43 | ||
46 | /* called under bridge lock */ | 44 | /* called under bridge lock */ |
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index aa68e0ab274d..35d1d347541c 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * net/dccp/ccids/ccid3.c | 2 | * net/dccp/ccids/ccid3.c |
3 | * | 3 | * |
4 | * Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand. | 4 | * Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand. |
5 | * Copyright (c) 2005 Ian McDonald <iam4@cs.waikato.ac.nz> | 5 | * Copyright (c) 2005-6 Ian McDonald <imcdnzl@gmail.com> |
6 | * | 6 | * |
7 | * An implementation of the DCCP protocol | 7 | * An implementation of the DCCP protocol |
8 | * | 8 | * |
@@ -1033,9 +1033,13 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
1033 | p_prev = hcrx->ccid3hcrx_p; | 1033 | p_prev = hcrx->ccid3hcrx_p; |
1034 | 1034 | ||
1035 | /* Calculate loss event rate */ | 1035 | /* Calculate loss event rate */ |
1036 | if (!list_empty(&hcrx->ccid3hcrx_li_hist)) | 1036 | if (!list_empty(&hcrx->ccid3hcrx_li_hist)) { |
1037 | u32 i_mean = dccp_li_hist_calc_i_mean(&hcrx->ccid3hcrx_li_hist); | ||
1038 | |||
1037 | /* Scaling up by 1000000 as fixed decimal */ | 1039 | /* Scaling up by 1000000 as fixed decimal */ |
1038 | hcrx->ccid3hcrx_p = 1000000 / dccp_li_hist_calc_i_mean(&hcrx->ccid3hcrx_li_hist); | 1040 | if (i_mean != 0) |
1041 | hcrx->ccid3hcrx_p = 1000000 / i_mean; | ||
1042 | } | ||
1039 | 1043 | ||
1040 | if (hcrx->ccid3hcrx_p > p_prev) { | 1044 | if (hcrx->ccid3hcrx_p > p_prev) { |
1041 | ccid3_hc_rx_send_feedback(sk); | 1045 | ccid3_hc_rx_send_feedback(sk); |
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c index 36339eb39e17..08f80e2ea2aa 100644 --- a/net/ipv4/netfilter/ip_queue.c +++ b/net/ipv4/netfilter/ip_queue.c | |||
@@ -524,7 +524,7 @@ ipq_rcv_skb(struct sk_buff *skb) | |||
524 | write_unlock_bh(&queue_lock); | 524 | write_unlock_bh(&queue_lock); |
525 | 525 | ||
526 | status = ipq_receive_peer(NLMSG_DATA(nlh), type, | 526 | status = ipq_receive_peer(NLMSG_DATA(nlh), type, |
527 | skblen - NLMSG_LENGTH(0)); | 527 | nlmsglen - NLMSG_LENGTH(0)); |
528 | if (status < 0) | 528 | if (status < 0) |
529 | RCV_SKB_FAIL(status); | 529 | RCV_SKB_FAIL(status); |
530 | 530 | ||
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c index 5027bbe6415e..af0635084df8 100644 --- a/net/ipv6/netfilter/ip6_queue.c +++ b/net/ipv6/netfilter/ip6_queue.c | |||
@@ -522,7 +522,7 @@ ipq_rcv_skb(struct sk_buff *skb) | |||
522 | write_unlock_bh(&queue_lock); | 522 | write_unlock_bh(&queue_lock); |
523 | 523 | ||
524 | status = ipq_receive_peer(NLMSG_DATA(nlh), type, | 524 | status = ipq_receive_peer(NLMSG_DATA(nlh), type, |
525 | skblen - NLMSG_LENGTH(0)); | 525 | nlmsglen - NLMSG_LENGTH(0)); |
526 | if (status < 0) | 526 | if (status < 0) |
527 | RCV_SKB_FAIL(status); | 527 | RCV_SKB_FAIL(status); |
528 | 528 | ||
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 1b5989b1b670..c323cc6a28b0 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -547,7 +547,7 @@ static struct sock * unix_create1(struct socket *sock) | |||
547 | struct sock *sk = NULL; | 547 | struct sock *sk = NULL; |
548 | struct unix_sock *u; | 548 | struct unix_sock *u; |
549 | 549 | ||
550 | if (atomic_read(&unix_nr_socks) >= 2*files_stat.max_files) | 550 | if (atomic_read(&unix_nr_socks) >= 2*get_max_files()) |
551 | goto out; | 551 | goto out; |
552 | 552 | ||
553 | sk = sk_alloc(PF_UNIX, GFP_KERNEL, &unix_proto, 1); | 553 | sk = sk_alloc(PF_UNIX, GFP_KERNEL, &unix_proto, 1); |