This removes just one level of #define mess that is needed to reach into
an inpcbs IPv4 address. And makes the declaration easier to read. No
functional change.
Details
- Reviewers
markj - Group Reviewers
network - Commits
- rG698402f4f97c: inpcb: declare struct in_conninfo as a single declaration
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Note: union in_dependaddr can be anonymized after small cleanup of lbgroup code and siftr(4). This removes another level of of defines for both IPv6 and IPv4. This may need universe/exp-run, though.
The idea is that instead of union in_dependaddr ie_dependfaddr, ie_dependladdr; two anonymous unions are used. Identical in their layout, but one has members with f prefix and other with l.
If there is some consensus on this being a good idea, I can run test builds and post the review,
The struct in_endpoints can also be anonymized easily, but that would highly likely affect something outside of FreeBSD. Another level of #define to be removed. Let me know what you think about this and I will dig deeper into this if we all agree.
Alternatively we can leave publicly declared struct in_conninfo as is and just stop using it internally. But this review (D58273) probably should go in. It must be safe.
| sys/netinet/in_pcb.h | ||
|---|---|---|
| 41–45 | AFAIU the comment, it says that the existing members at the beginning of the structure align the IPv6 addresses to 8. (kgdb) set $inc = (struct in_conninfo *)0 (kgdb) p $inc->inc_ie.ie_dependfaddr Cannot access memory at address 0x8 And you are right, there is no natural alignment, and inside inpcb the addresses are not aligned: (kgdb) p/x (uintptr_t)&$inp->inp_inc->inc_ie.ie_dependfaddr & (8-1) $6 = 0x4 Do you suggest to remove the comment? | |
| 51–52 | The was pad one? I'd be glad to remove it. | |
| 553 | Thanks! | |
Fixup comments:
- Remove comment about alignment. inpcb doesn't have IPv6 addresses aligned and the RFC talks about alignment of API structures, specifically sockaddr_in6.
- Remove old mentioning of old pad
- Fixup mentioning of a structure that is just deleted