Skip to content

Commit 280f366

Browse files
committed
ifreq for apple follow-up fix case when in non libc_union case
1 parent 0dbadb4 commit 280f366

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/unix/bsd/apple/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1464,6 +1464,8 @@ s_no_extra_traits! {
14641464
pub ifr_name: [::c_char; ::IFNAMSIZ],
14651465
#[cfg(libc_union)]
14661466
pub ifr_ifru: __c_anonymous_ifr_ifru,
1467+
#[cfg(not(libc_union))]
1468+
pub ifr_ifru: ::sockaddr,
14671469
}
14681470
}
14691471

@@ -2977,6 +2979,7 @@ cfg_if! {
29772979
impl PartialEq for ifreq {
29782980
fn eq(&self, other: &ifreq) -> bool {
29792981
self.ifr_name == other.ifr_name
2982+
&& self.ifr_ifru == other.ifr_ifru
29802983
}
29812984
}
29822985

@@ -2986,14 +2989,14 @@ cfg_if! {
29862989
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
29872990
f.debug_struct("ifreq")
29882991
.field("ifr_name", &self.ifr_name)
2992+
.field("ifr_ifru", &self.ifr_ifru)
29892993
.finish()
29902994
}
29912995
}
29922996

29932997
impl ::hash::Hash for ifreq {
29942998
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
29952999
self.ifr_name.hash(state);
2996-
#[cfg(libc_union)]
29973000
self.ifr_ifru.hash(state);
29983001
}
29993002
}

0 commit comments

Comments
 (0)