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
109a8a82
Commit
109a8a82
authored
Sep 21, 2002
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge master.kernel.org:/home/acme/BK/llc-2.5
into nuts.ninka.net:/home/davem/src/BK/net-2.5
parents
cc8f2609
bd2c9a34
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
69 deletions
+5
-69
net/llc/llc_sock.c
net/llc/llc_sock.c
+5
-69
No files found.
net/llc/llc_sock.c
View file @
109a8a82
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
#include <net/llc_pdu.h>
#include <net/llc_pdu.h>
#include <net/llc_conn.h>
#include <net/llc_conn.h>
#include <net/llc_mac.h>
#include <net/llc_mac.h>
#include <net/llc_main.h>
#include <linux/llc.h>
#include <linux/llc.h>
#include <linux/if_arp.h>
#include <linux/if_arp.h>
#include <linux/rtnetlink.h>
#include <linux/rtnetlink.h>
...
@@ -144,52 +145,6 @@ static int llc_ui_send_data(struct sock* sk, struct sk_buff *skb, int noblock)
...
@@ -144,52 +145,6 @@ static int llc_ui_send_data(struct sock* sk, struct sk_buff *skb, int noblock)
return
rc
;
return
rc
;
}
}
/**
* llc_ui_find_sap - returns sap struct that matches sap number specified
* @sap: Sap number to search for.
*
* Search the local socket list and return the first instance of the sap
* structure which matches the sap number the user specified.
* Returns llc_sap upon match, %NULL otherwise.
*/
static
__inline__
struct
llc_sap
*
llc_ui_find_sap
(
u8
sap
)
{
struct
sock
*
sk
;
struct
llc_sap
*
s
=
NULL
;
read_lock_bh
(
&
llc_ui_sockets_lock
);
for
(
sk
=
llc_ui_sockets
;
sk
;
sk
=
sk
->
next
)
{
struct
llc_opt
*
llc
=
llc_sk
(
sk
);
if
(
!
llc
->
sap
)
continue
;
if
(
llc
->
sap
->
laddr
.
lsap
==
sap
)
{
s
=
llc
->
sap
;
break
;
}
}
read_unlock_bh
(
&
llc_ui_sockets_lock
);
return
s
;
}
static
struct
sock
*
__llc_ui_find_sk_by_exact
(
struct
llc_addr
*
laddr
,
struct
llc_addr
*
daddr
)
{
struct
sock
*
sk
;
for
(
sk
=
llc_ui_sockets
;
sk
;
sk
=
sk
->
next
)
{
struct
llc_opt
*
llc
=
llc_sk
(
sk
);
if
(
llc
->
addr
.
sllc_ssap
==
laddr
->
lsap
&&
llc
->
addr
.
sllc_dsap
==
daddr
->
lsap
&&
llc_mac_null
(
llc
->
addr
.
sllc_mmac
)
&&
llc_mac_match
(
llc
->
addr
.
sllc_smac
,
laddr
->
mac
)
&&
llc_mac_match
(
llc
->
addr
.
sllc_dmac
,
daddr
->
mac
))
break
;
}
return
sk
;
}
/**
/**
* __llc_ui_find_sk_by_addr - return socket matching local mac + sap.
* __llc_ui_find_sk_by_addr - return socket matching local mac + sap.
* @addr: Local address to match.
* @addr: Local address to match.
...
@@ -204,7 +159,7 @@ static struct sock *__llc_ui_find_sk_by_addr(struct llc_addr *laddr,
...
@@ -204,7 +159,7 @@ static struct sock *__llc_ui_find_sk_by_addr(struct llc_addr *laddr,
struct
llc_addr
*
daddr
,
struct
llc_addr
*
daddr
,
struct
net_device
*
dev
)
struct
net_device
*
dev
)
{
{
struct
sock
*
sk
,
*
tmp_sk
;
struct
sock
*
sk
;
for
(
sk
=
llc_ui_sockets
;
sk
;
sk
=
sk
->
next
)
{
for
(
sk
=
llc_ui_sockets
;
sk
;
sk
=
sk
->
next
)
{
struct
llc_opt
*
llc
=
llc_sk
(
sk
);
struct
llc_opt
*
llc
=
llc_sk
(
sk
);
...
@@ -226,11 +181,6 @@ static struct sock *__llc_ui_find_sk_by_addr(struct llc_addr *laddr,
...
@@ -226,11 +181,6 @@ static struct sock *__llc_ui_find_sk_by_addr(struct llc_addr *laddr,
break
;
break
;
if
(
!
llc_mac_match
(
llc
->
addr
.
sllc_smac
,
laddr
->
mac
))
if
(
!
llc_mac_match
(
llc
->
addr
.
sllc_smac
,
laddr
->
mac
))
continue
;
continue
;
tmp_sk
=
__llc_ui_find_sk_by_exact
(
laddr
,
daddr
);
if
(
tmp_sk
)
{
sk
=
tmp_sk
;
break
;
}
if
(
llc_mac_null
(
llc
->
addr
.
sllc_dmac
))
if
(
llc_mac_null
(
llc
->
addr
.
sllc_dmac
))
break
;
break
;
}
}
...
@@ -251,20 +201,6 @@ static struct sock *llc_ui_find_sk_by_addr(struct llc_addr *addr,
...
@@ -251,20 +201,6 @@ static struct sock *llc_ui_find_sk_by_addr(struct llc_addr *addr,
return
sk
;
return
sk
;
}
}
static
struct
sock
*
llc_ui_bh_find_sk_by_addr
(
struct
llc_addr
*
addr
,
struct
llc_addr
*
daddr
,
struct
net_device
*
dev
)
{
struct
sock
*
sk
;
read_lock_bh
(
&
llc_ui_sockets_lock
);
sk
=
__llc_ui_find_sk_by_addr
(
addr
,
daddr
,
dev
);
if
(
sk
)
sock_hold
(
sk
);
read_unlock_bh
(
&
llc_ui_sockets_lock
);
return
sk
;
}
/**
/**
* llc_ui_insert_socket - insert socket into list
* llc_ui_insert_socket - insert socket into list
* @sk: Socket to insert.
* @sk: Socket to insert.
...
@@ -388,7 +324,7 @@ static int llc_ui_autoport(void)
...
@@ -388,7 +324,7 @@ static int llc_ui_autoport(void)
while
(
tries
<
LLC_SAP_DYN_TRIES
)
{
while
(
tries
<
LLC_SAP_DYN_TRIES
)
{
for
(
i
=
llc_ui_sap_last_autoport
;
for
(
i
=
llc_ui_sap_last_autoport
;
i
<
LLC_SAP_DYN_STOP
;
i
+=
2
)
{
i
<
LLC_SAP_DYN_STOP
;
i
+=
2
)
{
sap
=
llc_
ui_find_sap
(
i
);
sap
=
llc_
sap_find
(
i
);
if
(
!
sap
)
{
if
(
!
sap
)
{
llc_ui_sap_last_autoport
=
i
+
2
;
llc_ui_sap_last_autoport
=
i
+
2
;
goto
out
;
goto
out
;
...
@@ -446,7 +382,7 @@ static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr)
...
@@ -446,7 +382,7 @@ static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr)
if
(
!
addr
->
sllc_ssap
)
if
(
!
addr
->
sllc_ssap
)
goto
out
;
goto
out
;
}
}
sap
=
llc_
ui_find_sap
(
addr
->
sllc_ssap
);
sap
=
llc_
sap_find
(
addr
->
sllc_ssap
);
if
(
!
sap
)
{
if
(
!
sap
)
{
sap
=
llc_sap_open
(
llc_ui_indicate
,
llc_ui_confirm
,
sap
=
llc_sap_open
(
llc_ui_indicate
,
llc_ui_confirm
,
addr
->
sllc_ssap
);
addr
->
sllc_ssap
);
...
@@ -472,7 +408,7 @@ static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr)
...
@@ -472,7 +408,7 @@ static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr)
memcpy
(
laddr
.
mac
,
addr
->
sllc_smac
,
IFHWADDRLEN
);
memcpy
(
laddr
.
mac
,
addr
->
sllc_smac
,
IFHWADDRLEN
);
laddr
.
lsap
=
addr
->
sllc_ssap
;
laddr
.
lsap
=
addr
->
sllc_ssap
;
rc
=
-
EADDRINUSE
;
/* mac + sap clash. */
rc
=
-
EADDRINUSE
;
/* mac + sap clash. */
ask
=
llc_
ui_bh_find_sk_by_addr
(
&
laddr
,
&
daddr
,
dev
);
ask
=
llc_
lookup_established
(
sap
,
&
daddr
,
&
laddr
);
if
(
ask
)
{
if
(
ask
)
{
sock_put
(
ask
);
sock_put
(
ask
);
goto
out
;
goto
out
;
...
...
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