Page MenuHomeFreeBSD

ping6: Fix dnsdecode() bug introduced by r350859
ClosedPublic

Authored by jansucan on Aug 15 2019, 7:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 12:08 PM
Unknown Object (File)
Mon, Nov 11, 2:32 PM
Unknown Object (File)
Sun, Oct 27, 6:10 AM
Unknown Object (File)
Oct 8 2024, 4:32 AM
Unknown Object (File)
Sep 25 2024, 3:47 PM
Unknown Object (File)
Sep 24 2024, 9:13 AM
Unknown Object (File)
Sep 23 2024, 4:49 PM
Unknown Object (File)
Sep 21 2024, 3:24 AM
Subscribers

Details

Summary

Fix dnsdecode() bug introduced by r350859

r350859 removed level of indirection that was needed for setting the
caller's `cp' pointer. dnsdecode() uses return value to indicate error
or success. It returns pointer to a buffer holding a decompressed DNS
name or NULL. The caller uses that value only to find out the result,
not for accessing the buffer.

We use the return value to propagate the new value of `cp' pointer to
the caller instead of using an output argument.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sbin/ping6/ping6.c
1431 ↗(On Diff #60819)

Since you're here, could you document dnsdecode's arguments and return value?

Document dnsdecode's arguments and return value.

sbin/ping6/ping6.c
1431 ↗(On Diff #60819)

Fixed. However, I'm a bit unsure about the RFC because the function doesn't seem to follow it completely.

This revision is now accepted and ready to land.Aug 17 2019, 2:21 PM
This revision was automatically updated to reflect the committed changes.