diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2024-02-13 12:22:10 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2024-02-13 12:22:10 +0000 |
commit | 51a4bd63b67539da721dc5a35bb5bb2f89469b03 (patch) | |
tree | 39e4574b40e1dbe7366e3f136571e208bf64a921 /usr.bin/netstat | |
parent | 3c439a064ae7c61486a17ce1a42cb72e23a6b58f (diff) |
Merge struct route and struct route_in6.
Use a common struct route for both inet and inet6. Unfortunately
struct sockaddr is shorter than sockaddr_in6, so netinet/in.h has
to be exposed from net/route.h. Struct route has to be bsd visible
for userland as netstat kvm code inspects inp_route. Internet PCB
and TCP SYN cache can use a plain struct route now. All specific
sockaddr types for inet and inet6 are embeded there.
OK claudio@
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r-- | usr.bin/netstat/inet.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index 560b8594bd8..a5bcd793822 100644 --- a/usr.bin/netstat/inet.c +++ b/usr.bin/netstat/inet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet.c,v 1.180 2024/02/05 23:16:39 bluhm Exp $ */ +/* $OpenBSD: inet.c,v 1.181 2024/02/13 12:22:09 bluhm Exp $ */ /* $NetBSD: inet.c,v 1.14 1995/10/03 21:42:37 thorpej Exp $ */ /* @@ -1461,14 +1461,14 @@ inpcb_dump(u_long off, short protocol, int af) case AF_INET: inet_ntop(af, &inp.inp_faddr, faddr, sizeof(faddr)); inet_ntop(af, &inp.inp_laddr, laddr, sizeof(laddr)); - inet_ntop(af, &((struct sockaddr_in *) - (&inp.inp_route.ro_dst))->sin_addr, raddr, sizeof(raddr)); + inet_ntop(af, &inp.inp_route.ro_dstsin.sin_addr, raddr, + sizeof(raddr)); break; case AF_INET6: inet_ntop(af, &inp.inp_faddr6, faddr, sizeof(faddr)); inet_ntop(af, &inp.inp_laddr6, laddr, sizeof(laddr)); - inet_ntop(af, &inp.inp_route6.ro_dst.sin6_addr, - raddr, sizeof(raddr)); + inet_ntop(af, &inp.inp_route.ro_dstsin6.sin6_addr, raddr, + sizeof(raddr)); break; default: faddr[0] = laddr[0] = '\0'; |