bgpd rework extract_prefix

2023-03-30 Thread Claudio Jeker
This diff cleans up extract_prefix(). The main point is to abort before writing anything. PREFIX_SIZE() includes the length byte so exclude that again. I think overall the function is more readable now. -- :wq Claudio Index: util.c

bgpd more rde_prefix refactor

2023-03-30 Thread Claudio Jeker
This diff changes the internals of the pt_entry prefix objects a little bit. The goal is to allow flexible sized elements in the future. Also increase the size of the refcnt to 32bit and reorder the vpn specific objects so that they are more in line with each other. -- :wq Claudio Index: rde.h

Re: rpki-client change metrics carepo uri for TA

2023-03-29 Thread Claudio Jeker
On Wed, Mar 29, 2023 at 10:13:22AM +0200, Theo Buehler wrote: > On Wed, Mar 29, 2023 at 09:51:56AM +0200, Claudio Jeker wrote: > > In the metrics file the TA is currently reported as: > > rpki_client_repository_objects{type="cert",state="valid",name="ripe&qu

bgpd switch adjout lookup funtions to use pt_entry

2023-03-29 Thread Claudio Jeker
The lookup functions for the Adj-RIB-Out trees (prefix_adjout_{get,lookup}) work mainly with a pt_entry so lets change them. Now prefix_adjout_lookup() which returns the first path (in case of add-path) is also used by bgpctl code-paths and there we want to keep using bgpd_addr. This diff changes

rpki-client change metrics carepo uri for TA

2023-03-29 Thread Claudio Jeker
In the metrics file the TA is currently reported as: rpki_client_repository_objects{type="cert",state="valid",name="ripe",carepo="ripe"} 1 The carepo which is a rsync URI for other repositories is just the TAL name. Instead it may be better to display the first URI from the TAL, like:

bgpd trigger error on pt_fill abuse

2023-03-28 Thread Claudio Jeker
I almost stepped into this trap and tried to pt_ref the static memory returned by pt_fill(). That wont work so better make the code explode. By setting the refcnt to USHRT_MAX a following pr_ref() call will fail. Since pt_alloc copies the passed data structure reset the refcnt to 0 there. I think

Re: bgpd rework how prefixes are written

2023-03-28 Thread Claudio Jeker
On Tue, Mar 28, 2023 at 05:02:26PM +0200, Theo Buehler wrote: > On Tue, Mar 28, 2023 at 03:35:46PM +0200, Claudio Jeker wrote: > > This diff moves prefix_write to rde_prefix.c and renames it to pt_write. > > The function now takes a struct pt_entry * as argument and with thi

bgpd rework how prefixes are written

2023-03-28 Thread Claudio Jeker
This diff moves prefix_write to rde_prefix.c and renames it to pt_write. The function now takes a struct pt_entry * as argument and with this the extra indirection via pt_getaddr() falls away. -- :wq Claudio Index: mrt.c === RCS

bgpd more cleanup of pt_entry

2023-03-28 Thread Claudio Jeker
Now that the accounting in bgpctl is fixed we can move some structs from rde.h into rde_prefix.c and hide them from everyone else. Also cleanup the AID_PTSIZE define it is only used in one place now. -- :wq Claudio Index: bgpd.h

bgpd change pt accounting

2023-03-28 Thread Claudio Jeker
Make bgpctl less depend on bgpd internals. Track the size of memory used by prefixes explicitly. This will allow to move the various pt_entry structs out of rde.h. -- :wq Claudio Index: bgpctl/bgpctl.h === RCS file:

bgpd rtr recalculation semaphor

2023-03-28 Thread Claudio Jeker
When an RTR session updates the data it happens between CACHE_RESPONSE and END_OF_DATA PDUs. When an END_OF_DATA PDU is received the various sources are merged into one table and sent to the RDE. Now since bgpd supports multiple RTR servers it is possible that two servers run updates roughly at

Re: bgpd mrt use ibuf instead of fixed buffer

2023-03-28 Thread Claudio Jeker
On Tue, Mar 28, 2023 at 11:00:37AM +0200, Theo Buehler wrote: > On Tue, Mar 28, 2023 at 10:35:34AM +0200, Claudio Jeker wrote: > > Switch mrt_dump_entry_v2() to use a dynamic ibuf for the prefix and > > switch the order of operation so that the memmove() of pbuf is no longer &g

bgpd mrt use ibuf instead of fixed buffer

2023-03-28 Thread Claudio Jeker
Switch mrt_dump_entry_v2() to use a dynamic ibuf for the prefix and switch the order of operation so that the memmove() of pbuf is no longer needed. Using a static buffer is problematic when flowspec support is added since flowspec "prefixes" can be more than 255 bytes long. -- :wq Claudio

bgpd role mini cleanup

2023-03-28 Thread Claudio Jeker
I think flipping the logic around makes the statements easier to read. Also we may need to add an extra role for siblings which behave like customers (using the downstream algorithm result). -- :wq Claudio Index: rde.c === RCS

Re: timer(4/sparc64): remove driver

2023-03-24 Thread Claudio Jeker
On Thu, Mar 23, 2023 at 05:37:05PM -0500, Scott Cheloha wrote: > On Sat, Mar 18, 2023 at 12:17:33PM -0600, Ted Bullock wrote: > > On 2023-03-17 12:29 p.m., Mike Larkin wrote: > > > On Thu, Mar 16, 2023 at 12:25:15PM -0500, Scott Cheloha wrote: > > >> This code has been dead since we switched

OpenBGPD 7.9 released

2023-03-23 Thread Claudio Jeker
We have released OpenBGPD 7.9, which will be arriving in the OpenBGPD directory of your local OpenBSD mirror soon. This release includes the following changes to the previous release: * Include OpenBSD 7.2 errata 023: Incorrect length checks allow an out-of-bounds read in bgpd(8).

OpenBGPD 7.8 released

2023-03-17 Thread Claudio Jeker
We have released OpenBGPD 7.8, which will be arriving in the OpenBGPD directory of your local OpenBSD mirror soon. This release includes the following changes to the previous release: * Improved performance by optimising the output filters * Add Autonomous System Provider Authorization

fix bgpd RTR ASPA parser

2023-03-17 Thread Claudio Jeker
Dumb mistake from my side. The rtr_aspa struct is on the stack and only covers that data up to the spas. The spas are a variable array and not copied over. So access these from the buf. Remove the trap of the 0 sized array in spas since it is now unused. Not entierly happy about that but unless

support leaked and invalid in bgplgd

2023-03-13 Thread Claudio Jeker
Add the plumbing in bgplgd to allow for leaked and invalid show rib options. -- :wq Claudio Index: bgplgd.h === RCS file: /cvs/src/usr.sbin/bgplgd/bgplgd.h,v retrieving revision 1.2 diff -u -p -r1.2 bgplgd.h --- bgplgd.h3 Feb

bgpctl show rib invalid and leaked routes

2023-03-13 Thread Claudio Jeker
This diff extends the show rib command to only show invalid (ineligible) or leaked (via OTC leak detection) routes. While there rename the OTC_LOOP defines to OTC_LEAK since this is not a route loop but a route leak. -- :wq Claudio Index: usr.sbin/bgpctl/bgpctl.8

bgpd further rtr code cleanup

2023-03-10 Thread Claudio Jeker
This is mainly cleanup of the rtr code. Rename a few functions to be more explicit (rtr_send_reset_query(), rtr_send_serial_query()) introduce a function to reset the rtr cache (rtr_reset_cache()). The reset function always resets the session_id now to ensure the next connection attempt issues a

bgpd out filter speedup

2023-03-09 Thread Claudio Jeker
On my big IXP RS test setup with 600 peers the rde_filter call in the output path is rather expensive. By splitting the output ruleset into output rulesets per peer the performance is improved by around 5min on a 20min runtime. So when a peer is added or on config reloads the output ruleset is

ldapd adjust fatal message

2023-03-01 Thread Claudio Jeker
I had an issue with some certs and noticed that fatal() is used where errno has no meaning. This message should use fatalx(). OK? -- :wq Claudio Index: ldape.c === RCS file: /cvs/src/usr.sbin/ldapd/ldape.c,v retrieving revision

bgpd, improve RFC9234 support

2023-02-28 Thread Claudio Jeker
When I implemented RFC9234 support I was a bit to conservative and only enabled the loop detection if the capability was enabled. This is how every other capability works but RFC9234 is special. On top of this with the addition of ASPA support the way BGP roles are handled changed and the code

bgpd rtr support for ASPA

2023-02-24 Thread Claudio Jeker
For those people who enjoy pain here some code that allows bgpd to load ASPA records from a very current StayRTR cache. This implements mostly what draft-ietf-sidrops-8210bis-10 specifies. Now the version negotiation is a hot mess and the result is not pretty. In rtr.c most change is because I

Re: rpki-client: refactor parse_load_crl_from_mft()

2023-02-21 Thread Claudio Jeker
On Tue, Feb 21, 2023 at 11:10:33AM +0100, Theo Buehler wrote: > > Why did you rename *crl to *res? For me res is normally more like an > > integer result. I would prefer if you keep that as crl. > > > > Still OK claudio@ > > I would prefer to keep the refactor/cleanup separate from the behavior

Re: rpki-client: refactor parse_load_crl_from_mft()

2023-02-21 Thread Claudio Jeker
On Sun, Feb 19, 2023 at 10:36:28AM +, Job Snijders wrote: > Hi, > > I wasn't entirely happy about how parse_load_crl_from_mft() behaved and > refactored the function. > > The good: if the MFT at hand was located in DIR_TEMP and no matching CRL > could be found in DIR_TEMP, it would

Re: rpki-client: disallow trailing garbage in signed objects

2023-02-21 Thread Claudio Jeker
On Tue, Feb 21, 2023 at 03:07:00AM +0100, Theo Buehler wrote: > By design of d2i, it's the caller's responsibility to check a DER object > has been fully consumed. We read files from the disk, check hashes, > parse and validate the DER we encounter, but we do not make sure that > nothing follows

unlock utrace(2) syscall

2023-02-15 Thread Claudio Jeker
The following diff should allow most of utrace to run without kernel lock. It makes utrace() less expensive if ktrace is not used. -- :wq Claudio Index: kern/kern_ktrace.c === RCS file: /cvs/src/sys/kern/kern_ktrace.c,v retrieving

bgpd better startup behaviour

2023-02-14 Thread Claudio Jeker
bgpd does not really synchronize the start of sessions with the config reload of the RDE. This is fine but there is one gotcha. When loading big configs including RTR tables the delay between the SE finishing the config reload (RECONF_DONE) and the RDE finally getting RECONF_DONE is so long that

route(8) allow route monitor -mpls

2023-02-14 Thread Claudio Jeker
Currently route monitor only accepts -inet and -inet6 as address family but -mpls is also a valid option. It is the 3 routing tables we support. OK? -- :wq Claudio Index: route.c === RCS file: /cvs/src/sbin/route/route.c,v

Re: bgpd adjust rde_generates_updates arguments

2023-02-13 Thread Claudio Jeker
On Mon, Feb 13, 2023 at 04:20:00PM +0100, Theo Buehler wrote: > On Mon, Feb 13, 2023 at 02:33:05PM +0100, Claudio Jeker wrote: > > Instead of passing the rib and new and old best prefix just pass the > > rib_entry to rde_generate_updates(). This simplifies a few things down >

bgpd adjust rde_generates_updates arguments

2023-02-13 Thread Claudio Jeker
Instead of passing the rib and new and old best prefix just pass the rib_entry to rde_generate_updates(). This simplifies a few things down that rabbit hole. This is also a step towards decoupling prefix_evaluate() and the Loc-RIB from rde_generate_updates() and the Adj-RIB-Out processing. Since

Re: bgpd refactor common update code

2023-02-11 Thread Claudio Jeker
On Fri, Feb 10, 2023 at 04:28:08PM +0100, Theo Buehler wrote: > On Fri, Feb 10, 2023 at 01:05:17PM +0100, Claudio Jeker wrote: > > There are three functions used to update the Adj-RIB-Out of a peer > > depending of the mode of the peer: > > up_generate_updates()

bgpd refactor common update code

2023-02-10 Thread Claudio Jeker
There are three functions used to update the Adj-RIB-Out of a peer depending of the mode of the peer: up_generate_updates(), up_generate_addpath() and up_generate_addpath_all() There is a lot of similar code in there that makes the code look more complicated then it needs to. I added a helper

bgpd reduce size of internal ctl message

2023-02-09 Thread Claudio Jeker
In IMSG_CTL_SHOW_NEIGHBOR a struct peer is sent from the SE to the RDE to fill out 10 values. This is a waste of IO, struct peer is over 1000 bytes large. Instead just pass the peerid to the RDE, let the rde send back a stats object and have the control code do the merge. Introduce struct

Re: Unlock select(2) and pselect(2)

2023-02-08 Thread Claudio Jeker
On Wed, Feb 08, 2023 at 12:40:50PM +0100, Mark Kettenis wrote: > > Date: Wed, 8 Feb 2023 14:17:14 +0300 > > From: Vitaliy Makkoveev > > > > On Tue, Feb 07, 2023 at 05:42:40PM +0300, Vitaliy Makkoveev wrote: > > > > > > > > Otherwise, if you are concerning about serialized `p_sigmask' and > > >

Re: Unlock select(2) and pselect(2)

2023-02-07 Thread Claudio Jeker
On Mon, Feb 06, 2023 at 08:28:38PM +0300, Vitaliy Makkoveev wrote: > On Mon, Feb 06, 2023 at 11:01:00AM +0100, Claudio Jeker wrote: > > On Sat, Feb 04, 2023 at 01:24:58AM +0300, Vitaliy Makkoveev wrote: > > > Hi, > > > > > > kevent(2) system call is ulocke

Re: Unlock select(2) and pselect(2)

2023-02-06 Thread Claudio Jeker
On Sat, Feb 04, 2023 at 01:24:58AM +0300, Vitaliy Makkoveev wrote: > Hi, > > kevent(2) system call is ulocked more than year ago. Since select(2) > and pselect(2) are kqueue(2)/kevent(2) wrappers, it makes sense to > unlock them too. select(2) does the temporary kernel event queue >

vlan(4) use same logic for setting vlan tag

2023-02-02 Thread Claudio Jeker
In vlan_transmit the IFCAP_VLAN_HWTAGGING cases uses sc->sc_tag + (prio << EVL_PRIO_BITS) while the non IFCAP_VLAN_HWTAGGING cases uses sc->sc_tag | (prio << EVL_PRIO_BITS) Lets use the same logic in both cases. IMO using '|' is more correct than '+' so switch to that. -- :wq Claudio Index:

fix vlan tagging in em(4) on sparc64

2023-02-02 Thread Claudio Jeker
My newer sparc64 boxes come with Intel 82576 rev 0x01 em(4) interfaces. There is a bug in the HW_VLAN_TAGGING support that does a double big to little endian change of the vlan tag and so the outgoing packets vlan tag is all wrong. The below diff fixes this for me on sparc64, on little endian

Re: bgpd: improve RTR error handling

2023-01-31 Thread Claudio Jeker
On Tue, Jan 31, 2023 at 12:13:00PM +, Job Snijders wrote: > When the RTR's Session ID changes (for example when the RTR server is > restarted), bgpd would incorreectly branch into the "received %s: bad > msg len:" path. > > The length fields in the RTR PDU error messages are 32-bits, so we >

Re: bgpd adjust ext-community match code

2023-01-30 Thread Claudio Jeker
On Mon, Jan 30, 2023 at 05:37:25PM +0100, Theo Buehler wrote: > On Mon, Jan 30, 2023 at 03:29:49PM +0100, Claudio Jeker wrote: > > Extended communities are annoying, especially the ASnum encodings are a > > problem since the same extended community can be encoded in more t

bgpd adjust ext-community match code

2023-01-30 Thread Claudio Jeker
Extended communities are annoying, especially the ASnum encodings are a problem since the same extended community can be encoded in more than one way. This results in strange behaviour when used with local-as and/or neighbor-as. This diff changes the match function for any community with masks

Re: bgpd: remove ASDOT support

2023-01-30 Thread Claudio Jeker
On Sun, Jan 29, 2023 at 02:02:08PM +, Job Snijders wrote: > ASDOT started out as sort of a joke, but unfortunately gained some > popularity in the 2010s with the rise of 4-byte ASNs and some people > thinking "cute, I can write my longish number in a shorter exotic > notation". > > Then, many

bgpd adjust ASPA validation for non-transparent RS

2023-01-25 Thread Claudio Jeker
This diff is a result of a longer discussion with Sriram from NIST about ASPA validation behaviour on route-servers and especially non-transparent RS. Handling transparent route-servers (which is the default) requires no special handling in the validation logic. The route-server AS will never

bgpd final bits for ASPA support

2023-01-24 Thread Claudio Jeker
Here is hopefully the last pieces to finish ASAP support. This adds filter support. It is similar to origin validation and called AVS (ASPA validation state). Only difference is that not-found is called unknown in AVS. The diff also adds `bgpctl show rib avs invalid` support. ~> bgpctl show rib

adjust bgpd aspa-set format

2023-01-20 Thread Claudio Jeker
This diff removes the extra "allow" from the aspa-set provider-set element spec. The allow is not needed and confuses more than it helps. This change adjusts the parser, printconf, rpki-client and the regress tests. Job and I decided that the filters will use avs (ASPA validation state) as

Re: bgpd validate ASPATH with ASPA

2023-01-20 Thread Claudio Jeker
On Fri, Jan 20, 2023 at 12:21:14PM +0100, Claudio Jeker wrote: > This diff adds the reload logic and rewrites larger parts of what was > already there to have ASPA validation in the RDE. > > The main reason this diff is so large is that the ASPA state cache on > struct rde_aspath

bgpd validate ASPATH with ASPA

2023-01-20 Thread Claudio Jeker
This diff adds the reload logic and rewrites larger parts of what was already there to have ASPA validation in the RDE. The main reason this diff is so large is that the ASPA state cache on struct rde_aspath needs to be afi/aid and role independent. So I changed the aspa functions to be role and

Re: rpki-client: require version 4 UUIDs in RRDP session IDs

2023-01-18 Thread Claudio Jeker
On Wed, Jan 18, 2023 at 07:09:56PM +0100, Theo Buehler wrote: > On Wed, Jan 18, 2023 at 06:01:46PM +, Job Snijders wrote: > > All RRDP servers in the field now issue session IDs using the correct > > UUID version & type. > > Thanks for taking care of this. Indeed. > > OK? > > ok OK > >

Re: bgpd, use vstate from filterstate for update functions

2023-01-18 Thread Claudio Jeker
On Wed, Jan 18, 2023 at 05:53:10PM +0100, Theo Buehler wrote: > On Wed, Jan 18, 2023 at 05:37:37PM +0100, Claudio Jeker wrote: > > On Wed, Jan 18, 2023 at 05:18:58PM +0100, Theo Buehler wrote: > > > On Wed, Jan 18, 2023 at 02:46:19PM +0100, Claudio Jeker wrote: > > &

Re: bgpd, use vstate from filterstate for update functions

2023-01-18 Thread Claudio Jeker
On Wed, Jan 18, 2023 at 05:18:58PM +0100, Theo Buehler wrote: > On Wed, Jan 18, 2023 at 02:46:19PM +0100, Claudio Jeker wrote: > > This is the next step in vstate cleanup. > > Since the vstate is now part of struct filterstate use that information > > instead of passi

bgpd, use vstate from filterstate for update functions

2023-01-18 Thread Claudio Jeker
This is the next step in vstate cleanup. Since the vstate is now part of struct filterstate use that information instead of passing an explicit vstate to the various update functions. -- :wq Claudio Index: rde.c === RCS file:

bgpd, small optimisation

2023-01-18 Thread Claudio Jeker
In the RDE the poll loop needs to know if any additional work is pending. This is done calling various functions and if anyone has pending work the timeout is reduced to 0. Now some of the functions will more often trigger than others. So it is best to order them accordingly. Check for incoming

Re: bgpd load ASPA table into RDE

2023-01-17 Thread Claudio Jeker
On Tue, Jan 17, 2023 at 04:48:06PM +0100, Theo Buehler wrote: > On Tue, Jan 17, 2023 at 03:11:26PM +0100, Claudio Jeker wrote: > > This diff adds all the plumbing to push the ASPA table from the RTR > > process into the RDE. It is still missing important bits but the table > &g

bgpd load ASPA table into RDE

2023-01-17 Thread Claudio Jeker
This diff adds all the plumbing to push the ASPA table from the RTR process into the RDE. It is still missing important bits but the table itself should load and `bgpctl show sets` will show what was loaded. After that the reload logic needs to be added and the filters need to be extended to

rpki-client manpage diff

2023-01-17 Thread Claudio Jeker
Since a few days rpki-client will not only output a roa-set but also include an aspa-set in the output file. I don't think we need to overcomplicate this and explain that the output has no duplicates and that it is a roa-set and aspa-set. Comments -- :wq Claudio Index: rpki-client.8

bgpd rde_filterstate_prep refactor

2023-01-11 Thread Claudio Jeker
Introduce rde_filterstate_init() and rde_filterstate_copy() for the cases where either the filterstate needs to be initalized or copied from an other filterstate. Also switch rde_filterstate_prep() to take a struct prefix as argument since this is the case for all other call sites. I think the

bgpd: include validation state in struct filterstate

2023-01-11 Thread Claudio Jeker
This diff does actually 2 things. 1) it adds the validation state to the filterstate struct and with that removes it from rde_filter(). As a next step it can also be removed from prefix_update() and friends. 2) rename prefix_vstate() to prefix_roa_vstate() since it returns the roa validation

bgpd aspa validation function

2023-01-09 Thread Claudio Jeker
= RCS file: usr.sbin/bgpd/rde_aspa.c diff -N usr.sbin/bgpd/rde_aspa.c --- /dev/null 1 Jan 1970 00:00:00 - +++ usr.sbin/bgpd/rde_aspa.c22 Dec 2022 13:49:10 - @@ -0,0 +1,442 @@ +/* $OpenBSD$ */ + +/* + * Copyright (c) 2022 Claudio Jeker + * + * Permission to use, co

rpki-client and unknown file types

2023-01-06 Thread Claudio Jeker
Do not fatal out when an unknown filetype shows up. Also change the message sent from parser/filemode process to main from type::file::repoid to type::repoid::file since that simplifies the code a fair amount. -- :wq Claudio Index: filemode.c

Re: bgpd vs gcc4

2023-01-05 Thread Claudio Jeker
On Thu, Jan 05, 2023 at 02:18:47PM +0100, David Demelier wrote: > On Thu, 2023-01-05 at 13:59 +0100, Claudio Jeker wrote: > > On Thu, Jan 05, 2023 at 11:09:57AM +0100, Theo Buehler wrote: > > > On Thu, Jan 05, 2023 at 11:03:04AM +0100, Claudio Jeker wrote: > > > > gc

Re: bgpd vs gcc4

2023-01-05 Thread Claudio Jeker
On Thu, Jan 05, 2023 at 06:01:37AM -0700, Theo de Raadt wrote: > Florian Obser wrote: > > > On 2023-01-05 11:09 +01, Theo Buehler wrote: > > > On Thu, Jan 05, 2023 at 11:03:04AM +0100, Claudio Jeker wrote: > > >> gcc4 does not really support C99 inita

Re: bgpd vs gcc4

2023-01-05 Thread Claudio Jeker
On Thu, Jan 05, 2023 at 11:09:57AM +0100, Theo Buehler wrote: > On Thu, Jan 05, 2023 at 11:03:04AM +0100, Claudio Jeker wrote: > > gcc4 does not really support C99 initalizers. It works most of the time > > but fails for more complex structs. Just fall back to memset() here. > &

bgpd vs gcc4

2023-01-05 Thread Claudio Jeker
gcc4 does not really support C99 initalizers. It works most of the time but fails for more complex structs. Just fall back to memset() here. -- :wq Claudio Index: kroute.c === RCS file: /cvs/src/usr.sbin/bgpd/kroute.c,v retrieving

bgpd introduce session role for ASPA and open policy

2023-01-04 Thread Claudio Jeker
bgpd already supports Open Policy (RFC 9234) and the role of the router is set as part of the `announce policy` config. Now ASPA also needs the role so it makes sense to promote setting the role in the config. I also switched the role to an enum mainly because I want 0 to be the default "NONE"

bgpd: refining role capability code

2022-12-27 Thread Claudio Jeker
The role capability only works on ebgp sessions. It makes no sense on ibgp sessions and the RFC 9234 does not define any behaviour for that. I decided to: - Exclude the role capability for ibgp sessions when sending an OPEN - Warn when a role capability is received on an iBGP session - Make

Re: [patch] add show.c style flag descriptions to route(8)

2022-12-22 Thread Claudio Jeker
On Thu, Dec 22, 2022 at 08:02:54PM +, Jason McIntyre wrote: > On Thu, Dec 22, 2022 at 11:49:09AM -0800, Philip Guenther wrote: > > On Thu, Dec 22, 2022 at 11:33 AM Jason McIntyre wrote: > > ... > > > > > i have to say, i'm getting nowhere with this SYNOPSIS: > > > > > > netstat -r

Re: [patch] add show.c style flag descriptions to route(8)

2022-12-22 Thread Claudio Jeker
On Thu, Dec 22, 2022 at 05:58:47PM +, Jason McIntyre wrote: > On Thu, Dec 22, 2022 at 06:21:08PM +0100, Claudio Jeker wrote: > > On Thu, Dec 22, 2022 at 05:08:15PM +, Jason McIntyre wrote: > > > On Thu, Dec 22, 2022 at 07:32:18AM +, Jason McIntyre wrote: > >

Re: [patch] add show.c style flag descriptions to route(8)

2022-12-22 Thread Claudio Jeker
On Thu, Dec 22, 2022 at 05:08:15PM +, Jason McIntyre wrote: > On Thu, Dec 22, 2022 at 07:32:18AM +, Jason McIntyre wrote: > > > > next step is to examine Xr. will get round to that when i can. > > > > so i looked at where we are using netstat. a lot of the references still > make sense.

Re: [patch] add show.c style flag descriptions to route(8)

2022-12-22 Thread Claudio Jeker
On Wed, Dec 21, 2022 at 10:21:16AM -0700, Theo de Raadt wrote: > Claudio Jeker wrote: > > > In the old world only netstat could show the routing table. I think this > > is still the case in FreeBSD for example. We added route show at some > > point but the documentatio

Re: [patch] add show.c style flag descriptions to route(8)

2022-12-21 Thread Claudio Jeker
On Wed, Dec 21, 2022 at 04:48:38PM +, Jason McIntyre wrote: > On Wed, Dec 21, 2022 at 10:43:18AM -0500, Paul R. Tagliamonte wrote: > > On Tue, Dec 20, 2022 at 8:27 PM Paul R. Tagliamonte > > wrote: > > > > > > Heyya tech@, > > > > > > Please keep me on cc, I'm not subscribed > > > > Please

Re: pvbus: pass M_ZERO properly

2022-12-21 Thread Claudio Jeker
On Tue, Dec 13, 2022 at 12:33:03AM +0100, Michael Knudsen wrote: > We can detect this class of error by redefining the flags to > use the high bits instead of the low ones. This way the malloc() > KMEMSTAT value check triggers because 0x1000 is greater than > the maximum type value. > > I

Re: netcat: bump BUFSIZE to 64k?

2022-12-18 Thread Claudio Jeker
On Sun, Dec 18, 2022 at 05:53:25PM +0100, Marco Pfatschbacher wrote: > > On Sun, Dec 18, 2022 at 02:00:24PM +0100, Theo Buehler wrote: > > This is the remaining bit of mpf's recent netcat diff. The commit log > > shows that it was bumped to 64k in the past, but that was promptly > > reverted due

Re: acme-client: use timegm() instead of mktime()

2022-12-15 Thread Claudio Jeker
On Thu, Dec 15, 2022 at 06:16:11PM +0100, Theo Buehler wrote: > This should probably been part of my last diff, but I noticed it only > on commit... acme-client contains the same mistake as rpki-client had: > all times in certificates are expressed in GMT, so using the TZ dependent > output of

Re: rpki-client much improved stats and openmetric support

2022-12-14 Thread Claudio Jeker
On Wed, Dec 14, 2022 at 06:40:19PM +0100, Claudio Jeker wrote: > On Wed, Dec 14, 2022 at 05:54:54PM +0100, Theo Buehler wrote: > > On Wed, Dec 14, 2022 at 12:14:55PM +0100, Claudio Jeker wrote: > > > This diff adds per repository statistics, tracks a few more bits like how

Re: rpki-client much improved stats and openmetric support

2022-12-14 Thread Claudio Jeker
On Wed, Dec 14, 2022 at 05:54:54PM +0100, Theo Buehler wrote: > On Wed, Dec 14, 2022 at 12:14:55PM +0100, Claudio Jeker wrote: > > This diff adds per repository statistics, tracks a few more bits like how > > long it took to sync a repo and finally adds a new openmetrics output.

bgpd: no need to check capa.mp for each prefix

2022-12-14 Thread Claudio Jeker
>From my ASPA tree. In rde_update_dispatch() the MP capability check for IPv4 is done for every prefix again instead of once for withdraws and once for updates. In the real MP case this is not an issue since the code does not loop on that level. Move the extra check into its own if block. This

bgpd: inline a few functions for convenience

2022-12-14 Thread Claudio Jeker
This helps me in regress for the new ASAP unittest. I think making these accessors static inline makes sense here. -- :wq Claudio Index: rde.h === RCS file: /cvs/src/usr.sbin/bgpd/rde.h,v retrieving revision 1.273 diff -u -p

rpki-client much improved stats and openmetric support

2022-12-14 Thread Claudio Jeker
uniqs); + printf("VAP Entries: %u (%u unique)\n", stats.repo_stats.vaps, + stats.repo_stats.vaps_uniqs); /* Memory cleanup. */ repo_free(); @@ -1380,7 +1422,7 @@ main(int argc, char *argv[]) usage: fprintf(stderr, - "usage: rpki-client

rpki-client: small io optimization

2022-12-14 Thread Claudio Jeker
rpki-client IO buffers start with a small header (the size of the full message) followed by the payload. io_buf_read() currently does this in two steps. Because of this simple messages require two calls through the event loop and poll(2) for one message. By retrying the read after parsing the

rpki-client use CLOCK_MONOTONIC for runtime calculation

2022-12-14 Thread Claudio Jeker
Use clock_gettime(CLOCK_MONOTONIC) to calculate the runtime of rpki-client. While there switch all timevals in the stats struct to timespecs in preparation for openmetric support. I also resorted the headers and added the missing time headers. -- :wq Claudio Index: extern.h

skeleton mwx(4) - MediaTek MT7921 driver

2022-12-09 Thread Claudio Jeker
i/drm/files.drm" Index: if_mwx.c === RCS file: if_mwx.c diff -N if_mwx.c --- /dev/null 1 Jan 1970 00:00:00 - +++ if_mwx.c9 Dec 2022 17:03:39 - @@ -0,0 +1,3652 @@ +/* + * Copyright (c) 2022 Claudio Jeker + * Copyrig

bgpctl switch ometric to timespec

2022-12-09 Thread Claudio Jeker
cheloha@ switched the bgpctl code to use struct timespec and a monotonic clock. Adjust the ometric code to use a timespec internally so that there is no need to convert from timespec to timeval. -- :wq Claudio Index: ometric.c ===

Re: bgpctl stricter openmetric support

2022-12-06 Thread Claudio Jeker
On Tue, Dec 06, 2022 at 06:21:31PM +0100, Theo Buehler wrote: > On Tue, Dec 06, 2022 at 05:12:59PM +0100, Claudio Jeker wrote: > > When implementing this initially I thought that suffixes are merely a > > suggestion but now I realize that the spec is a more strict about them. &

bgpctl stricter openmetric support

2022-12-06 Thread Claudio Jeker
When implementing this initially I thought that suffixes are merely a suggestion but now I realize that the spec is a more strict about them. So introduce a list of reserved suffixes and bail out if a metric is added that uses such a suffix. Also fail if a metric name is reused. The output code

Re: bgpctl ometric support for timevals

2022-12-06 Thread Claudio Jeker
On Tue, Dec 06, 2022 at 12:21:11PM +0100, Theo Buehler wrote: > On Tue, Dec 06, 2022 at 12:01:57PM +0100, Claudio Jeker wrote: > > Printing timestamps is rather common thing in OpenMetrics so add a native > > function for this. The benefit is that it prints the timestamp as p

bgpctl ometric support for timevals

2022-12-06 Thread Claudio Jeker
Printing timestamps is rather common thing in OpenMetrics so add a native function for this. The benefit is that it prints the timestamp as pseudo float with higher precision than a regular float. Also adjust output of doubles to include enough significant digits to print the value in full

Re: bgpctl more ometric changes

2022-11-30 Thread Claudio Jeker
On Wed, Nov 30, 2022 at 07:48:35PM +0100, Theo Buehler wrote: > On Wed, Nov 30, 2022 at 07:05:25PM +0100, Claudio Jeker wrote: > > Change ometric_set_int_with_label() to ometric_set_int_with_labels(). > > In rpki-client I need to add more than one extra label and extending this >

bgpctl more ometric changes

2022-11-30 Thread Claudio Jeker
Change ometric_set_int_with_label() to ometric_set_int_with_labels(). In rpki-client I need to add more than one extra label and extending this interface seems to be the least ugly solution. I use C99 compound literals to make this less ugly and wrapped that magic into the macro EV(). IMO this is

Re: bgpctl ometric change

2022-11-30 Thread Claudio Jeker
On Wed, Nov 30, 2022 at 11:01:01AM +0100, Theo Buehler wrote: > On Wed, Nov 30, 2022 at 10:36:08AM +0100, Claudio Jeker wrote: > > I want to use the bgpctl ometric.c code in rpki-client to implement a > > metrics output. Currently ometric_output_all() just dumps to stdout bu

bgpctl ometric change

2022-11-30 Thread Claudio Jeker
I want to use the bgpctl ometric.c code in rpki-client to implement a metrics output. Currently ometric_output_all() just dumps to stdout but that does not work for rpki-client. Instead pass a FILE pointer to ometric_output_all() and also return -1 if an error occured. With this ometric usage

Re: Improve rpki-client warnings on .mft files

2022-11-29 Thread Claudio Jeker
On Tue, Nov 29, 2022 at 11:16:25AM +0100, Theo Buehler wrote: > On Tue, Nov 29, 2022 at 10:55:02AM +0100, Claudio Jeker wrote: > > On Mon, Nov 28, 2022 at 07:40:40PM +0100, Theo Buehler wrote: > > > On Mon, Nov 28, 2022 at 07:18:24PM +0100, Claudio Jeker wrote: > > > &

Re: Improve rpki-client warnings on .mft files

2022-11-29 Thread Claudio Jeker
On Mon, Nov 28, 2022 at 07:40:40PM +0100, Theo Buehler wrote: > On Mon, Nov 28, 2022 at 07:18:24PM +0100, Claudio Jeker wrote: > > On Mon, Nov 28, 2022 at 06:02:56PM +0100, Theo Buehler wrote: > > > On Mon, Nov 28, 2022 at 05:14:48PM +0100, Claudio Jeker wrote: > > > &

Re: Improve rpki-client warnings on .mft files

2022-11-28 Thread Claudio Jeker
On Mon, Nov 28, 2022 at 06:02:56PM +0100, Theo Buehler wrote: > On Mon, Nov 28, 2022 at 05:14:48PM +0100, Claudio Jeker wrote: > > On Mon, Nov 28, 2022 at 04:50:24PM +0100, Theo Buehler wrote: > > > On Mon, Nov 28, 2022 at 04:02:11PM +0100, Claudio Jeker wrote: > > &

Re: vmd: fix booting 7.2 ramdisks with >= 4G mem

2022-11-28 Thread Claudio Jeker
On Mon, Nov 28, 2022 at 11:32:32AM -0500, Dave Voutila wrote: > tech@ et. al., > > When kettenis@ introduced a newer version of BOOTARG_CONSDEV to add > additional params for the AMD Ryzen V1000 family, vmd's code that > configures bootargs to support direct booting a ramdisk kernel didn't >

Re: Improve rpki-client warnings on .mft files

2022-11-28 Thread Claudio Jeker
On Mon, Nov 28, 2022 at 04:50:24PM +0100, Theo Buehler wrote: > On Mon, Nov 28, 2022 at 04:02:11PM +0100, Claudio Jeker wrote: > > Since a long time any problem that caused rpki-client to not load a > > manifest resulted in the non helpful: > > rpki-client: > >

Improve rpki-client warnings on .mft files

2022-11-28 Thread Claudio Jeker
Since a long time any problem that caused rpki-client to not load a manifest resulted in the non helpful: rpki-client: rpki.afrinic.net/repository/member_repository/F36505B2/0569917622D711ED862FD6E0F1222468/0nALpPtwFyntPHjkS8xt-VQrqLw.mft: no valid mft available This hides in most cases the

Re: Let nd6_if{at,de}tach() be void and take an ifp argument

2022-11-24 Thread Claudio Jeker
On Wed, Nov 23, 2022 at 10:00:52PM +, Klemens Nanni wrote: > On Wed, Nov 23, 2022 at 10:47:53PM +0100, Claudio Jeker wrote: > > On Wed, Nov 23, 2022 at 02:54:08PM +, Klemens Nanni wrote: > > > void > > > -nd6_ifdetach(struct nd_ifinfo *nd) > >

<    1   2   3   4   5   6   7   8   9   10   >