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
bdc27e89
Commit
bdc27e89
authored
Jun 15, 2007
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement kernel_route(MODIFY).
parent
4fce191d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
kernel.c
kernel.c
+13
-1
kernel.h
kernel.h
+1
-0
No files found.
kernel.c
View file @
bdc27e89
...
@@ -554,9 +554,21 @@ kernel_route(int operation, const unsigned char *dest, unsigned short plen,
...
@@ -554,9 +554,21 @@ kernel_route(int operation, const unsigned char *dest, unsigned short plen,
struct
rtmsg
*
rtm
;
struct
rtmsg
*
rtm
;
struct
rtattr
*
rta
;
struct
rtattr
*
rta
;
int
len
=
sizeof
(
buf
.
raw
);
int
len
=
sizeof
(
buf
.
raw
);
int
rc
;
if
(
operation
==
ROUTE_MODIFY
)
{
if
(
newmetric
==
metric
)
return
0
;
rc
=
kernel_route
(
ROUTE_ADD
,
dest
,
plen
,
gate
,
ifindex
,
newmetric
,
0
);
if
(
rc
<
0
)
return
rc
;
rc
=
kernel_route
(
ROUTE_FLUSH
,
dest
,
plen
,
gate
,
ifindex
,
metric
,
0
);
return
rc
;
}
debugf
(
"kernel_route: %s %s/%d metric %d via %d nexthop %s
\n
"
,
debugf
(
"kernel_route: %s %s/%d metric %d via %d nexthop %s
\n
"
,
operation
==
ROUTE_ADD
?
"add"
:
"flush"
,
operation
==
ROUTE_ADD
?
"add"
:
operation
==
ROUTE_FLUSH
?
"flush"
:
"???"
,
format_address
(
dest
),
plen
,
metric
,
ifindex
,
format_address
(
dest
),
plen
,
metric
,
ifindex
,
format_address
(
gate
));
format_address
(
gate
));
...
...
kernel.h
View file @
bdc27e89
...
@@ -32,6 +32,7 @@ struct kernel_route {
...
@@ -32,6 +32,7 @@ struct kernel_route {
#define ROUTE_FLUSH 0
#define ROUTE_FLUSH 0
#define ROUTE_ADD 1
#define ROUTE_ADD 1
#define ROUTE_MODIFY 2
int
kernel_setup
(
int
setup
);
int
kernel_setup
(
int
setup
);
int
kernel_setup_interface
(
int
setup
,
const
char
*
ifname
,
int
ifindex
);
int
kernel_setup_interface
(
int
setup
,
const
char
*
ifname
,
int
ifindex
);
...
...
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