Page MenuHomeFreeBSD

ddb: improve printing of inp_flags
ClosedPublic

Authored by tuexen on Oct 31 2025, 3:06 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 1, 11:19 PM
Unknown Object (File)
Sat, Nov 29, 8:27 PM
Unknown Object (File)
Fri, Nov 28, 9:16 AM
Unknown Object (File)
Nov 24 2025, 4:05 PM
Unknown Object (File)
Nov 20 2025, 1:55 AM
Unknown Object (File)
Nov 20 2025, 1:55 AM
Unknown Object (File)
Nov 20 2025, 1:51 AM
Unknown Object (File)
Nov 18 2025, 9:20 AM
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?