ip/ipconfig: fix logic bug (thanks cgnarne)

We must not skip conf.preflt == 0 (only conf.validlt == 0)
so that we can change the kernels preflt timeout.
This commit is contained in:
cinap_lenrek 2024-07-23 21:35:51 +00:00
parent 2076c934d0
commit cbbce6b301

View file

@ -662,8 +662,7 @@ recvrahost(uchar buf[], int pktlen)
for(rr = &routelist; (r = *rr) != nil;){
if(m > 100
|| r->prefixlt != ~0UL && r->prefixlt < now-r->time
|| r->routerlt != ~0UL && r->routerlt < now-r->time
|| ipcmp(r->src, ra->src) == 0 && r->routerlt != 0 && conf.routerlt == 0){
|| r->routerlt != ~0UL && r->routerlt < now-r->time){
DEBUG("purging RA from %I on %s; pfx %I %M",
r->src, conf.dev, r->laddr, r->mask);
if(!noconfig && validip(r->gaddr))
@ -758,7 +757,7 @@ recvrahost(uchar buf[], int pktlen)
}
} else {
seen = 0;
if(conf.preflt == 0)
if(conf.validlt == 0)
continue;
r = malloc(sizeof(*r));
}