Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
Linux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
E-EXK4 - Operating System Group
projects
Linux
Commits
420fe234
Commit
420fe234
authored
17 years ago
by
YOSHIFUJI Hideaki
Committed by
David S. Miller
17 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[IPV6] SIT: Unify code path to get hash array index.
Signed-off-by:
YOSHIFUJI Hideaki
<
yoshfuji@linux-ipv6.org
>
parent
30041e4a
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
net/ipv6/sit.c
+9
-14
9 additions, 14 deletions
net/ipv6/sit.c
with
9 additions
and
14 deletions
net/ipv6/sit.c
+
9
−
14
View file @
420fe234
...
...
@@ -99,10 +99,10 @@ static struct ip_tunnel * ipip6_tunnel_lookup(__be32 remote, __be32 local)
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
local
=
t
->
parms
.
iph
.
saddr
;
__be32
remote
=
parms
->
iph
.
daddr
;
__be32
local
=
parms
->
iph
.
saddr
;
unsigned
h
=
0
;
int
prio
=
0
;
...
...
@@ -117,6 +117,11 @@ static struct ip_tunnel ** ipip6_bucket(struct ip_tunnel *t)
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
)
{
struct
ip_tunnel
**
tp
;
...
...
@@ -147,19 +152,9 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int
__be32
local
=
parms
->
iph
.
saddr
;
struct
ip_tunnel
*
t
,
**
tp
,
*
nt
;
struct
net_device
*
dev
;
unsigned
h
=
0
;
int
prio
=
0
;
char
name
[
IFNAMSIZ
];
if
(
remote
)
{
prio
|=
2
;
h
^=
HASH
(
remote
);
}
if
(
local
)
{
prio
|=
1
;
h
^=
HASH
(
local
);
}
for
(
tp
=
&
tunnels
[
prio
][
h
];
(
t
=
*
tp
)
!=
NULL
;
tp
=
&
t
->
next
)
{
for
(
tp
=
__ipip6_bucket
(
parms
);
(
t
=
*
tp
)
!=
NULL
;
tp
=
&
t
->
next
)
{
if
(
local
==
t
->
parms
.
iph
.
saddr
&&
remote
==
t
->
parms
.
iph
.
daddr
)
return
t
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment