Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
94ca866c
Commit
94ca866c
authored
Aug 14, 2003
by
Jeroen Vreeken
Committed by
David S. Miller
Aug 14, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NETROM]: Lock sockets while doing protocol processing.
parent
af8a45cb
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
168 additions
and
52 deletions
+168
-52
net/netrom/af_netrom.c
net/netrom/af_netrom.c
+156
-52
net/netrom/nr_in.c
net/netrom/nr_in.c
+6
-0
net/netrom/nr_timer.c
net/netrom/nr_timer.c
+6
-0
No files found.
net/netrom/af_netrom.c
View file @
94ca866c
This diff is collapsed.
Click to expand it.
net/netrom/nr_in.c
View file @
94ca866c
...
...
@@ -74,6 +74,7 @@ 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
)
{
bh_lock_sock
(
sk
);
switch
(
frametype
)
{
case
NR_CONNACK
:
{
nr_cb
*
nr
=
nr_sk
(
sk
);
...
...
@@ -102,6 +103,7 @@ static int nr_state1_machine(struct sock *sk, struct sk_buff *skb,
default:
break
;
}
bh_unlock_sock
(
sk
);
return
0
;
}
...
...
@@ -114,6 +116,7 @@ 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
)
{
bh_lock_sock
(
sk
);
switch
(
frametype
)
{
case
NR_CONNACK
|
NR_CHOKE_FLAG
:
nr_disconnect
(
sk
,
ECONNRESET
);
...
...
@@ -129,6 +132,7 @@ static int nr_state2_machine(struct sock *sk, struct sk_buff *skb,
default:
break
;
}
bh_unlock_sock
(
sk
);
return
0
;
}
...
...
@@ -150,6 +154,7 @@ static int nr_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype
nr
=
skb
->
data
[
18
];
ns
=
skb
->
data
[
17
];
bh_lock_sock
(
sk
);
switch
(
frametype
)
{
case
NR_CONNREQ
:
nr_write_internal
(
sk
,
NR_CONNACK
);
...
...
@@ -260,6 +265,7 @@ static int nr_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype
default:
break
;
}
bh_unlock_sock
(
sk
);
return
queued
;
}
...
...
net/netrom/nr_timer.c
View file @
94ca866c
...
...
@@ -143,7 +143,10 @@ static void nr_heartbeat_expiry(unsigned long param)
is accepted() it isn't 'dead' so doesn't get removed. */
if
(
sock_flag
(
sk
,
SOCK_DESTROY
)
||
(
sk
->
sk_state
==
TCP_LISTEN
&&
sock_flag
(
sk
,
SOCK_DEAD
)))
{
sock_hold
(
sk
);
nr_destroy_socket
(
sk
);
bh_unlock_sock
(
sk
);
sock_put
(
sk
);
return
;
}
break
;
...
...
@@ -227,6 +230,7 @@ static void nr_t1timer_expiry(unsigned long param)
case
NR_STATE_1
:
if
(
nr
->
n2count
==
nr
->
n2
)
{
nr_disconnect
(
sk
,
ETIMEDOUT
);
bh_unlock_sock
(
sk
);
return
;
}
else
{
nr
->
n2count
++
;
...
...
@@ -237,6 +241,7 @@ static void nr_t1timer_expiry(unsigned long param)
case
NR_STATE_2
:
if
(
nr
->
n2count
==
nr
->
n2
)
{
nr_disconnect
(
sk
,
ETIMEDOUT
);
bh_unlock_sock
(
sk
);
return
;
}
else
{
nr
->
n2count
++
;
...
...
@@ -247,6 +252,7 @@ static void nr_t1timer_expiry(unsigned long param)
case
NR_STATE_3
:
if
(
nr
->
n2count
==
nr
->
n2
)
{
nr_disconnect
(
sk
,
ETIMEDOUT
);
bh_unlock_sock
(
sk
);
return
;
}
else
{
nr
->
n2count
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment