Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transmute big endian s6_addr and [u16; 8] #75085

Merged
merged 1 commit into from
Aug 11, 2020
Merged

Commits on Aug 10, 2020

  1. Transmute between big endian s6_addr and [u16; 8].

    The old code already made the assumption to reinterpret
    `Ipv6Addr` as `[u16; 8]`.
    
    Glibc, Linux, FreeBSD, Win32 all makes this assumption.
    The main motivation of using union it to better optimize code.
    
    ref:
    * https://docs.microsoft.com/en-us/windows/win32/api/in6addr/ns-in6addr-in6_addr
    * https://github.com/freebsd/freebsd/blob/1d6e4247415d264485ee94b59fdbc12e0c566fd0/contrib/ntp/lib/isc/include/isc/ipv6.h#L63
    * https://github.com/zephyrproject-rtos/zephyr/blob/8b531aa996bba254c03129658490af59597acd78/include/net/net_ip.h#L137
    * https://sourceware.org/git/?p=glibc.git;a=blob;f=inet/netinet/in.h;h=f6355c7efe5192b88337b136ef687fe9a5ed648c;hb=HEAD#l216
    
    Co-authored-by: Josh Stone <cuviper@gmail.com>
    Co-authored-by: Peter Atashian <retep998@gmail.com>
    3 people committed Aug 10, 2020
    Configuration menu
    Copy the full SHA
    0210fd3 View commit details
    Browse the repository at this point in the history