Page MenuHomeFreeBSD

Fix "ntpd bind() failure: Can't assign requested address" for disabled IPv6 addresses.
ClosedPublic

Authored by hiren on Jan 14 2015, 5:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 8:36 PM
Unknown Object (File)
Nov 19 2024, 10:28 AM
Unknown Object (File)
Nov 15 2024, 5:50 AM
Unknown Object (File)
Nov 13 2024, 9:36 AM
Unknown Object (File)
Nov 13 2024, 7:41 AM
Unknown Object (File)
Nov 11 2024, 5:25 PM
Unknown Object (File)
Oct 27 2024, 11:41 PM
Unknown Object (File)
Oct 25 2024, 12:29 PM
Subscribers

Details

Summary

ntpd tries to bind to IPv6 interfaces in 'tentative' state and fails as IPv6 is actually disabled.
Proposed patch makes ntpd ignore tentative addresses.

Submitted by: ume@freebsd.org <Hajimu UMEMOTO>

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

hiren retitled this revision from to Fix "ntpd bind() failure: Can't assign requested address" for disabled IPv6 addresses..
hiren updated this object.
hiren edited the test plan for this revision. (Show Details)
hiren added reviewers: bz, gnn.
bz edited edge metadata.

Fix the whitespace issues; functionally it seems fine.

contrib/ntp/ntpd/ntp_io.c
1185

Normally I would not initialise exclude to 0 before the first #if defined but the general code in this file seems to do otherwise so that's fine.

1207

The above looks like a copy and paste error with regards to indentation; the #* should start the the beginning of the line and the other lines should be properly indented.

This revision is now accepted and ready to land.Jan 14 2015, 10:00 PM

Shouldn't line 1203 be a #else or am I missing some context?

In D1527#7, @gnn wrote:

Shouldn't line 1203 be a #else or am I missing some context?

nope; if you have one flag add it to the exclude list. if you have another flag add it to the exclude list. No #else please; this needs to be additive; we want to fail on either of the two (well really three as IN6_IFF_NOTREADY is tentative and duplicated) flags.

OK then that last #endif closes the #if at the top? If so we need /* comments */ after the #endifs

bz requested changes to this revision.Jan 14 2015, 10:23 PM
bz edited edge metadata.

still only whitespace but maybe re-roll the diff quickly and we'll be happy to both accept

contrib/ntp/ntpd/ntp_io.c
1203

translating from gnn:
#endif /* !IN6_IFF_ANYCAST */

1206

#endif /* ! IN6_IFF_NOTREADY */

This revision now requires changes to proceed.Jan 14 2015, 10:23 PM
hiren edited edge metadata.

Adding comments for #endif and fixing a whitespace issue.

bz requested changes to this revision.Jan 14 2015, 10:47 PM
bz edited edge metadata.

indentation still wrong

contrib/ntp/ntpd/ntp_io.c
1201–1207

indentation of the entire block is still wrong

1206

and you helpfully copied and pasted the blank I seem to have left after the !; remove that as well please

This revision now requires changes to proceed.Jan 14 2015, 10:47 PM
hiren edited edge metadata.

Actaully indent the #if/#endifs correctly (hopefully) and remove a space that bz@ put to catch my blind copy/paste skills. ;-)

bz edited edge metadata.

And whoever is maintaining ntpd make sure it goes upstream as well.

This revision is now accepted and ready to land.Jan 14 2015, 11:02 PM
gnn edited edge metadata.
hiren updated this revision to Diff 3184.

Closed by commit rS277202 (authored by @hiren).