Alexander Bluhm <[email protected]> writes:
> On Tue, Feb 09, 2016 at 02:17:18AM +0100, J??r??mie Courr??ges-Anglas wrote:
>>
>> - a few *cnt members of struct rainfo aren't used for anything
>> - the SIOCGIFPREFIX_IN6 ioctl has been deprecated since June 2002
>> - prefix_match() and in6a_site_allrouters are remnants from the
>> Renumbering code (now in the Attic)
>>
>> ok?
>
> OK bluhm@
>
> I think you should also kill the function init_prefix() and move
> the remaining 4 lines into make_prefix() in another diff.
duh, thanks. Here's the diff:
Index: config.c
===================================================================
RCS file: /cvs/src/usr.sbin/rtadvd/config.c,v
retrieving revision 1.52
diff -u -p -r1.52 config.c
--- config.c 26 Feb 2016 12:33:30 -0000 1.52
+++ config.c 27 Feb 2016 23:13:29 -0000
@@ -678,21 +678,6 @@ delete_prefix(struct rainfo *rai, struct
make_packet(rai);
}
-/*
- * Try to get an in6_prefixreq contents for a prefix which matches
- * ipr->ipr_prefix and ipr->ipr_plen and belongs to
- * the interface whose name is ipr->ipr_name[].
- */
-static int
-init_prefix(struct in6_prefixreq *ipr)
-{
- ipr->ipr_vltime = DEF_ADVVALIDLIFETIME;
- ipr->ipr_pltime = DEF_ADVPREFERREDLIFETIME;
- ipr->ipr_raf_onlink = 1;
- ipr->ipr_raf_auto = 1;
- return 0;
-}
-
void
make_prefix(struct rainfo *rai, int ifindex, struct in6_addr *addr, int plen)
{
@@ -708,9 +693,11 @@ make_prefix(struct rainfo *rai, int ifin
ipr.ipr_prefix.sin6_family = AF_INET6;
ipr.ipr_prefix.sin6_addr = *addr;
ipr.ipr_plen = plen;
+ ipr.ipr_vltime = DEF_ADVVALIDLIFETIME;
+ ipr.ipr_pltime = DEF_ADVPREFERREDLIFETIME;
+ ipr.ipr_raf_onlink = 1;
+ ipr.ipr_raf_auto = 1;
- if (init_prefix(&ipr))
- return; /* init failed by some error */
add_prefix(rai, &ipr);
}
--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE