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
5056a1ef
Commit
5056a1ef
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
[IPV4] IP_GRE: Unify code path to get hash array index.
Signed-off-by:
YOSHIFUJI Hideaki
<
yoshfuji@linux-ipv6.org
>
parent
87d1a164
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
net/ipv4/ip_gre.c
net/ipv4/ip_gre.c
+10
-13
No files found.
net/ipv4/ip_gre.c
View file @
5056a1ef
...
@@ -191,11 +191,11 @@ static struct ip_tunnel * ipgre_tunnel_lookup(__be32 remote, __be32 local, __be3
...
@@ -191,11 +191,11 @@ static struct ip_tunnel * ipgre_tunnel_lookup(__be32 remote, __be32 local, __be3
return
NULL
;
return
NULL
;
}
}
static
struct
ip_tunnel
**
ipgre_bucket
(
struct
ip_tunnel
*
t
)
static
struct
ip_tunnel
**
__ipgre_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
;
__be32
key
=
t
->
parms
.
i_key
;
__be32
key
=
parms
->
i_key
;
unsigned
h
=
HASH
(
key
);
unsigned
h
=
HASH
(
key
);
int
prio
=
0
;
int
prio
=
0
;
...
@@ -209,6 +209,11 @@ static struct ip_tunnel **ipgre_bucket(struct ip_tunnel *t)
...
@@ -209,6 +209,11 @@ static struct ip_tunnel **ipgre_bucket(struct ip_tunnel *t)
return
&
tunnels
[
prio
][
h
];
return
&
tunnels
[
prio
][
h
];
}
}
static
inline
struct
ip_tunnel
**
ipgre_bucket
(
struct
ip_tunnel
*
t
)
{
return
__ipgre_bucket
(
&
t
->
parms
);
}
static
void
ipgre_tunnel_link
(
struct
ip_tunnel
*
t
)
static
void
ipgre_tunnel_link
(
struct
ip_tunnel
*
t
)
{
{
struct
ip_tunnel
**
tp
=
ipgre_bucket
(
t
);
struct
ip_tunnel
**
tp
=
ipgre_bucket
(
t
);
...
@@ -240,17 +245,9 @@ static struct ip_tunnel * ipgre_tunnel_locate(struct ip_tunnel_parm *parms, int
...
@@ -240,17 +245,9 @@ static struct ip_tunnel * ipgre_tunnel_locate(struct ip_tunnel_parm *parms, int
__be32
key
=
parms
->
i_key
;
__be32
key
=
parms
->
i_key
;
struct
ip_tunnel
*
t
,
**
tp
,
*
nt
;
struct
ip_tunnel
*
t
,
**
tp
,
*
nt
;
struct
net_device
*
dev
;
struct
net_device
*
dev
;
unsigned
h
=
HASH
(
key
);
int
prio
=
0
;
char
name
[
IFNAMSIZ
];
char
name
[
IFNAMSIZ
];
if
(
local
)
for
(
tp
=
__ipgre_bucket
(
parms
);
(
t
=
*
tp
)
!=
NULL
;
tp
=
&
t
->
next
)
{
prio
|=
1
;
if
(
remote
&&
!
MULTICAST
(
remote
))
{
prio
|=
2
;
h
^=
HASH
(
remote
);
}
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
)
{
if
(
key
==
t
->
parms
.
i_key
)
if
(
key
==
t
->
parms
.
i_key
)
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