openwrt / odhcpd

This repository is a mirror of https://git.openwrt.org/?p=project/odhcpd.git. Pull requests will be accepted which will be merged in odhcpd.git
GNU General Public License v2.0
163 stars 99 forks source link

Don't overflow router lifetime #63

Closed willmo closed 9 years ago

willmo commented 9 years ago

This also avoids advertising an incorrectly short router lifetime when a prefix lifetime is greater than 2 \ 16, due to the truncation to 16 bits.

willmo commented 9 years ago

As the comment implies, if clamping to 9000 is undesirable for some reason, it should at least clamp to UINT16_MAX.

sbyx commented 9 years ago

Thanks will clamp to 64K. Clients must accept any value annyway and we habe some phones who randomly drop some or all RAs in standby :/

willmo commented 9 years ago

Meaning we want to advertise the longest possible lifetime? That makes sense.

I've updated this pull request, if you'd like to use it.

sbyx commented 9 years ago

Ah nice. Thanks again.