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
03c87be7
Commit
03c87be7
authored
Sep 16, 2003
by
Arnaldo Carvalho de Melo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
o LLC: move the sockets release function outside of llc_sap_close
parent
e1ceceb1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
42 deletions
+27
-42
include/net/llc_conn.h
include/net/llc_conn.h
+1
-0
include/net/llc_if.h
include/net/llc_if.h
+0
-14
include/net/llc_sap.h
include/net/llc_sap.h
+13
-0
net/802/psnap.c
net/802/psnap.c
+0
-1
net/llc/af_llc.c
net/llc/af_llc.c
+3
-1
net/llc/llc_conn.c
net/llc/llc_conn.c
+3
-3
net/llc/llc_sap.c
net/llc/llc_sap.c
+7
-23
No files found.
include/net/llc_conn.h
View file @
03c87be7
...
...
@@ -105,4 +105,5 @@ extern struct sock *llc_lookup_dgram(struct llc_sap *sap,
extern
void
llc_save_primitive
(
struct
sk_buff
*
skb
,
u8
prim
);
extern
u8
llc_data_accept_state
(
u8
state
);
extern
void
llc_build_offset_table
(
void
);
extern
int
llc_release_sockets
(
struct
llc_sap
*
sap
);
#endif
/* LLC_CONN_H */
include/net/llc_if.h
View file @
03c87be7
...
...
@@ -100,22 +100,8 @@ static __inline__ int llc_mac_match(u8 *mac1, u8 *mac2)
return
!
memcmp
(
mac1
,
mac2
,
IFHWADDRLEN
);
}
struct
llc_sap
;
extern
struct
llc_sap
*
llc_sap_open
(
u8
lsap
,
int
(
*
func
)(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
struct
packet_type
*
pt
));
extern
void
llc_sap_close
(
struct
llc_sap
*
sap
);
extern
int
llc_establish_connection
(
struct
sock
*
sk
,
u8
*
lmac
,
u8
*
dmac
,
u8
dsap
);
extern
int
llc_build_and_send_pkt
(
struct
sock
*
sk
,
struct
sk_buff
*
skb
);
extern
void
llc_build_and_send_ui_pkt
(
struct
llc_sap
*
sap
,
struct
sk_buff
*
skb
,
u8
*
dmac
,
u8
dsap
);
extern
void
llc_build_and_send_xid_pkt
(
struct
llc_sap
*
sap
,
struct
sk_buff
*
skb
,
u8
*
dmac
,
u8
dsap
);
extern
void
llc_build_and_send_test_pkt
(
struct
llc_sap
*
sap
,
struct
sk_buff
*
skb
,
u8
*
dmac
,
u8
dsap
);
extern
int
llc_send_disc
(
struct
sock
*
sk
);
#endif
/* LLC_IF_H */
include/net/llc_sap.h
View file @
03c87be7
...
...
@@ -44,4 +44,17 @@ extern void llc_sap_assign_sock(struct llc_sap *sap, struct sock *sk);
extern
void
llc_sap_unassign_sock
(
struct
llc_sap
*
sap
,
struct
sock
*
sk
);
extern
void
llc_sap_state_process
(
struct
llc_sap
*
sap
,
struct
sk_buff
*
skb
);
extern
void
llc_sap_rtn_pdu
(
struct
llc_sap
*
sap
,
struct
sk_buff
*
skb
);
extern
struct
llc_sap
*
llc_sap_open
(
u8
lsap
,
int
(
*
rcv
)(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
struct
packet_type
*
pt
));
extern
void
llc_sap_close
(
struct
llc_sap
*
sap
);
extern
void
llc_build_and_send_ui_pkt
(
struct
llc_sap
*
sap
,
struct
sk_buff
*
skb
,
u8
*
dmac
,
u8
dsap
);
extern
void
llc_build_and_send_xid_pkt
(
struct
llc_sap
*
sap
,
struct
sk_buff
*
skb
,
u8
*
dmac
,
u8
dsap
);
extern
void
llc_build_and_send_test_pkt
(
struct
llc_sap
*
sap
,
struct
sk_buff
*
skb
,
u8
*
dmac
,
u8
dsap
);
#endif
/* LLC_SAP_H */
net/802/psnap.c
View file @
03c87be7
...
...
@@ -16,7 +16,6 @@
#include <linux/skbuff.h>
#include <net/datalink.h>
#include <net/psnap.h>
#include <net/llc_if.h>
#include <net/llc_sap.h>
#include <linux/mm.h>
#include <linux/in.h>
...
...
net/llc/af_llc.c
View file @
03c87be7
...
...
@@ -184,8 +184,10 @@ static int llc_ui_release(struct socket *sock)
if
(
!
sk
->
sk_zapped
)
llc_sap_unassign_sock
(
llc
->
sap
,
sk
);
release_sock
(
sk
);
if
(
llc
->
sap
&&
hlist_empty
(
&
llc
->
sap
->
sk_list
.
list
))
if
(
llc
->
sap
&&
hlist_empty
(
&
llc
->
sap
->
sk_list
.
list
))
{
llc_release_sockets
(
llc
->
sap
);
llc_sap_close
(
llc
->
sap
);
}
sock_put
(
sk
);
llc_sk_free
(
sk
);
out:
...
...
net/llc/llc_conn.c
View file @
03c87be7
...
...
@@ -736,13 +736,13 @@ static atomic_t llc_sock_nr;
#endif
/**
* llc_release_
conns - releases all connections of
a sap
* @sap: sap to release its
connection
s
* llc_release_
sockets - releases all sockets in
a sap
* @sap: sap to release its
socket
s
*
* Releases all connections of a sap. Returns 0 if all actions complete
* successfully, nonzero otherwise
*/
int
llc_release_
connection
s
(
struct
llc_sap
*
sap
)
int
llc_release_
socket
s
(
struct
llc_sap
*
sap
)
{
int
rc
=
0
;
struct
sock
*
sk
;
...
...
net/llc/llc_sap.c
View file @
03c87be7
...
...
@@ -245,28 +245,6 @@ struct llc_sap *llc_sap_alloc(void)
return
sap
;
}
/*
* FIXME: this will go away as soon as sap->release_connections is introduced
* in the next changesets.
*/
extern
int
llc_release_connections
(
struct
llc_sap
*
sap
);
/**
* llc_free_sap - frees a sap
* @sap: Address of the sap
*
* Frees all associated connections (if any), removes this sap from
* the list of saps in te station and them frees the memory for this sap.
*/
void
llc_free_sap
(
struct
llc_sap
*
sap
)
{
llc_release_connections
(
sap
);
write_lock_bh
(
&
sap
->
station
->
sap_list
.
lock
);
list_del
(
&
sap
->
node
);
write_unlock_bh
(
&
sap
->
station
->
sap_list
.
lock
);
kfree
(
sap
);
}
/**
* llc_sap_open - open interface to the upper layers.
* @lsap: SAP number.
...
...
@@ -308,10 +286,16 @@ struct llc_sap *llc_sap_open(u8 lsap, int (*func)(struct sk_buff *skb,
*
* Close interface function to upper layer. Each one who wants to
* close an open SAP (for example NetBEUI) should call this function.
* Removes this sap from the list of saps in the station and then
* frees the memory for this sap.
*/
void
llc_sap_close
(
struct
llc_sap
*
sap
)
{
llc_free_sap
(
sap
);
WARN_ON
(
!
hlist_empty
(
&
sap
->
sk_list
.
list
));
write_lock_bh
(
&
sap
->
station
->
sap_list
.
lock
);
list_del
(
&
sap
->
node
);
write_unlock_bh
(
&
sap
->
station
->
sap_list
.
lock
);
kfree
(
sap
);
}
EXPORT_SYMBOL
(
llc_sap_open
);
...
...
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