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
Kirill Smelkov
linux
Commits
420fe234
Commit
420fe234
authored
Apr 24, 2007
by
YOSHIFUJI Hideaki
Committed by
David S. Miller
Apr 25, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV6] SIT: Unify code path to get hash array index.
Signed-off-by:
YOSHIFUJI Hideaki
<
yoshfuji@linux-ipv6.org
>
parent
30041e4a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
14 deletions
+9
-14
net/ipv6/sit.c
net/ipv6/sit.c
+9
-14
No files found.
net/ipv6/sit.c
View file @
420fe234
...
@@ -99,10 +99,10 @@ static struct ip_tunnel * ipip6_tunnel_lookup(__be32 remote, __be32 local)
...
@@ -99,10 +99,10 @@ static struct ip_tunnel * ipip6_tunnel_lookup(__be32 remote, __be32 local)
return
NULL
;
return
NULL
;
}
}
static
struct
ip_tunnel
**
ipip6_bucket
(
struct
ip_tunnel
*
t
)
static
struct
ip_tunnel
**
__ipip6_bucket
(
struct
ip_tunnel_parm
*
parms
)
{
{
__be32
remote
=
t
->
parms
.
iph
.
daddr
;
__be32
remote
=
parms
->
iph
.
daddr
;
__be32
local
=
t
->
parms
.
iph
.
saddr
;
__be32
local
=
parms
->
iph
.
saddr
;
unsigned
h
=
0
;
unsigned
h
=
0
;
int
prio
=
0
;
int
prio
=
0
;
...
@@ -117,6 +117,11 @@ static struct ip_tunnel ** ipip6_bucket(struct ip_tunnel *t)
...
@@ -117,6 +117,11 @@ static struct ip_tunnel ** ipip6_bucket(struct ip_tunnel *t)
return
&
tunnels
[
prio
][
h
];
return
&
tunnels
[
prio
][
h
];
}
}
static
inline
struct
ip_tunnel
**
ipip6_bucket
(
struct
ip_tunnel
*
t
)
{
return
__ipip6_bucket
(
&
t
->
parms
);
}
static
void
ipip6_tunnel_unlink
(
struct
ip_tunnel
*
t
)
static
void
ipip6_tunnel_unlink
(
struct
ip_tunnel
*
t
)
{
{
struct
ip_tunnel
**
tp
;
struct
ip_tunnel
**
tp
;
...
@@ -147,19 +152,9 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int
...
@@ -147,19 +152,9 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int
__be32
local
=
parms
->
iph
.
saddr
;
__be32
local
=
parms
->
iph
.
saddr
;
struct
ip_tunnel
*
t
,
**
tp
,
*
nt
;
struct
ip_tunnel
*
t
,
**
tp
,
*
nt
;
struct
net_device
*
dev
;
struct
net_device
*
dev
;
unsigned
h
=
0
;
int
prio
=
0
;
char
name
[
IFNAMSIZ
];
char
name
[
IFNAMSIZ
];
if
(
remote
)
{
for
(
tp
=
__ipip6_bucket
(
parms
);
(
t
=
*
tp
)
!=
NULL
;
tp
=
&
t
->
next
)
{
prio
|=
2
;
h
^=
HASH
(
remote
);
}
if
(
local
)
{
prio
|=
1
;
h
^=
HASH
(
local
);
}
for
(
tp
=
&
tunnels
[
prio
][
h
];
(
t
=
*
tp
)
!=
NULL
;
tp
=
&
t
->
next
)
{
if
(
local
==
t
->
parms
.
iph
.
saddr
&&
remote
==
t
->
parms
.
iph
.
daddr
)
if
(
local
==
t
->
parms
.
iph
.
saddr
&&
remote
==
t
->
parms
.
iph
.
daddr
)
return
t
;
return
t
;
}
}
...
...
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