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
07211edd
Commit
07211edd
authored
Apr 29, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://kernel.bkbits.net/acme/net-2.5
into nuts.ninka.net:/home/davem/src/BK/net-2.5
parents
89c03538
93996134
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
net/802/psnap.c
net/802/psnap.c
+17
-15
No files found.
net/802/psnap.c
View file @
07211edd
...
...
@@ -21,9 +21,9 @@
#include <linux/mm.h>
#include <linux/in.h>
#include <linux/init.h>
#include <linux/brlock.h>
LIST_HEAD
(
snap_list
);
static
LIST_HEAD
(
snap_list
);
static
spinlock_t
snap_lock
=
SPIN_LOCK_UNLOCKED
;
static
struct
llc_sap
*
snap_sap
;
/*
...
...
@@ -34,17 +34,13 @@ static struct datalink_proto *find_snap_client(unsigned char *desc)
struct
list_head
*
entry
;
struct
datalink_proto
*
proto
=
NULL
,
*
p
;
if
(
list_empty
(
&
snap_list
))
goto
out
;
list_for_each
(
entry
,
&
snap_list
)
{
list_for_each_rcu
(
entry
,
&
snap_list
)
{
p
=
list_entry
(
entry
,
struct
datalink_proto
,
node
);
if
(
!
memcmp
(
p
->
type
,
desc
,
5
))
{
proto
=
p
;
break
;
}
}
out:
return
proto
;
}
...
...
@@ -55,11 +51,13 @@ static int snap_rcv(struct sk_buff *skb, struct net_device *dev,
struct
packet_type
*
pt
)
{
int
rc
=
1
;
struct
datalink_proto
*
proto
=
find_snap_client
(
skb
->
h
.
raw
)
;
struct
datalink_proto
*
proto
;
static
struct
packet_type
snap_packet_type
=
{
.
type
=
__constant_htons
(
ETH_P_SNAP
),
};
rcu_read_lock
();
proto
=
find_snap_client
(
skb
->
h
.
raw
);
if
(
proto
)
{
/* Pass the frame on. */
skb
->
h
.
raw
+=
5
;
...
...
@@ -71,6 +69,7 @@ static int snap_rcv(struct sk_buff *skb, struct net_device *dev,
rc
=
1
;
}
rcu_read_unlock
();
return
rc
;
}
...
...
@@ -124,7 +123,7 @@ struct datalink_proto *register_snap_client(unsigned char *desc,
{
struct
datalink_proto
*
proto
=
NULL
;
br_write_lock_bh
(
BR_NETPROTO_LOCK
);
spin_lock_bh
(
&
snap_lock
);
if
(
find_snap_client
(
desc
))
goto
out
;
...
...
@@ -135,10 +134,12 @@ struct datalink_proto *register_snap_client(unsigned char *desc,
proto
->
rcvfunc
=
rcvfunc
;
proto
->
header_length
=
5
+
3
;
/* snap + 802.2 */
proto
->
request
=
snap_request
;
list_add
(
&
proto
->
node
,
&
snap_list
);
list_add
_rcu
(
&
proto
->
node
,
&
snap_list
);
}
out:
br_write_unlock_bh
(
BR_NETPROTO_LOCK
);
spin_unlock_bh
(
&
snap_lock
);
synchronize_net
();
return
proto
;
}
...
...
@@ -147,12 +148,13 @@ struct datalink_proto *register_snap_client(unsigned char *desc,
*/
void
unregister_snap_client
(
struct
datalink_proto
*
proto
)
{
br_write_lock_bh
(
BR_NETPROTO_LOCK
);
spin_lock_bh
(
&
snap_lock
);
list_del_rcu
(
&
proto
->
node
);
spin_unlock_bh
(
&
snap_lock
);
list_del
(
&
proto
->
node
);
kfree
(
proto
);
synchronize_net
();
br_write_unlock_bh
(
BR_NETPROTO_LOCK
);
kfree
(
proto
);
}
MODULE_LICENSE
(
"GPL"
);
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