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
2391e74a
Commit
2391e74a
authored
Aug 25, 2007
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a parameter ``urgent'' to send_update.
parent
1410e881
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
14 deletions
+14
-14
babel.c
babel.c
+2
-2
message.c
message.c
+7
-8
message.h
message.h
+1
-1
route.c
route.c
+4
-3
No files found.
babel.c
View file @
2391e74a
...
@@ -502,7 +502,7 @@ main(int argc, char **argv)
...
@@ -502,7 +502,7 @@ main(int argc, char **argv)
send_ihu
(
NULL
,
&
nets
[
i
]);
send_ihu
(
NULL
,
&
nets
[
i
]);
if
(
!
network_idle
(
&
nets
[
i
]))
{
if
(
!
network_idle
(
&
nets
[
i
]))
{
if
(
now
.
tv_sec
>=
nets
[
i
].
update_time
+
update_interval
)
if
(
now
.
tv_sec
>=
nets
[
i
].
update_time
+
update_interval
)
send_update
(
&
nets
[
i
],
NULL
,
0
);
send_update
(
&
nets
[
i
],
0
,
NULL
,
0
);
if
(
now
.
tv_sec
>=
if
(
now
.
tv_sec
>=
nets
[
i
].
self_update_time
+
nets
[
i
].
self_update_interval
)
{
nets
[
i
].
self_update_time
+
nets
[
i
].
self_update_interval
)
{
send_self_update
(
&
nets
[
i
],
0
);
send_self_update
(
&
nets
[
i
],
0
);
...
@@ -533,7 +533,7 @@ main(int argc, char **argv)
...
@@ -533,7 +533,7 @@ main(int argc, char **argv)
/* Uninstall and retract all routes. */
/* Uninstall and retract all routes. */
if
(
routes
[
i
].
installed
)
{
if
(
routes
[
i
].
installed
)
{
uninstall_route
(
&
routes
[
i
]);
uninstall_route
(
&
routes
[
i
]);
send_update
(
NULL
,
routes
[
i
].
src
->
prefix
,
routes
[
i
].
src
->
plen
);
send_update
(
NULL
,
1
,
routes
[
i
].
src
->
prefix
,
routes
[
i
].
src
->
plen
);
}
}
}
}
for
(
i
=
0
;
i
<
numnets
;
i
++
)
{
for
(
i
=
0
;
i
<
numnets
;
i
++
)
{
...
...
message.c
View file @
2391e74a
...
@@ -150,9 +150,9 @@ parse_packet(const unsigned char *from, struct network *net,
...
@@ -150,9 +150,9 @@ parse_packet(const unsigned char *from, struct network *net,
/* If a neighbour is requesting a full route dump from us,
/* If a neighbour is requesting a full route dump from us,
we might as well send it an ihu. */
we might as well send it an ihu. */
send_ihu
(
neigh
,
NULL
);
send_ihu
(
neigh
,
NULL
);
send_update
(
neigh
->
network
,
NULL
,
0
);
send_update
(
neigh
->
network
,
0
,
NULL
,
0
);
}
else
{
}
else
{
send_update
(
neigh
->
network
,
address
,
plen
);
send_update
(
neigh
->
network
,
1
,
address
,
plen
);
}
}
}
else
if
(
type
==
3
)
{
}
else
if
(
type
==
3
)
{
if
(
plen
==
0xFF
)
if
(
plen
==
0xFF
)
...
@@ -556,14 +556,14 @@ buffer_update(struct network *net,
...
@@ -556,14 +556,14 @@ buffer_update(struct network *net,
}
}
void
void
send_update
(
struct
network
*
net
,
send_update
(
struct
network
*
net
,
int
urgent
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
)
const
unsigned
char
*
prefix
,
unsigned
char
plen
)
{
{
int
i
;
int
i
;
if
(
net
==
NULL
)
{
if
(
net
==
NULL
)
{
for
(
i
=
0
;
i
<
numnets
;
i
++
)
for
(
i
=
0
;
i
<
numnets
;
i
++
)
send_update
(
&
nets
[
i
],
prefix
,
plen
);
send_update
(
&
nets
[
i
],
urgent
,
prefix
,
plen
);
return
;
return
;
}
}
...
@@ -582,7 +582,7 @@ send_update(struct network *net,
...
@@ -582,7 +582,7 @@ send_update(struct network *net,
if
(
prefix
)
{
if
(
prefix
)
{
if
(
updates
>
net
->
bufsize
/
24
-
2
)
{
if
(
updates
>
net
->
bufsize
/
24
-
2
)
{
/* Update won't fit in a single packet -- send a full dump. */
/* Update won't fit in a single packet -- send a full dump. */
send_update
(
net
,
NULL
,
0
);
send_update
(
net
,
urgent
,
NULL
,
0
);
return
;
return
;
}
}
debugf
(
"Sending update to %s for %s.
\n
"
,
debugf
(
"Sending update to %s for %s.
\n
"
,
...
@@ -622,9 +622,8 @@ send_self_update(struct network *net, int force_seqno)
...
@@ -622,9 +622,8 @@ send_self_update(struct network *net, int force_seqno)
for
(
i
=
0
;
i
<
numxroutes
;
i
++
)
{
for
(
i
=
0
;
i
<
numxroutes
;
i
++
)
{
if
(
xroutes
[
i
].
exported
)
if
(
xroutes
[
i
].
exported
)
send_update
(
net
,
xroutes
[
i
].
prefix
,
xroutes
[
i
].
plen
);
send_update
(
net
,
0
,
xroutes
[
i
].
prefix
,
xroutes
[
i
].
plen
);
}
}
schedule_update_flush
(
net
);
}
}
void
void
...
@@ -659,7 +658,7 @@ send_neighbour_update(struct neighbour *neigh, struct network *net)
...
@@ -659,7 +658,7 @@ send_neighbour_update(struct neighbour *neigh, struct network *net)
int
i
;
int
i
;
for
(
i
=
0
;
i
<
numroutes
;
i
++
)
{
for
(
i
=
0
;
i
<
numroutes
;
i
++
)
{
if
(
routes
[
i
].
installed
&&
routes
[
i
].
nexthop
==
neigh
)
if
(
routes
[
i
].
installed
&&
routes
[
i
].
nexthop
==
neigh
)
send_update
(
net
,
routes
[
i
].
src
->
prefix
,
routes
[
i
].
src
->
plen
);
send_update
(
net
,
0
,
routes
[
i
].
src
->
prefix
,
routes
[
i
].
src
->
plen
);
}
}
}
}
...
...
message.h
View file @
2391e74a
...
@@ -44,7 +44,7 @@ void send_request(struct network *net,
...
@@ -44,7 +44,7 @@ void send_request(struct network *net,
const
unsigned
char
*
prefix
,
unsigned
char
plen
);
const
unsigned
char
*
prefix
,
unsigned
char
plen
);
void
send_unicast_request
(
struct
neighbour
*
neigh
,
void
send_unicast_request
(
struct
neighbour
*
neigh
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
);
const
unsigned
char
*
prefix
,
unsigned
char
plen
);
void
send_update
(
struct
network
*
net
,
void
send_update
(
struct
network
*
net
,
int
urgent
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
);
const
unsigned
char
*
prefix
,
unsigned
char
plen
);
void
send_self_update
(
struct
network
*
net
,
int
force_seqno
);
void
send_self_update
(
struct
network
*
net
,
int
force_seqno
);
void
send_self_retract
(
struct
network
*
net
);
void
send_self_retract
(
struct
network
*
net
);
...
...
route.c
View file @
2391e74a
...
@@ -435,7 +435,7 @@ consider_route(struct route *route)
...
@@ -435,7 +435,7 @@ consider_route(struct route *route)
if
(
installed
&&
route
->
installed
)
if
(
installed
&&
route
->
installed
)
send_triggered_update
(
route
,
installed
->
src
,
installed
->
metric
);
send_triggered_update
(
route
,
installed
->
src
,
installed
->
metric
);
else
else
send_update
(
NULL
,
route
->
src
->
prefix
,
route
->
src
->
plen
);
send_update
(
NULL
,
0
,
route
->
src
->
prefix
,
route
->
src
->
plen
);
return
;
return
;
}
}
...
@@ -450,7 +450,8 @@ send_triggered_update(struct route *route, struct source *oldsrc, int oldmetric)
...
@@ -450,7 +450,8 @@ send_triggered_update(struct route *route, struct source *oldsrc, int oldmetric)
if
(
route
->
src
!=
oldsrc
||
if
(
route
->
src
!=
oldsrc
||
((
route
->
metric
>=
INFINITY
)
!=
(
oldmetric
>=
INFINITY
))
||
((
route
->
metric
>=
INFINITY
)
!=
(
oldmetric
>=
INFINITY
))
||
(
route
->
metric
>=
oldmetric
+
256
||
oldmetric
>=
route
->
metric
+
256
))
(
route
->
metric
>=
oldmetric
+
256
||
oldmetric
>=
route
->
metric
+
256
))
send_update
(
NULL
,
route
->
src
->
prefix
,
route
->
src
->
plen
);
send_update
(
NULL
,
((
route
->
metric
>=
INFINITY
)
||
route
->
src
!=
oldsrc
),
route
->
src
->
prefix
,
route
->
src
->
plen
);
if
(
oldmetric
<
INFINITY
)
{
if
(
oldmetric
<
INFINITY
)
{
if
(
route
->
metric
>=
INFINITY
||
route
->
metric
-
oldmetric
>=
384
)
if
(
route
->
metric
>=
INFINITY
||
route
->
metric
-
oldmetric
>=
384
)
...
@@ -495,7 +496,7 @@ route_lost(struct source *src, int oldmetric)
...
@@ -495,7 +496,7 @@ route_lost(struct source *src, int oldmetric)
consider_route
(
new_route
);
consider_route
(
new_route
);
}
else
{
}
else
{
/* Complain loudly. */
/* Complain loudly. */
send_update
(
NULL
,
src
->
prefix
,
src
->
plen
);
send_update
(
NULL
,
1
,
src
->
prefix
,
src
->
plen
);
if
(
oldmetric
<
INFINITY
)
if
(
oldmetric
<
INFINITY
)
send_request
(
NULL
,
src
->
prefix
,
src
->
plen
);
send_request
(
NULL
,
src
->
prefix
,
src
->
plen
);
}
}
...
...
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