Page MenuHomeFreeBSD

ndp: Prepare for pending tcpdump update
ClosedPublic

Authored by jrm on Jun 7 2023, 2:27 AM.
Tags
None
Referenced Files
F102715890: D40445.diff
Sat, Nov 16, 6:46 AM
Unknown Object (File)
Sep 26 2024, 11:39 AM
Unknown Object (File)
Sep 25 2024, 11:35 PM
Unknown Object (File)
Sep 23 2024, 8:50 AM
Unknown Object (File)
Sep 20 2024, 1:30 AM
Unknown Object (File)
Sep 19 2024, 5:59 AM
Unknown Object (File)
Sep 18 2024, 7:26 PM
Unknown Object (File)
Sep 18 2024, 11:43 AM
Subscribers

Details

Summary

npd makes use of gmt2local, however that library has been removed from
tcpdump. Add utc_offset() as a substitute.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 51960
Build 48851: arc lint + arc unit

Event Timeline

jrm requested review of this revision.Jun 7 2023, 2:27 AM

Should we be concerned that the long tm->tm_gmtoff will be implicitly cast as int32_t when it's returned?

Make utc_offset() argument match gmt2local() and make it a static function.

This revision is now accepted and ready to land.Jun 7 2023, 4:36 PM

This seems OK as a minimal change.

We may want to follow tcpdump's ts_print() more closely though, in a subsequent change.

Assert that the value stored in tm->tm_gmtoff will fit in a int32_t.

This revision now requires review to proceed.Jun 7 2023, 6:07 PM

Nit: s/npd/ndp/ in commit log

usr.sbin/ndp/ndp.c
187

Given this is only used with a value of 0, I would maybe go ahead and assume that and remove the argument from here entirely, that is, have it start as:

static int32_t
utc_offset(void)
{
    struct tm *tm;
    time t;

    t = time(NULL);
    tm = localtime(&t);
...
197

Revert back to function with no arguments. Fix typo and formatting.

jrm marked 2 inline comments as done.Jun 7 2023, 8:54 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jun 8 2023, 2:00 AM
This revision was automatically updated to reflect the committed changes.