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
4fce191d
Commit
4fce191d
authored
Jun 15, 2007
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add argument newmetric to kernel_route.
parent
150a87a6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
6 deletions
+8
-6
kernel.c
kernel.c
+2
-1
kernel.h
kernel.h
+2
-1
route.c
route.c
+2
-2
xroute.c
xroute.c
+2
-2
No files found.
kernel.c
View file @
4fce191d
...
@@ -546,7 +546,8 @@ kernel_interface_wireless(const char *ifname, int ifindex)
...
@@ -546,7 +546,8 @@ kernel_interface_wireless(const char *ifname, int ifindex)
int
int
kernel_route
(
int
operation
,
const
unsigned
char
*
dest
,
unsigned
short
plen
,
kernel_route
(
int
operation
,
const
unsigned
char
*
dest
,
unsigned
short
plen
,
const
unsigned
char
*
gate
,
int
ifindex
,
unsigned
int
metric
)
const
unsigned
char
*
gate
,
int
ifindex
,
unsigned
int
metric
,
unsigned
int
newmetric
)
{
{
union
{
char
raw
[
1024
];
struct
nlmsghdr
nh
;
}
buf
;
union
{
char
raw
[
1024
];
struct
nlmsghdr
nh
;
}
buf
;
...
...
kernel.h
View file @
4fce191d
...
@@ -38,6 +38,7 @@ int kernel_setup_interface(int setup, const char *ifname, int ifindex);
...
@@ -38,6 +38,7 @@ int kernel_setup_interface(int setup, const char *ifname, int ifindex);
int
kernel_interface_mtu
(
const
char
*
ifname
,
int
ifindex
);
int
kernel_interface_mtu
(
const
char
*
ifname
,
int
ifindex
);
int
kernel_interface_wireless
(
const
char
*
ifname
,
int
ifindex
);
int
kernel_interface_wireless
(
const
char
*
ifname
,
int
ifindex
);
int
kernel_route
(
int
operation
,
const
unsigned
char
*
dest
,
unsigned
short
plen
,
int
kernel_route
(
int
operation
,
const
unsigned
char
*
dest
,
unsigned
short
plen
,
const
unsigned
char
*
gate
,
int
ifindex
,
unsigned
int
metric
);
const
unsigned
char
*
gate
,
int
ifindex
,
unsigned
int
metric
,
unsigned
int
newmetric
);
int
kernel_routes
(
int
maxplen
,
struct
kernel_route
*
routes
,
int
maxroutes
);
int
kernel_routes
(
int
maxplen
,
struct
kernel_route
*
routes
,
int
maxroutes
);
int
kernel_callback
(
void
);
int
kernel_callback
(
void
);
route.c
View file @
4fce191d
...
@@ -180,7 +180,7 @@ install_route(struct route *route)
...
@@ -180,7 +180,7 @@ install_route(struct route *route)
rc
=
kernel_route
(
ROUTE_ADD
,
route
->
dest
->
address
,
128
,
rc
=
kernel_route
(
ROUTE_ADD
,
route
->
dest
->
address
,
128
,
route
->
nexthop
->
address
,
route
->
nexthop
->
address
,
route
->
nexthop
->
network
->
ifindex
,
route
->
nexthop
->
network
->
ifindex
,
metric_to_kernel
(
route
->
metric
));
metric_to_kernel
(
route
->
metric
)
,
0
);
if
(
rc
<
0
)
{
if
(
rc
<
0
)
{
perror
(
"kernel_route(ADD)"
);
perror
(
"kernel_route(ADD)"
);
if
(
errno
!=
EEXIST
)
if
(
errno
!=
EEXIST
)
...
@@ -212,7 +212,7 @@ uninstall_route(struct route *route)
...
@@ -212,7 +212,7 @@ uninstall_route(struct route *route)
rc
=
kernel_route
(
ROUTE_FLUSH
,
route
->
dest
->
address
,
128
,
rc
=
kernel_route
(
ROUTE_FLUSH
,
route
->
dest
->
address
,
128
,
route
->
nexthop
->
address
,
route
->
nexthop
->
address
,
route
->
nexthop
->
network
->
ifindex
,
route
->
nexthop
->
network
->
ifindex
,
metric_to_kernel
(
route
->
metric
));
metric_to_kernel
(
route
->
metric
)
,
0
);
if
(
rc
<
0
)
if
(
rc
<
0
)
perror
(
"kernel_route(FLUSH)"
);
perror
(
"kernel_route(FLUSH)"
);
route
->
installed
=
0
;
route
->
installed
=
0
;
...
...
xroute.c
View file @
4fce191d
...
@@ -119,7 +119,7 @@ install_xroute(struct xroute *xroute)
...
@@ -119,7 +119,7 @@ install_xroute(struct xroute *xroute)
rc
=
kernel_route
(
ROUTE_ADD
,
xroute
->
prefix
,
xroute
->
plen
,
rc
=
kernel_route
(
ROUTE_ADD
,
xroute
->
prefix
,
xroute
->
plen
,
gwroute
->
nexthop
->
address
,
gwroute
->
nexthop
->
address
,
gwroute
->
nexthop
->
network
->
ifindex
,
gwroute
->
nexthop
->
network
->
ifindex
,
metric_to_kernel
(
xroute
->
metric
));
metric_to_kernel
(
xroute
->
metric
)
,
0
);
if
(
rc
<
0
)
{
if
(
rc
<
0
)
{
perror
(
"kernel_route(ADD)"
);
perror
(
"kernel_route(ADD)"
);
if
(
errno
!=
EEXIST
)
if
(
errno
!=
EEXIST
)
...
@@ -148,7 +148,7 @@ uninstall_xroute(struct xroute *xroute)
...
@@ -148,7 +148,7 @@ uninstall_xroute(struct xroute *xroute)
rc
=
kernel_route
(
ROUTE_FLUSH
,
xroute
->
prefix
,
xroute
->
plen
,
rc
=
kernel_route
(
ROUTE_FLUSH
,
xroute
->
prefix
,
xroute
->
plen
,
gwroute
->
nexthop
->
address
,
gwroute
->
nexthop
->
address
,
gwroute
->
nexthop
->
network
->
ifindex
,
gwroute
->
nexthop
->
network
->
ifindex
,
metric_to_kernel
(
xroute
->
metric
));
metric_to_kernel
(
xroute
->
metric
)
,
0
);
if
(
rc
<
0
)
if
(
rc
<
0
)
perror
(
"kernel_route(FLUSH)"
);
perror
(
"kernel_route(FLUSH)"
);
xroute
->
installed
=
0
;
xroute
->
installed
=
0
;
...
...
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