History log of /freebsd/usr.bin/netstat/route.c (Results 1 – 25 of 309)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 9206c799 26-Nov-2024 Allan Jude <allanjude@FreeBSD.org>

usr.bin/netstat: -n should not print symbolic names

In numeric mode, the default route is printed as "default" rather
than 0.0.0.0/0 or ::/0

From the man page:
"-n: Show network addresses and ports

usr.bin/netstat: -n should not print symbolic names

In numeric mode, the default route is printed as "default" rather
than 0.0.0.0/0 or ::/0

From the man page:
"-n: Show network addresses and ports as numbers.
Normally netstat attempts to resolve addresses and ports, and display
them symbolically. If the -n option is specified, the address is
printed numerically, according to the address family.
For more information regarding the Internet IPv4 ``dot format'', refer
to inet(3). Unspecified, or `wildcard'', addresses and ports appear
as `*''."

Reported By: rgrimes
Reviewed by: emaste, ngie, eadler, seanc
Relnotes: yes
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D10320

show more ...


# f3a097d0 24-Oct-2024 Kyle Evans <kevans@FreeBSD.org>

netstat: switch to using the sysctl-exported stats for live stats

Now that we export the relevant stats via the net.route.stats sysctl,
switch to using that to avoid having to dig around in mem(4) f

netstat: switch to using the sysctl-exported stats for live stats

Now that we export the relevant stats via the net.route.stats sysctl,
switch to using that to avoid having to dig around in mem(4) for live
kernel statistics. Based on callers of kresolve_list(), this is the
last live path using mem(4) that could be functional today.

Tested both with `netstat -rs` and `netstat -rs -M`.

Note that this will not be able to extract stats from a running kernel
that predates 3360a15898 / 1500026, but this can be worked around by
specifying `-M /dev/mem` explicitly in the interim to fallback to
libkvm against /dev/mem.

Reviewed by: glebius, markj, zlei
Differential Revision: https://reviews.freebsd.org/D47231

show more ...


# 95968ea7 12-Oct-2024 Yan-Hao Wang <yanhaowang@FreeBSD.org>

netstat(1): Complete libxo transition

Reviewed by: des
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D41427


Revision tags: release/13.4.0, release/14.1.0
# ae9c0ba8 15-May-2024 Lexi Winter <lexi@le-Fay.ORG>

netstat(8): for -W, use IFNAMSIZ

If -W is specified, use IFNAMSIZ as the width of the Netif column,
instead of the default 12.

Reviewed by: imp,zlei,Mina Galić
Pull Request: https://github.com/free

netstat(8): for -W, use IFNAMSIZ

If -W is specified, use IFNAMSIZ as the width of the Netif column,
instead of the default 12.

Reviewed by: imp,zlei,Mina Galić
Pull Request: https://github.com/freebsd/freebsd-src/pull/1223

show more ...


# d33b87e8 08-May-2024 Lexi Winter <lexi@le-Fay.ORG>

netstat(1): increase width of Netif column

The previous width of Netif (10 or 8) was too short for modern interface
names; make it 12, which is long enough to display "epair0a.1000".

This came up i

netstat(1): increase width of Netif column

The previous width of Netif (10 or 8) was too short for modern interface
names; make it 12, which is long enough to display "epair0a.1000".

This came up in practice with genet(4) interfaces, since the base
interface name is long enough that with the previous limit, VLAN
identifiers would be truncated at 1 character in the IPv6 output:
"genet0.100" becomes "genet0.1".

The width is now fixed, and doesn't depend on the address family,
because there's no reason that length of the interface name would vary
based on the AF.

Reviewed by: imp,zlei,Mina Galić
Pull Request: https://github.com/freebsd/freebsd-src/pull/1223

show more ...


Revision tags: release/13.3.0
# 5e3934b1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

R

usr.bin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix

show more ...


# bdcbfde3 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a pe

usr.bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix

show more ...


Revision tags: release/14.0.0
# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


Revision tags: release/13.2.0
# 64dfea86 26-Mar-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

netlink: add NETLINK/NETLINK_SUPPORT userland options.

Make userland tools such as netstat, route, arp and ndp use
either netlink or rtsock interfaces based on the NETLINK_SUPPORT
options.
Both NE

netlink: add NETLINK/NETLINK_SUPPORT userland options.

Make userland tools such as netstat, route, arp and ndp use
either netlink or rtsock interfaces based on the NETLINK_SUPPORT
options.
Both NETLINK and NETLINK_SUPPORT options are turned on by default.

Reviewed By: eugen
Differential Revision: https://reviews.freebsd.org/D39148

show more ...


# 15dbf5a2 29-Jan-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

netstat: export weight for single-path routes.

* Parse and export newly-added NL_RTA_WEIGHT attribute, providing path
weight for a non-multipath route. This fixes a number of tests in
sys/net/rout

netstat: export weight for single-path routes.

* Parse and export newly-added NL_RTA_WEIGHT attribute, providing path
weight for a non-multipath route. This fixes a number of tests in
sys/net/routing which rely on this data.
* Remove handling of NL_RTA_KNH_ID in multipath routes, as it is
not provided.
* Improve kernel/user nexthop index export. As a result,
for multipath routes:
* nhg-kidx attribute represents kernel nhg index (always provided)
* nhg-uidx attribute represents user-provided nhg index (if set)
for non-multipath routes:
* nhop-kidx attribute represents kernel nhop index (always provided)
* nhop-udx attribute represents user-provided nexthop index (if set)

show more ...


# 68636dcb 27-Jan-2023 Alexander V. Chernikov <melifaro@FreeBSD.org>

netstat: make netstat -rn use netlink instead of rtsock

This change switches route listing in netstat to netlink, with fallback to rtsock.
The outputs are mostly identical, with an exception of not

netstat: make netstat -rn use netlink instead of rtsock

This change switches route listing in netstat to netlink, with fallback to rtsock.
The outputs are mostly identical, with an exception of not showing kernel
nexthop indexes for multipath routes.

Differential Revision: https://reviews.freebsd.org/D36529

show more ...


Revision tags: release/12.4.0
# c8f34118 20-Jun-2022 Alexander V. Chernikov <melifaro@FreeBSD.org>

netstat: print path weight when showing routes in structured output.

Differential Revision: https://reviews.freebsd.org/D35530
MFC after: 2 weeks


Revision tags: release/13.1.0, release/12.3.0, release/13.0.0
# 4084b1ab 31-Mar-2021 Alexander V. Chernikov <melifaro@FreeBSD.org>

Fix `netstat -rs` reporting.

rttrash (unused but not yet delete entries) were eliminated
during routing rework. Remove reading these symbols from the kernel.

PR: 254681
Reported by: rashey@superb

Fix `netstat -rs` reporting.

rttrash (unused but not yet delete entries) were eliminated
during routing rework. Remove reading these symbols from the kernel.

PR: 254681
Reported by: rashey@superbox.pl
MFC after: immediately

show more ...


Revision tags: release/12.2.0, release/11.4.0
# a6663252 12-Apr-2020 Alexander V. Chernikov <melifaro@FreeBSD.org>

Introduce nexthop objects and new routing KPI.

This is the foundational change for the routing subsytem rearchitecture.
More details and goals are available in https://reviews.freebsd.org/D24141 .

Introduce nexthop objects and new routing KPI.

This is the foundational change for the routing subsytem rearchitecture.
More details and goals are available in https://reviews.freebsd.org/D24141 .

This patch introduces concept of nexthop objects and new nexthop-based
routing KPI.

Nexthops are objects, containing all necessary information for performing
the packet output decision. Output interface, mtu, flags, gw address goes
there. For most of the cases, these objects will serve the same role as
the struct rtentry is currently serving.
Typically there will be low tens of such objects for the router even with
multiple BGP full-views, as these objects will be shared between routing
entries. This allows to store more information in the nexthop.

New KPI:

struct nhop_object *fib4_lookup(uint32_t fibnum, struct in_addr dst,
uint32_t scopeid, uint32_t flags, uint32_t flowid);
struct nhop_object *fib6_lookup(uint32_t fibnum, const struct in6_addr *dst6,
uint32_t scopeid, uint32_t flags, uint32_t flowid);

These 2 function are intended to replace all all flavours of
<in_|in6_>rtalloc[1]<_ign><_fib>, mpath functions and the previous
fib[46]-generation functions.

Upon successful lookup, they return nexthop object which is guaranteed to
exist within current NET_EPOCH. If longer lifetime is desired, one can
specify NHR_REF as a flag and get a referenced version of the nexthop.
Reference semantic closely resembles rtentry one, allowing sed-style conversion.

Additionally, another 2 functions are introduced to support uRPF functionality
inside variety of our firewalls. Their primary goal is to hide the multipath
implementation details inside the routing subsystem, greatly simplifying
firewalls implementation:

int fib4_lookup_urpf(uint32_t fibnum, struct in_addr dst, uint32_t scopeid,
uint32_t flags, const struct ifnet *src_if);
int fib6_lookup_urpf(uint32_t fibnum, const struct in6_addr *dst6, uint32_t scopeid,
uint32_t flags, const struct ifnet *src_if);

All functions have a separate scopeid argument, paving way to eliminating IPv6 scope
embedding and allowing to support IPv4 link-locals in the future.

Structure changes:
* rtentry gets new 'rt_nhop' pointer, slightly growing the overall size.
* rib_head gets new 'rnh_preadd' callback pointer, slightly growing overall sz.

Old KPI:
During the transition state old and new KPI will coexists. As there are another 4-5
decent-sized conversion patches, it will probably take a couple of weeks.
To support both KPIs, fields not required by the new KPI (most of rtentry) has to be
kept, resulting in the temporary size increase.
Once conversion is finished, rtentry will notably shrink.

More details:
* architectural overview: https://reviews.freebsd.org/D24141
* list of the next changes: https://reviews.freebsd.org/D24232

Reviewed by: ae,glebius(initial version)
Differential Revision: https://reviews.freebsd.org/D24232

show more ...


# 185c3d2b 17-Dec-2019 Gleb Smirnoff <glebius@FreeBSD.org>

Convert routing statistics to VNET_PCPUSTAT.

Submitted by: ocochard
Reviewed by: melifaro, glebius
Differential Revision: https://reviews.freebsd.org/D22834


Revision tags: release/12.1.0, release/11.3.0, release/12.0.0, release/11.2.0
# 82725ba9 23-Nov-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Merge ^/head r325999 through r326131.


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier f

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.

show more ...


Revision tags: release/10.4.0, release/11.1.0
# 554491ff 20-Apr-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r316992 through r317215.


# 2f8c6c0a 16-Apr-2017 Patrick Kelsey <pkelsey@FreeBSD.org>

Fix userland tools that don't check the format of routing socket
messages before accessing message fields that may not be present,
removing dead/duplicate/misleading code along the way.

Document the

Fix userland tools that don't check the format of routing socket
messages before accessing message fields that may not be present,
removing dead/duplicate/misleading code along the way.

Document the message format for each routing socket message in
route.h.

Fix a bug in usr.bin/netstat introduced in r287351 that resulted in
pointer computation with essentially random 16-bit offsets and
dereferencing of the results.

Reviewed by: ae
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D10330

show more ...


# 348238db 01-Mar-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r314420 through r314481.


# fbbd9655 01-Mar-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96

show more ...


# b0cc56ed 09-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r311692 through r311807.


# f0dac7b3 09-Jan-2017 Xin LI <delphij@FreeBSD.org>

Fix typo.

MFC after: 3 days


# 2b532af8 05-Jan-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r311314 through r311459.


# f193c8ce 05-Jan-2017 Xin LI <delphij@FreeBSD.org>

Use strlcpy and snprintf in netstat(1).

Expand inet6name() line buffer to NI_MAXHOST and use strlcpy/snprintf
in various places.

Reported by: Anton Yuzhaninov <citrin citrin ru>
MFC after: 3 days
D

Use strlcpy and snprintf in netstat(1).

Expand inet6name() line buffer to NI_MAXHOST and use strlcpy/snprintf
in various places.

Reported by: Anton Yuzhaninov <citrin citrin ru>
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D8916

show more ...


12345678910>>...13