<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<style>
html {
line-height: 1.2;
font-family: serif;
font-size: 0.9em;
color: black;
background-color: white;
}
body {
margin: 0;
margin-right: auto;
max-width: 36em;
padding: 1em;
hyphens: auto;
overflow-wrap: break-word;
text-rendering: optimizeLegibility;
font-kerning: normal;
}
@media print {
body {
background-color: transparent;
color: black;
font-size: 11pt;
}
p, h2, h3 {
orphans: 3;
widows: 3;
}
h2, h3, h4 {
page-break-after: avoid;
}
}
p {
margin: 1em 0;
}
a {
color: black;
}
a:visited {
color: black;
}
img {
max-width: 100%;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 1.4em;
}
h5, h6 {
font-size: 1em;
font-style: italic;
}
h6 {
font-weight: normal;
}
ol, ul {
padding-left: 1.7em;
margin-top: 1em;
}
li > ol, li > ul {
margin-top: 0;
}
blockquote {
margin: 0.5em;
padding-left: 0.5em;
border-left: 2px solid #e6e6e6;
color: #444;
}
code {
font-family: 'Lucida Console', monospace;
font-size: 95%;
margin: 0;
}
pre {
margin: 1em 0;
overflow: auto;
max-width: unset;
width: fit-content;
}
pre code {
padding: 0;
overflow: visible;
overflow-wrap: normal;
max-width: unset;
white-space: pre-wrap;
}
pre code span {
white-space: pre;
}
.sourceCode {
background-color: transparent;
overflow: visible;
}
code.diff span.kw,
code.diff span.dt {
font-weight: bold;
}
code.diff span.va {
background-color: rgba(192, 255, 192, 64);
color: rgb(0, 64, 0);
}
code.diff span.st {
background-color: rgba(255, 192, 192, 64);
color: rgb(64, 0, 0);
}
pre.diff {
background-color: rgb(240, 240, 240);
padding: 0.4em;
border: 1pt solid grey;
}
hr {
background-color: black;
border: none;
height: 1px;
margin: 1em 0;
}
table {
margin: 1em 0;
border-collapse: collapse;
width: 100%;
overflow-x: auto;
display: block;
font-variant-numeric: lining-nums tabular-nums;
}
table caption {
margin-bottom: 0.75em;
}
tbody {
margin-top: 0.5em;
border-top: 1px solid black;
border-bottom: 1px solid black;
}
th {
border-top: 1px solid black;
padding: 0.25em 0.5em 0.25em 0.5em;
}
td {
padding: 0.125em 0.5em 0.25em 0.5em;
}
header {
margin-bottom: 4em;
text-align: center;
}
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
q { quotes: "„" "”" "»" "«"; }
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
</head>
<body>
<p>Hello Toke,</p>
<p>thanks for this catch, for some weird reason we don’t have an
autotest for this.</p>
<p>Changed your code a bit to add an explicit typecast macro, as the
original reason why this slipped through is that plain void pointer
cast.</p>
<p>Merged, thanks. Have a nice day!</p>
<p>Maria</p>
<p>On Tue, Feb 25, 2025 at 04:05:10PM +0100, Toke Høiland-Jørgensen via
Bird-users wrote:</p>
<blockquote>
<p>Commit 69d1ffde4c72 (“Split route data structure to storage (ro) /
manipulation (rw) structures.”) changed rte->net from a pointer to a
‘struct network’ to a ‘struct net_addr’, but kept the address-of (&)
operator before casting to ’net_addr_ip6_sadr *’ when sending a
source-specific route to the kernel.</p>
<p>Because ‘struct network’ had an embedded struct member (struct
fib_node), the address-of was needed to get back to a pointer to the
data, but with the change in the commit mentioned above, e->net is
now a straight pointer to the address.</p>
<p>The bug meant that the source prefixes passed to the kernel were
essentially garbage, leading to routes in the kernel like:</p>
<p>default from b74:9e05:0:1:d8cf:c000::/86 via fe80::1 dev eth0 proto
bird metric 32 pref medium</p>
<p>Fix this by getting rid of the address-of operator.</p>
<p>Fixes: 69d1ffde4c72 (“Split route data structure to storage (ro) /
manipulation (rw) structures.”) Signed-off-by: Toke Høiland-Jørgensen <a
href="mailto:toke@toke.dk" class="email">toke@toke.dk</a> —
sysdep/linux/netlink.c | 2 +- 1 file changed, 1 insertion(+), 1
deletion(-)</p>
<p>diff –git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c index
1703a67595d5..6cc0142c3e00 100644 — a/sysdep/linux/netlink.c +++
b/sysdep/linux/netlink.c @@ -1494,7 +1494,7 @@ nl_send_route(struct
krt_proto <em>p, const rte </em>e, int op) /* Add source address for
IPv6 SADR routes <em>/ if (e->net->type == NET_IP6_SADR) { -
net_addr_ip6_sadr </em>a = (void <em>) &e->net; +
net_addr_ip6_sadr </em>a = (void *) e->net;
nl_add_attr_ip6(&r->h, rsize, RTA_SRC, a->src_prefix);
r->r.rtm_src_len = a->src_pxlen; } –<br />
2.48.1</p>
</blockquote>
<p>–<br />
Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.</p>
</body>
</html>