Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
15a2e3ad
Commit
15a2e3ad
authored
Mar 09, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't filter by ifindex in kernel_addresses.
parent
6ad04191
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
10 deletions
+5
-10
kernel.h
kernel.h
+1
-1
kernel_netlink.c
kernel_netlink.c
+4
-9
No files found.
kernel.h
View file @
15a2e3ad
...
@@ -59,4 +59,4 @@ int kernel_route(int operation, const unsigned char *dest, unsigned short plen,
...
@@ -59,4 +59,4 @@ int kernel_route(int operation, const unsigned char *dest, unsigned short plen,
unsigned
int
newmetric
);
unsigned
int
newmetric
);
int
kernel_routes
(
struct
kernel_route
*
routes
,
int
maxroutes
);
int
kernel_routes
(
struct
kernel_route
*
routes
,
int
maxroutes
);
int
kernel_callback
(
int
(
*
fn
)(
int
,
void
*
),
void
*
closure
);
int
kernel_callback
(
int
(
*
fn
)(
int
,
void
*
),
void
*
closure
);
int
kernel_addresses
(
int
ifindex
,
struct
kernel_route
*
routes
,
int
maxroutes
);
int
kernel_addresses
(
struct
kernel_route
*
routes
,
int
maxroutes
);
kernel_netlink.c
View file @
15a2e3ad
...
@@ -1063,7 +1063,6 @@ filter_addresses(struct nlmsghdr *nh, void *data)
...
@@ -1063,7 +1063,6 @@ filter_addresses(struct nlmsghdr *nh, void *data)
int
*
found
=
NULL
;
int
*
found
=
NULL
;
int
len
;
int
len
;
struct
ifaddrmsg
*
ifa
;
struct
ifaddrmsg
*
ifa
;
int
index
=
0
;
char
ifname
[
IFNAMSIZ
];
char
ifname
[
IFNAMSIZ
];
if
(
data
)
{
if
(
data
)
{
...
@@ -1071,7 +1070,6 @@ filter_addresses(struct nlmsghdr *nh, void *data)
...
@@ -1071,7 +1070,6 @@ filter_addresses(struct nlmsghdr *nh, void *data)
maxroutes
=
*
(
int
*
)
args
[
0
];
maxroutes
=
*
(
int
*
)
args
[
0
];
routes
=
(
struct
kernel_route
*
)
args
[
1
];
routes
=
(
struct
kernel_route
*
)
args
[
1
];
found
=
(
int
*
)
args
[
2
];
found
=
(
int
*
)
args
[
2
];
index
=
*
(
int
*
)
args
[
3
];
}
}
len
=
nh
->
nlmsg_len
;
len
=
nh
->
nlmsg_len
;
...
@@ -1086,9 +1084,6 @@ filter_addresses(struct nlmsghdr *nh, void *data)
...
@@ -1086,9 +1084,6 @@ filter_addresses(struct nlmsghdr *nh, void *data)
ifa
=
(
struct
ifaddrmsg
*
)
NLMSG_DATA
(
nh
);
ifa
=
(
struct
ifaddrmsg
*
)
NLMSG_DATA
(
nh
);
len
-=
NLMSG_LENGTH
(
0
);
len
-=
NLMSG_LENGTH
(
0
);
if
(
index
&&
ifa
->
ifa_index
!=
index
)
return
0
;
rc
=
parse_addr_rta
(
ifa
,
len
,
&
addr
);
rc
=
parse_addr_rta
(
ifa
,
len
,
&
addr
);
if
(
rc
<
0
)
if
(
rc
<
0
)
return
0
;
return
0
;
...
@@ -1097,7 +1092,7 @@ filter_addresses(struct nlmsghdr *nh, void *data)
...
@@ -1097,7 +1092,7 @@ filter_addresses(struct nlmsghdr *nh, void *data)
return
0
;
return
0
;
kdebugf
(
"found address on interface %s(%d): %s
\n
"
,
kdebugf
(
"found address on interface %s(%d): %s
\n
"
,
if_indextoname
(
i
ndex
,
ifname
),
index
,
if_indextoname
(
i
fa
->
ifa_index
,
ifname
),
ifa
->
ifa_
index
,
format_address
(
addr
.
s6_addr
));
format_address
(
addr
.
s6_addr
));
if
(
data
)
{
if
(
data
)
{
...
@@ -1105,7 +1100,7 @@ filter_addresses(struct nlmsghdr *nh, void *data)
...
@@ -1105,7 +1100,7 @@ filter_addresses(struct nlmsghdr *nh, void *data)
memcpy
(
route
->
prefix
,
addr
.
s6_addr
,
16
);
memcpy
(
route
->
prefix
,
addr
.
s6_addr
,
16
);
route
->
plen
=
128
;
route
->
plen
=
128
;
route
->
metric
=
0
;
route
->
metric
=
0
;
route
->
ifindex
=
index
;
route
->
ifindex
=
i
fa
->
ifa_i
ndex
;
route
->
proto
=
RTPROTO_BABEL_LOCAL
;
route
->
proto
=
RTPROTO_BABEL_LOCAL
;
memset
(
route
->
gw
,
0
,
16
);
memset
(
route
->
gw
,
0
,
16
);
*
found
=
(
*
found
)
+
1
;
*
found
=
(
*
found
)
+
1
;
...
@@ -1148,11 +1143,11 @@ filter_netlink(struct nlmsghdr *nh, void *data)
...
@@ -1148,11 +1143,11 @@ filter_netlink(struct nlmsghdr *nh, void *data)
}
}
int
int
kernel_addresses
(
int
ifindex
,
struct
kernel_route
*
routes
,
int
maxroutes
)
kernel_addresses
(
struct
kernel_route
*
routes
,
int
maxroutes
)
{
{
int
maxr
=
maxroutes
;
int
maxr
=
maxroutes
;
int
found
=
0
;
int
found
=
0
;
void
*
data
[]
=
{
&
maxr
,
routes
,
&
found
,
(
void
*
)
&
ifindex
};
void
*
data
[]
=
{
&
maxr
,
routes
,
&
found
,
NULL
};
struct
rtgenmsg
g
;
struct
rtgenmsg
g
;
int
rc
;
int
rc
;
...
...
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