Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BIRD Internet Routing Daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
labs
BIRD Internet Routing Daemon
Commits
44aa101c
Commit
44aa101c
authored
Apr 03, 2010
by
Ondřej Zajíček
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes related to routes with link-local gw on BSD.
parent
46a82e9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
10 deletions
+23
-10
sysdep/bsd/krt-sock.c
sysdep/bsd/krt-sock.c
+23
-10
No files found.
sysdep/bsd/krt-sock.c
View file @
44aa101c
...
...
@@ -83,13 +83,10 @@ krt_sock_send(int cmd, rte *e)
struct
ks_msg
msg
;
char
*
body
=
(
char
*
)
msg
.
buf
;
sockaddr
gate
,
mask
,
dst
;
ip_addr
gw
;
DBG
(
"krt-sock: send %I/%d via %I
\n
"
,
net
->
n
.
prefix
,
net
->
n
.
pxlen
,
a
->
gw
);
fill_in_sockaddr
(
&
dst
,
net
->
n
.
prefix
,
0
);
fill_in_sockaddr
(
&
mask
,
ipa_mkmask
(
net
->
n
.
pxlen
),
0
);
fill_in_sockaddr
(
&
gate
,
a
->
gw
,
0
);
bzero
(
&
msg
,
sizeof
(
struct
rt_msghdr
));
msg
.
rtm
.
rtm_version
=
RTM_VERSION
;
msg
.
rtm
.
rtm_type
=
cmd
;
...
...
@@ -133,6 +130,18 @@ krt_sock_send(int cmd, rte *e)
}
}
gw
=
a
->
gw
;
#ifdef IPV6
/* Embed interface ID to link-local address */
if
(
ipa_has_link_scope
(
gw
))
_I0
(
gw
)
=
0xfe800000
|
(
i
->
index
&
0x0000ffff
);
#endif
fill_in_sockaddr
(
&
dst
,
net
->
n
.
prefix
,
0
);
fill_in_sockaddr
(
&
mask
,
ipa_mkmask
(
net
->
n
.
pxlen
),
0
);
fill_in_sockaddr
(
&
gate
,
gw
,
0
);
switch
(
a
->
dest
)
{
case
RTD_ROUTER
:
...
...
@@ -359,6 +368,12 @@ krt_read_rt(struct ks_msg *msg, struct krt_proto *p, int scan)
a
.
dest
=
RTD_ROUTER
;
a
.
gw
=
igate
;
#ifdef IPV6
/* Clean up embedded interface ID returned in link-local address */
if
(
ipa_has_link_scope
(
a
.
gw
))
_I0
(
a
.
gw
)
=
0xfe800000
;
#endif
ng
=
neigh_find2
(
&
p
->
p
,
&
a
.
gw
,
a
.
iface
,
0
);
if
(
!
ng
||
(
ng
->
scope
==
SCOPE_HOST
))
{
...
...
@@ -515,13 +530,11 @@ krt_read_addr(struct ks_msg *msg)
}
ifa
.
scope
=
scope
&
IADDR_SCOPE_MASK
;
/* BSD returns some scope/interface ID as a part of link-local address */
if
(
scope
==
(
IADDR_HOST
|
SCOPE_LINK
))
{
/* Clean up that */
#ifdef IPV6
/* Clean up embedded interface ID returned in link-local address */
if
(
ipa_has_link_scope
(
ifa
.
ip
))
_I0
(
ifa
.
ip
)
=
0xfe800000
;
_I1
(
ifa
.
ip
)
=
0x00000000
;
}
#endif
if
(
iface
->
flags
&
IF_MULTIACCESS
)
ifa
.
prefix
=
ipa_and
(
ifa
.
ip
,
ipa_mkmask
(
masklen
));
...
...
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