git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge to Fedora kernel-2.6.18-1.2255_FC5-vs2.0.2.2-rc9 patched with stable patch...
[linux-2.6.git]
/
net
/
netrom
/
nr_in.c
diff --git
a/net/netrom/nr_in.c
b/net/netrom/nr_in.c
index
e272aff
..
a7d88b5
100644
(file)
--- a/
net/netrom/nr_in.c
+++ b/
net/netrom/nr_in.c
@@
-22,8
+22,7
@@
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <net/sock.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <net/sock.h>
-#include <net/tcp.h>
-#include <net/ip.h> /* For ip_rcv */
+#include <net/tcp_states.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <linux/fcntl.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <linux/fcntl.h>
@@
-34,7
+33,7
@@
static int nr_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more)
{
struct sk_buff *skbo, *skbn = skb;
static int nr_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more)
{
struct sk_buff *skbo, *skbn = skb;
-
nr_cb
*nr = nr_sk(sk);
+
struct nr_sock
*nr = nr_sk(sk);
skb_pull(skb, NR_NETWORK_LEN + NR_TRANSPORT_LEN);
skb_pull(skb, NR_NETWORK_LEN + NR_TRANSPORT_LEN);
@@
-74,10
+73,9
@@
static int nr_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more)
static int nr_state1_machine(struct sock *sk, struct sk_buff *skb,
int frametype)
{
static int nr_state1_machine(struct sock *sk, struct sk_buff *skb,
int frametype)
{
- bh_lock_sock(sk);
switch (frametype) {
case NR_CONNACK: {
switch (frametype) {
case NR_CONNACK: {
-
nr_cb
*nr = nr_sk(sk);
+
struct nr_sock
*nr = nr_sk(sk);
nr_stop_t1timer(sk);
nr_start_idletimer(sk);
nr_stop_t1timer(sk);
nr_start_idletimer(sk);
@@
-100,11
+98,14
@@
static int nr_state1_machine(struct sock *sk, struct sk_buff *skb,
nr_disconnect(sk, ECONNREFUSED);
break;
nr_disconnect(sk, ECONNREFUSED);
break;
+ case NR_RESET:
+ if (sysctl_netrom_reset_circuit)
+ nr_disconnect(sk, ECONNRESET);
+ break;
+
default:
break;
}
default:
break;
}
- bh_unlock_sock(sk);
-
return 0;
}
return 0;
}
@@
-116,7
+117,6
@@
static int nr_state1_machine(struct sock *sk, struct sk_buff *skb,
static int nr_state2_machine(struct sock *sk, struct sk_buff *skb,
int frametype)
{
static int nr_state2_machine(struct sock *sk, struct sk_buff *skb,
int frametype)
{
- bh_lock_sock(sk);
switch (frametype) {
case NR_CONNACK | NR_CHOKE_FLAG:
nr_disconnect(sk, ECONNRESET);
switch (frametype) {
case NR_CONNACK | NR_CHOKE_FLAG:
nr_disconnect(sk, ECONNRESET);
@@
-129,11
+129,14
@@
static int nr_state2_machine(struct sock *sk, struct sk_buff *skb,
nr_disconnect(sk, 0);
break;
nr_disconnect(sk, 0);
break;
+ case NR_RESET:
+ if (sysctl_netrom_reset_circuit)
+ nr_disconnect(sk, ECONNRESET);
+ break;
+
default:
break;
}
default:
break;
}
- bh_unlock_sock(sk);
-
return 0;
}
return 0;
}
@@
-144,7
+147,7
@@
static int nr_state2_machine(struct sock *sk, struct sk_buff *skb,
*/
static int nr_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype)
{
*/
static int nr_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype)
{
-
nr_cb
*nrom = nr_sk(sk);
+
struct nr_sock
*nrom = nr_sk(sk);
struct sk_buff_head temp_queue;
struct sk_buff *skbn;
unsigned short save_vr;
struct sk_buff_head temp_queue;
struct sk_buff *skbn;
unsigned short save_vr;
@@
-154,7
+157,6
@@
static int nr_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype
nr = skb->data[18];
ns = skb->data[17];
nr = skb->data[18];
ns = skb->data[17];
- bh_lock_sock(sk);
switch (frametype) {
case NR_CONNREQ:
nr_write_internal(sk, NR_CONNACK);
switch (frametype) {
case NR_CONNREQ:
nr_write_internal(sk, NR_CONNACK);
@@
-262,18
+264,21
@@
static int nr_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype
}
break;
}
break;
+ case NR_RESET:
+ if (sysctl_netrom_reset_circuit)
+ nr_disconnect(sk, ECONNRESET);
+ break;
+
default:
break;
}
default:
break;
}
- bh_unlock_sock(sk);
-
return queued;
}
return queued;
}
-/* Higher level upcall for a LAPB frame */
+/* Higher level upcall for a LAPB frame
- called with sk locked
*/
int nr_process_rx_frame(struct sock *sk, struct sk_buff *skb)
{
int nr_process_rx_frame(struct sock *sk, struct sk_buff *skb)
{
-
nr_cb
*nr = nr_sk(sk);
+
struct nr_sock
*nr = nr_sk(sk);
int queued = 0, frametype;
if (nr->state == NR_STATE_0)
int queued = 0, frametype;
if (nr->state == NR_STATE_0)