From a2df642900a546ab79508391ab506e0a6d69eab3 Mon Sep 17 00:00:00 2001 From: dlg <> Date: Sun, 29 Jun 2025 00:33:46 +0000 Subject: make the argument to ether_ntoa const. this drives me nuts when i want to print something out of what's already const. casting it works, but feels gross. ok guenther@ tb@ deraadt@ enh says this is already in bionic/glibc/musl --- src/lib/libc/net/ether_aton.3 | 6 +++--- src/lib/libc/net/ethers.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/libc/net/ether_aton.3 b/src/lib/libc/net/ether_aton.3 index 98562dc44c..83fe98880c 100644 --- a/src/lib/libc/net/ether_aton.3 +++ b/src/lib/libc/net/ether_aton.3 @@ -1,8 +1,8 @@ -.\" $OpenBSD: ether_aton.3,v 1.3 2022/09/11 06:38:10 jmc Exp $ +.\" $OpenBSD: ether_aton.3,v 1.4 2025/06/29 00:33:46 dlg Exp $ .\" .\" Written by roland@frob.com. Public domain. .\" -.Dd $Mdocdate: September 11 2022 $ +.Dd $Mdocdate: June 29 2025 $ .Dt ETHER_ATON 3 .Os .Sh NAME @@ -19,7 +19,7 @@ .In netinet/in.h .In netinet/if_ether.h .Ft char * -.Fn ether_ntoa "struct ether_addr *e" +.Fn ether_ntoa "const struct ether_addr *e" .Ft struct ether_addr * .Fn ether_aton "const char *s" .Ft int diff --git a/src/lib/libc/net/ethers.c b/src/lib/libc/net/ethers.c index d62be1ca71..6edad5c5e5 100644 --- a/src/lib/libc/net/ethers.c +++ b/src/lib/libc/net/ethers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ethers.c,v 1.27 2019/01/25 00:19:25 millert Exp $ */ +/* $OpenBSD: ethers.c,v 1.28 2025/06/29 00:33:46 dlg Exp $ */ /* * Copyright (c) 1998 Todd C. Miller @@ -42,7 +42,7 @@ static char * _ether_aton(const char *, struct ether_addr *); char * -ether_ntoa(struct ether_addr *e) +ether_ntoa(const struct ether_addr *e) { static char a[] = "xx:xx:xx:xx:xx:xx"; -- cgit v1.2.3-55-g6feb