Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
iproute2
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
iproute2
Commits
1e21ea71
Commit
1e21ea71
authored
Dec 10, 2010
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase size of ifindex hash heads
The default of 16 is too small for users with 10,000 interfaces.
parent
1da5f6b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
lib/ll_map.c
lib/ll_map.c
+6
-6
No files found.
lib/ll_map.c
View file @
1e21ea71
...
...
@@ -35,7 +35,8 @@ struct idxmap
char
name
[
16
];
};
static
struct
idxmap
*
idxmap
[
16
];
#define IDXMAP_SIZE 1024
static
struct
idxmap
*
idxmap
[
IDXMAP_SIZE
];
int
ll_remember_index
(
const
struct
sockaddr_nl
*
who
,
struct
nlmsghdr
*
n
,
void
*
arg
)
...
...
@@ -51,15 +52,13 @@ int ll_remember_index(const struct sockaddr_nl *who,
if
(
n
->
nlmsg_len
<
NLMSG_LENGTH
(
sizeof
(
ifi
)))
return
-
1
;
memset
(
tb
,
0
,
sizeof
(
tb
));
parse_rtattr
(
tb
,
IFLA_MAX
,
IFLA_RTA
(
ifi
),
IFLA_PAYLOAD
(
n
));
if
(
tb
[
IFLA_IFNAME
]
==
NULL
)
return
0
;
h
=
ifi
->
ifi_index
&
0xF
;
for
(
imp
=&
idxmap
[
h
];
(
im
=*
imp
)
!=
NULL
;
imp
=
&
im
->
next
)
h
=
ifi
->
ifi_index
&
(
IDXMAP_SIZE
-
1
);
for
(
imp
=
&
idxmap
[
h
];
(
im
=*
imp
)
!=
NULL
;
imp
=
&
im
->
next
)
if
(
im
->
index
==
ifi
->
ifi_index
)
break
;
...
...
@@ -94,7 +93,8 @@ const char *ll_idx_n2a(unsigned idx, char *buf)
if
(
idx
==
0
)
return
"*"
;
for
(
im
=
idxmap
[
idx
&
0xF
];
im
;
im
=
im
->
next
)
for
(
im
=
idxmap
[
idx
&
(
IDXMAP_SIZE
-
1
)];
im
;
im
=
im
->
next
)
if
(
im
->
index
==
idx
)
return
im
->
name
;
snprintf
(
buf
,
16
,
"if%d"
,
idx
);
...
...
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