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)
Fri, Mar 29, 2:22 PM
Unknown Object (File)
Thu, Mar 28, 8:19 AM
Unknown Object (File)
Mar 10 2024, 2:05 PM
Unknown Object (File)
Mar 10 2024, 2:05 PM
Unknown Object (File)
Mar 10 2024, 2:05 PM
Unknown Object (File)
Mar 10 2024, 2:04 PM
Unknown Object (File)
Mar 10 2024, 2:04 PM
Unknown Object (File)
Mar 7 2024, 8:12 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
Lint Skipped
Unit
Tests Skipped

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 ↗(On Diff #3170)

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 ↗(On Diff #3170)

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 ↗(On Diff #3170)

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

1206 ↗(On Diff #3170)

#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 ↗(On Diff #3182)

indentation of the entire block is still wrong

1206 ↗(On Diff #3182)

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).