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
3e26112a
Commit
3e26112a
authored
Mar 27, 2013
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ll_map: remove unused address fields
The address was being stored but not used by current code.
parent
1b95cb8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
35 deletions
+0
-35
include/ll_map.h
include/ll_map.h
+0
-2
lib/ll_map.c
lib/ll_map.c
+0
-33
No files found.
include/ll_map.h
View file @
3e26112a
...
...
@@ -9,7 +9,5 @@ extern const char *ll_index_to_name(unsigned idx);
extern
const
char
*
ll_idx_n2a
(
unsigned
idx
,
char
*
buf
);
extern
int
ll_index_to_type
(
unsigned
idx
);
extern
unsigned
ll_index_to_flags
(
unsigned
idx
);
extern
unsigned
ll_index_to_addr
(
unsigned
idx
,
unsigned
char
*
addr
,
unsigned
alen
);
#endif
/* __LL_MAP_H__ */
lib/ll_map.c
View file @
3e26112a
...
...
@@ -31,9 +31,7 @@ struct ll_cache
unsigned
flags
;
int
index
;
unsigned
short
type
;
unsigned
short
alen
;
char
name
[
IFNAMSIZ
];
unsigned
char
addr
[
20
];
};
#define IDXMAP_SIZE 1024
...
...
@@ -79,16 +77,6 @@ int ll_remember_index(const struct sockaddr_nl *who,
im
->
type
=
ifi
->
ifi_type
;
im
->
flags
=
ifi
->
ifi_flags
;
if
(
tb
[
IFLA_ADDRESS
])
{
int
alen
;
im
->
alen
=
alen
=
RTA_PAYLOAD
(
tb
[
IFLA_ADDRESS
]);
if
(
alen
>
sizeof
(
im
->
addr
))
alen
=
sizeof
(
im
->
addr
);
memcpy
(
im
->
addr
,
RTA_DATA
(
tb
[
IFLA_ADDRESS
]),
alen
);
}
else
{
im
->
alen
=
0
;
memset
(
im
->
addr
,
0
,
sizeof
(
im
->
addr
));
}
strcpy
(
im
->
name
,
RTA_DATA
(
tb
[
IFLA_IFNAME
]));
return
0
;
}
...
...
@@ -141,27 +129,6 @@ unsigned ll_index_to_flags(unsigned idx)
return
0
;
}
unsigned
ll_index_to_addr
(
unsigned
idx
,
unsigned
char
*
addr
,
unsigned
alen
)
{
const
struct
ll_cache
*
im
;
if
(
idx
==
0
)
return
0
;
for
(
im
=
idxhead
(
idx
);
im
;
im
=
im
->
idx_next
)
{
if
(
im
->
index
==
idx
)
{
if
(
alen
>
sizeof
(
im
->
addr
))
alen
=
sizeof
(
im
->
addr
);
if
(
alen
>
im
->
alen
)
alen
=
im
->
alen
;
memcpy
(
addr
,
im
->
addr
,
alen
);
return
alen
;
}
}
return
0
;
}
unsigned
ll_name_to_index
(
const
char
*
name
)
{
static
char
ncache
[
IFNAMSIZ
];
...
...
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