Skip to content

Commit d9130b4

Browse files
committed
Rename to Timestampns
1 parent 221dedc commit d9130b4

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/sys/socket/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ pub enum ControlMessageOwned {
560560
///
561561
/// [Further reading](https://www.kernel.org/doc/html/latest/networking/timestamping.html)
562562
#[cfg(all(target_os = "linux", any(target_arch = "x86_64"), target_env = "gnu"))]
563-
ScmTimestampNs(TimeSpec),
563+
ScmTimestampns(TimeSpec),
564564
#[cfg(any(
565565
target_os = "android",
566566
target_os = "ios",
@@ -655,7 +655,7 @@ impl ControlMessageOwned {
655655
#[cfg(all(target_os = "linux", any(target_arch = "x86_64"), target_env = "gnu"))]
656656
(libc::SOL_SOCKET, libc::SCM_TIMESTAMPNS) => {
657657
let ts: libc::timespec = ptr::read_unaligned(p as *const _);
658-
ControlMessageOwned::ScmTimestampNs(TimeSpec::from(ts))
658+
ControlMessageOwned::ScmTimestampns(TimeSpec::from(ts))
659659
}
660660
#[cfg(any(
661661
target_os = "android",

src/sys/socket/sockopt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ sockopt_impl!(Both, BindToDevice, libc::SOL_SOCKET, libc::SO_BINDTODEVICE, OsStr
273273
sockopt_impl!(GetOnly, OriginalDst, libc::SOL_IP, libc::SO_ORIGINAL_DST, libc::sockaddr_in);
274274
sockopt_impl!(Both, ReceiveTimestamp, libc::SOL_SOCKET, libc::SO_TIMESTAMP, bool);
275275
#[cfg(all(target_os = "linux", any(target_arch = "x86_64"), target_env = "gnu"))]
276-
sockopt_impl!(Both, ReceiveTimestampNs, libc::SOL_SOCKET, libc::SO_TIMESTAMPNS, bool);
276+
sockopt_impl!(Both, ReceiveTimestampns, libc::SOL_SOCKET, libc::SO_TIMESTAMPNS, bool);
277277
#[cfg(any(target_os = "android", target_os = "linux"))]
278278
sockopt_impl!(Both, IpTransparent, libc::SOL_IP, libc::IP_TRANSPARENT, bool);
279279
#[cfg(target_os = "openbsd")]

test/sys/test_socket.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,7 @@ fn test_recvmsg_timestampns() {
15511551
SockType::Datagram,
15521552
SockFlag::empty(),
15531553
None).unwrap();
1554-
setsockopt(in_socket, sockopt::ReceiveTimestampNs, &true).unwrap();
1554+
setsockopt(in_socket, sockopt::ReceiveTimestampns, &true).unwrap();
15551555
let localhost = InetAddr::new(IpAddr::new_v4(127, 0, 0, 1), 0);
15561556
bind(in_socket, &SockAddr::new_inet(localhost)).unwrap();
15571557
let address = getsockname(in_socket).unwrap();
@@ -1568,7 +1568,7 @@ fn test_recvmsg_timestampns() {
15681568
let iov = [IoVec::from_mut_slice(&mut buffer)];
15691569
let r = recvmsg(in_socket, &iov, Some(&mut cmsgspace), flags).unwrap();
15701570
let rtime = match r.cmsgs().next() {
1571-
Some(ControlMessageOwned::ScmTimestampNs(rtime)) => rtime,
1571+
Some(ControlMessageOwned::ScmTimestampns(rtime)) => rtime,
15721572
Some(_) => panic!("Unexpected control message"),
15731573
None => panic!("No control message")
15741574
};
@@ -1599,7 +1599,7 @@ fn test_recvmmsg_timestampns() {
15991599
SockType::Datagram,
16001600
SockFlag::empty(),
16011601
None).unwrap();
1602-
setsockopt(in_socket, sockopt::ReceiveTimestampNs, &true).unwrap();
1602+
setsockopt(in_socket, sockopt::ReceiveTimestampns, &true).unwrap();
16031603
let localhost = InetAddr::new(IpAddr::new_v4(127, 0, 0, 1), 0);
16041604
bind(in_socket, &SockAddr::new_inet(localhost)).unwrap();
16051605
let address = getsockname(in_socket).unwrap();
@@ -1622,7 +1622,7 @@ fn test_recvmmsg_timestampns() {
16221622
];
16231623
let r = recvmmsg(in_socket, &mut data, flags, None).unwrap();
16241624
let rtime = match r[0].cmsgs().next() {
1625-
Some(ControlMessageOwned::ScmTimestampNs(rtime)) => rtime,
1625+
Some(ControlMessageOwned::ScmTimestampns(rtime)) => rtime,
16261626
Some(_) => panic!("Unexpected control message"),
16271627
None => panic!("No control message")
16281628
};

0 commit comments

Comments
 (0)