4 ms·
Why not just use TLV style structure?
by pm2222 2y ago
Why not just use TLV style structure?
- asveikau 2y agoThat's essentially what it is. You can determine the size by looking at sa_family. Some platforms also have an sa_len field. It's still unsafe if you allocate for the "base" type of struct sockaddr then try to use it for something larger, but that generally is not done. People usually allocate for the exact type they want, and only pointers to the structure are passed around, often opaquely.