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
88ebc72f
Commit
88ebc72f
authored
Jan 12, 2008
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV4] FIB: Include nexthop device indexes in fib_info hashfn.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
3f4afb64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
net/ipv4/fib_semantics.c
net/ipv4/fib_semantics.c
+12
-9
No files found.
net/ipv4/fib_semantics.c
View file @
88ebc72f
...
...
@@ -194,6 +194,15 @@ static __inline__ int nh_comp(const struct fib_info *fi, const struct fib_info *
return
0
;
}
static
inline
unsigned
int
fib_devindex_hashfn
(
unsigned
int
val
)
{
unsigned
int
mask
=
DEVINDEX_HASHSIZE
-
1
;
return
(
val
^
(
val
>>
DEVINDEX_HASHBITS
)
^
(
val
>>
(
DEVINDEX_HASHBITS
*
2
)))
&
mask
;
}
static
inline
unsigned
int
fib_info_hashfn
(
const
struct
fib_info
*
fi
)
{
unsigned
int
mask
=
(
fib_hash_size
-
1
);
...
...
@@ -202,6 +211,9 @@ static inline unsigned int fib_info_hashfn(const struct fib_info *fi)
val
^=
fi
->
fib_protocol
;
val
^=
(
__force
u32
)
fi
->
fib_prefsrc
;
val
^=
fi
->
fib_priority
;
for_nexthops
(
fi
)
{
val
^=
fib_devindex_hashfn
(
nh
->
nh_oif
);
}
endfor_nexthops
(
fi
)
return
(
val
^
(
val
>>
7
)
^
(
val
>>
12
))
&
mask
;
}
...
...
@@ -232,15 +244,6 @@ static struct fib_info *fib_find_info(const struct fib_info *nfi)
return
NULL
;
}
static
inline
unsigned
int
fib_devindex_hashfn
(
unsigned
int
val
)
{
unsigned
int
mask
=
DEVINDEX_HASHSIZE
-
1
;
return
(
val
^
(
val
>>
DEVINDEX_HASHBITS
)
^
(
val
>>
(
DEVINDEX_HASHBITS
*
2
)))
&
mask
;
}
/* Check, that the gateway is already configured.
Used only by redirect accept routine.
*/
...
...
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