On Sun, Feb 28, 2016 at 12:16:12AM +0100, Jeremie Courreges-Anglas wrote: > Alexander Bluhm <alexander.bl...@gmx.net> writes: > > 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:
OK bluhm@ > > 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