Page MenuHomeFreeBSD

ddb: improve printing of inp_flags
ClosedPublic

Authored by tuexen on Oct 31 2025, 3:06 PM.
Tags
None
Referenced Files
F157401190: D53498.id165578.diff
Thu, May 21, 12:26 AM
F157374862: D53498.id165592.diff
Wed, May 20, 6:31 PM
F157352353: D53498.id.diff
Wed, May 20, 1:25 PM
Unknown Object (File)
Sun, May 17, 6:00 AM
Unknown Object (File)
Mon, May 11, 9:29 PM
Unknown Object (File)
Mon, May 11, 8:56 PM
Unknown Object (File)
Mon, May 11, 8:34 PM
Unknown Object (File)
Thu, Apr 30, 11:55 PM
Subscribers

Details

Summary

Add four missing flags (INP_BINDANY, INP_INHASHLIST, INP_RESERVED_0, INP_BOUNDFIB) used in inp_flags and remove one flag (INP_ORIGDSTADDR), which is actually a flag used in inp_flags2 and not in inp_flags.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This code should really use %b, as documented in printf(9).

remove one flag (INP_ORIGDSTADDR), which is actually a flag used in inp_flags2 and not in inp_flags.

Don't we want to print inp_flags2 as well? BTW, it seems very easy to use the wrong flag field. It should at least be called INP2_ORIGDSTADDR or something like that.

This revision is now accepted and ready to land.Oct 31 2025, 4:43 PM

This code should really use %b, as documented in printf(9).

I agree. But we have this kind of code in more than one place. I can take a look.

remove one flag (INP_ORIGDSTADDR), which is actually a flag used in inp_flags2 and not in inp_flags.

Don't we want to print inp_flags2 as well? BTW, it seems very easy to use the wrong flag field. It should at least be called INP2_ORIGDSTADDR or something like that.

Yes, we want to print inp_flags2, too. This will be a separate change. And I agree with your proposed name change. There is something like INP_2PCP_SET, but I would prefer something like INP2_PCP_SET or INP_2_PCP_SET. Any preference?

This revision was automatically updated to reflect the committed changes.

This code should really use %b, as documented in printf(9).

I agree. But we have this kind of code in more than one place. I can take a look.

Have a look at D53507 and D53510 which does this in the networking related files.

remove one flag (INP_ORIGDSTADDR), which is actually a flag used in inp_flags2 and not in inp_flags.

Don't we want to print inp_flags2 as well? BTW, it seems very easy to use the wrong flag field. It should at least be called INP2_ORIGDSTADDR or something like that.

Yes, we want to print inp_flags2, too. This will be a separate change. And I agree with your proposed name change. There is something like INP_2PCP_SET, but I would prefer something like INP2_PCP_SET or INP_2_PCP_SET. Any preference?