Project

General

Profile

Feature #7840

Define uint16_t member in in6_addr

Added by Alexander Pyhalov almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2017-02-04
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

Currently /usr/include/netinet/in.h defines

struct in6_addr {
        union {
                /*
                 * Note: Static initalizers of "union" type assume
                 * the constant on the RHS is the type of the first member
                 * of union.
                 * To make static initializers (and efficient usage) work,
                 * the order of members exposed to user and kernel view of
                 * this data structure is different.
                 * User environment sees specified uint8_t type as first
                 * member whereas kernel sees most efficient type as
                 * first member.
                 */
#ifdef _KERNEL
                uint32_t        _S6_u32[4];     /* IPv6 address */
                uint8_t         _S6_u8[16];     /* IPv6 address */
#else
                uint8_t         _S6_u8[16];     /* IPv6 address */
                uint32_t        _S6_u32[4];     /* IPv6 address */
#endif
                uint32_t        __S6_align;     /* Align on 32 bit boundary */
        } _S6_un;
};

We wold benefit from adding uint16_t _S6_u168 to this union for porting applications, which needs s6_addr16.

#1

Updated by Electric Monk over 3 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 39b16bd33a2633978bee6aed53e3afeb26399eb4

commit  39b16bd33a2633978bee6aed53e3afeb26399eb4
Author: Alexander Pyhalov <apyhalov@gmail.com>
Date:   2017-03-04T23:20:29.000Z

    7840 Define uint16_t member in in6_addr
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF