Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
xcap
xcap-capability-linux
Commits
87d1a164
Commit
87d1a164
authored
Apr 24, 2007
by
YOSHIFUJI Hideaki
Committed by
David S. Miller
Apr 25, 2007
Browse files
[IPV4] IPIP: Unify code path to get hash array index.
Signed-off-by:
YOSHIFUJI Hideaki
<
yoshfuji@linux-ipv6.org
>
parent
420fe234
Changes
1
Show whitespace changes
Inline
Side-by-side
net/ipv4/ipip.c
View file @
87d1a164
...
...
@@ -157,10 +157,10 @@ static struct ip_tunnel * ipip_tunnel_lookup(__be32 remote, __be32 local)
return
NULL
;
}
static
struct
ip_tunnel
**
ipip_bucket
(
struct
ip_tunnel
*
t
)
static
struct
ip_tunnel
**
__
ipip_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
;
...
...
@@ -175,6 +175,10 @@ static struct ip_tunnel **ipip_bucket(struct ip_tunnel *t)
return
&
tunnels
[
prio
][
h
];
}
static
inline
struct
ip_tunnel
**
ipip_bucket
(
struct
ip_tunnel
*
t
)
{
return
__ipip_bucket
(
&
t
->
parms
);
}
static
void
ipip_tunnel_unlink
(
struct
ip_tunnel
*
t
)
{
...
...
@@ -206,19 +210,9 @@ static struct ip_tunnel * ipip_tunnel_locate(struct ip_tunnel_parm *parms, int c
__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
=
__ipip_bucket
(
parms
);
(
t
=
*
tp
)
!=
NULL
;
tp
=
&
t
->
next
)
{
if
(
local
==
t
->
parms
.
iph
.
saddr
&&
remote
==
t
->
parms
.
iph
.
daddr
)
return
t
;
}
...
...
Write
Preview
Supports
Markdown
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