Upgrade nix to 0.26.2

This project was upgraded with external_updater.
Usage: tools/external_updater/updater.sh update rust/crates/nix
For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md

Test: TreeHugger
Change-Id: I3231615c25bba75c84aa7535a86d1adc382702c5
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 1448400..b9cb2ab 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,6 +1,6 @@
 {
   "git": {
-    "sha1": "e7a646ddff63b912b3a5afab6464465d800de350"
+    "sha1": "1e3f062fd842b7ce130ea6c792a8eab7f78f82e3"
   },
   "path_in_vcs": ""
 }
\ No newline at end of file
diff --git a/Android.bp b/Android.bp
index 091550b..8241ba8 100644
--- a/Android.bp
+++ b/Android.bp
@@ -26,7 +26,7 @@
     host_supported: true,
     crate_name: "nix",
     cargo_env_compat: true,
-    cargo_pkg_version: "0.26.1",
+    cargo_pkg_version: "0.26.2",
     srcs: ["src/lib.rs"],
     edition: "2018",
     features: [
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a332bc5..283cb86 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,15 +3,16 @@
 All notable changes to this project will be documented in this file.
 This project adheres to [Semantic Versioning](https://semver.org/).
 
+## [0.26.2] - 2023-01-18
+### Fixed
+- Fix `SockaddrIn6` bug that was swapping flowinfo and scope_id byte ordering.
+  ([#1964](https://github.com/nix-rust/nix/pull/1964))
+
 ## [0.26.1] - 2022-11-29
-### Added
-### Changed
 ### Fixed
 - Fix UB with `sys::socket::sockopt::SockType` using `SOCK_PACKET`.
   ([#1821](https://github.com/nix-rust/nix/pull/1821))
 
-### Removed
-
 ## [0.26.0] - 2022-11-29
 ### Added
 
diff --git a/Cargo.toml b/Cargo.toml
index 24f8974..0afc445 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@
 edition = "2018"
 rust-version = "1.56"
 name = "nix"
-version = "0.26.1"
+version = "0.26.2"
 authors = ["The nix-rust Project Developers"]
 include = [
     "src/**/*",
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index cfe20d8..8b1d873 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -2,7 +2,7 @@
 name        = "nix"
 description = "Rust friendly bindings to *nix APIs"
 edition     = "2018"
-version     = "0.26.1"
+version     = "0.26.2"
 rust-version = "1.56"
 authors     = ["The nix-rust Project Developers"]
 repository  = "https://github.com/nix-rust/nix"
diff --git a/METADATA b/METADATA
index ef52918..b1b992d 100644
--- a/METADATA
+++ b/METADATA
@@ -11,13 +11,13 @@
   }
   url {
     type: ARCHIVE
-    value: "https://static.crates.io/crates/nix/nix-0.26.1.crate"
+    value: "https://static.crates.io/crates/nix/nix-0.26.2.crate"
   }
-  version: "0.26.1"
+  version: "0.26.2"
   license_type: NOTICE
   last_upgrade_date {
-    year: 2022
-    month: 12
-    day: 12
+    year: 2023
+    month: 2
+    day: 16
   }
 }
diff --git a/README.md b/README.md
index 7597ba0..2c42b90 100644
--- a/README.md
+++ b/README.md
@@ -47,6 +47,7 @@
 The following targets are supported by `nix`:
 
 Tier 1:
+  * aarch64-apple-darwin
   * aarch64-unknown-linux-gnu
   * arm-unknown-linux-gnueabi
   * armv7-unknown-linux-gnueabihf
@@ -58,13 +59,11 @@
   * mips64el-unknown-linux-gnuabi64
   * mipsel-unknown-linux-gnu
   * powerpc64le-unknown-linux-gnu
-  * x86_64-apple-darwin
   * x86_64-unknown-freebsd
   * x86_64-unknown-linux-gnu
   * x86_64-unknown-linux-musl
 
 Tier 2:
-  * aarch64-apple-darwin
   * aarch64-apple-ios
   * aarch64-linux-android
   * arm-linux-androideabi
@@ -75,6 +74,7 @@
   * s390x-unknown-linux-gnu
   * x86_64-apple-ios
   * x86_64-linux-android
+  * x86_64-apple-darwin
   * x86_64-unknown-illumos
   * x86_64-unknown-netbsd
 
diff --git a/src/sys/socket/addr.rs b/src/sys/socket/addr.rs
index 8b23b10..4e565a5 100644
--- a/src/sys/socket/addr.rs
+++ b/src/sys/socket/addr.rs
@@ -1476,8 +1476,8 @@
         net::SocketAddrV6::new(
             net::Ipv6Addr::from(addr.0.sin6_addr.s6_addr),
             u16::from_be(addr.0.sin6_port),
-            u32::from_be(addr.0.sin6_flowinfo),
-            u32::from_be(addr.0.sin6_scope_id),
+            addr.0.sin6_flowinfo,
+            addr.0.sin6_scope_id,
         )
     }
 }
@@ -3167,6 +3167,18 @@
                 SockaddrIn6::size() as usize
             );
         }
+
+        #[test]
+        // Ensure that we can convert to-and-from std::net variants without change.
+        fn to_and_from() {
+            let s = "[1234:5678:90ab:cdef::1111:2222]:8080";
+            let mut nix_sin6 = SockaddrIn6::from_str(s).unwrap();
+            nix_sin6.0.sin6_flowinfo = 0x12345678;
+            nix_sin6.0.sin6_scope_id = 0x9abcdef0;
+
+            let std_sin6 : std::net::SocketAddrV6 = nix_sin6.into();
+            assert_eq!(nix_sin6, std_sin6.into());
+        }
     }
 
     mod sockaddr_storage {
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs
index 2d7159a..8513b6f 100644
--- a/src/sys/socket/mod.rs
+++ b/src/sys/socket/mod.rs
@@ -1298,7 +1298,7 @@
             }
             #[cfg(any(target_os = "android", target_os = "linux"))]
             ControlMessage::AlgSetIv(iv) => {
-                mem::size_of_val(&iv) + iv.len()
+                mem::size_of::<&[u8]>() + iv.len()
             },
             #[cfg(any(target_os = "android", target_os = "linux"))]
             ControlMessage::AlgSetOp(op) => {
diff --git a/src/unistd.rs b/src/unistd.rs
index ca07b34..d746757 100644
--- a/src/unistd.rs
+++ b/src/unistd.rs
@@ -3015,12 +3015,12 @@
     fn from(pw: &libc::passwd) -> User {
         unsafe {
             User {
-                name: if pw.pw_name.is_null() { Default::default() } else { CStr::from_ptr(pw.pw_name).to_string_lossy().into_owned() },
-                passwd: if pw.pw_passwd.is_null() { Default::default() } else { CString::new(CStr::from_ptr(pw.pw_passwd).to_bytes()).unwrap() },
+                name: CStr::from_ptr(pw.pw_name).to_string_lossy().into_owned(),
+                passwd: CString::new(CStr::from_ptr(pw.pw_passwd).to_bytes()).unwrap(),
                 #[cfg(not(all(target_os = "android", target_pointer_width = "32")))]
-                gecos: if pw.pw_gecos.is_null() { Default::default() } else { CString::new(CStr::from_ptr(pw.pw_gecos).to_bytes()).unwrap() },
-                dir: if pw.pw_dir.is_null() { Default::default() } else { PathBuf::from(OsStr::from_bytes(CStr::from_ptr(pw.pw_dir).to_bytes())) },
-                shell: if pw.pw_shell.is_null() { Default::default() } else { PathBuf::from(OsStr::from_bytes(CStr::from_ptr(pw.pw_shell).to_bytes())) },
+                gecos: CString::new(CStr::from_ptr(pw.pw_gecos).to_bytes()).unwrap(),
+                dir: PathBuf::from(OsStr::from_bytes(CStr::from_ptr(pw.pw_dir).to_bytes())),
+                shell: PathBuf::from(OsStr::from_bytes(CStr::from_ptr(pw.pw_shell).to_bytes())),
                 uid: Uid::from_raw(pw.pw_uid),
                 gid: Gid::from_raw(pw.pw_gid),
                 #[cfg(not(any(target_os = "android",