vmd(8): teach it to exec vm's after fork

2023-04-17 Thread Dave Voutila
tech@, vmd currently uses a fork-only approach to spawning new vm's, resulting in each vm having the same address space and inheriting some global state from the vmm process (like the list of running vm's). This diff introduces an execvp(2) call after fork, making the vm process re-exec. Things t

Re: bgpd: reverse output of flowspec_cmp

2023-04-17 Thread Theo Buehler
On Mon, Apr 17, 2023 at 06:56:53PM +0200, Claudio Jeker wrote: > I noticed that the order generated in an RB tree using flowspec_cmp() is > reversed. The problem is that for addresses preferred means smaller. > I think it is best to change the flowspec_cmp function to sort data so > that RB_FOREACH

mg: allow to change the tab width

2023-04-17 Thread Omar Polo
This makes the tab width customizable per-buffer. There's a new function called `set-tab-width' that changes the tab width for the current buffer or the default one for new buffers if called with a prefix argument (or from the startup file.) The default tab width is still 8 column if not changed

bgpd: reverse output of flowspec_cmp

2023-04-17 Thread Claudio Jeker
I noticed that the order generated in an RB tree using flowspec_cmp() is reversed. The problem is that for addresses preferred means smaller. I think it is best to change the flowspec_cmp function to sort data so that RB_FOREACH will print them most-preferred to least-preferred. I had not caught t

Re: Call sysctl_source() with shared netlock

2023-04-17 Thread Alexander Bluhm
On Mon, Apr 17, 2023 at 06:33:50PM +0300, Vitaliy Makkoveev wrote: > However, the renaming of `source' to `ar_source' diff is pretty small. > We use 'art_root' structure in regress/sys/net/rtable/delete and in > usr.bin/netstat/ but we don't touch `source'. OK bluhm@ > Index: sys/net/art.h >

Re: Call sysctl_source() with shared netlock

2023-04-17 Thread Alexander Bluhm
On Mon, Apr 17, 2023 at 04:32:13PM +0200, Alexander Bluhm wrote: > On Mon, Apr 17, 2023 at 02:36:57AM +0300, Vitaliy Makkoveev wrote: > > It seems rt_setsource() needs some attention, but sysctl_source() could > > be called with shared netlock just now. > > I think rtable_setsource() is not MP saf

Re: Call sysctl_source() with shared netlock

2023-04-17 Thread Vitaliy Makkoveev
On Mon, Apr 17, 2023 at 04:32:13PM +0200, Alexander Bluhm wrote: > On Mon, Apr 17, 2023 at 02:36:57AM +0300, Vitaliy Makkoveev wrote: > > It seems rt_setsource() needs some attention, but sysctl_source() could > > be called with shared netlock just now. > > I think rtable_setsource() is not MP saf

Re: Call sysctl_ifnames() with shared netlock

2023-04-17 Thread Vitaliy Makkoveev
On Mon, Apr 17, 2023 at 02:58:59PM +0200, Alexander Bluhm wrote: > On Mon, Apr 17, 2023 at 01:20:28AM +0300, Vitaliy Makkoveev wrote: > > It performs read-only access to netlock protected data. > > OK bluhm@ > > Could you somewhere document that ifnetlist is protected by netlock? > We use both k

Re: Call sysctl_dumpentry() with shared netlock

2023-04-17 Thread Alexander Bluhm
On Mon, Apr 17, 2023 at 02:16:14AM +0300, Vitaliy Makkoveev wrote: > Also performs read-only access to netlock protected data. rtable_getsource() needs kernel lock. But that problem does not get worse by this diff. OK bluhm@ > Index: sys/net/rtsock.c > ==

Re: Call sysctl_source() with shared netlock

2023-04-17 Thread Alexander Bluhm
On Mon, Apr 17, 2023 at 02:36:57AM +0300, Vitaliy Makkoveev wrote: > It seems rt_setsource() needs some attention, but sysctl_source() could > be called with shared netlock just now. I think rtable_setsource() is not MP safe. It is documented as [K] kernel lock. But that is not true and makes no

mg: fix buffer overflow in displaymatch()

2023-04-17 Thread Omar Polo
When the match for a character is not in the visible part of the window, mg shows a copy of that line in the echo area. To do so, it copies the line to a local buffer, so that tabs and control characters can be rendered properly, but doesn't check for overflow. NLINE (the size of `buf') is 256, s

Re: Call sysctl_iflist() with shared netlock

2023-04-17 Thread Alexander Bluhm
On Mon, Apr 17, 2023 at 01:22:07AM +0300, Vitaliy Makkoveev wrote: > As sysctl_ifnames(), it performs read-only access to netlock protected > data. OK bluhm@ > Index: sys/net/rtsock.c > === > RCS file: /cvs/src/sys/net/rtsock.c,v > r

Re: bgpctl parse numbers

2023-04-17 Thread Theo Buehler
On Mon, Apr 17, 2023 at 02:39:42PM +0200, Claudio Jeker wrote: > This does the same trick as with communities of matching both the keyword > and parsing the next argument in one go. Again a few helper tables go > away. Lovely. ok tb

Re: Call sysctl_ifnames() with shared netlock

2023-04-17 Thread Alexander Bluhm
On Mon, Apr 17, 2023 at 01:20:28AM +0300, Vitaliy Makkoveev wrote: > It performs read-only access to netlock protected data. OK bluhm@ Could you somewhere document that ifnetlist is protected by netlock? > Index: sys/net/rtsock.c >

Re: bgpctl show rib 192.0.2.1 detail

2023-04-17 Thread Theo Buehler
On Mon, Apr 17, 2023 at 02:30:40PM +0200, Claudio Jeker wrote: > Forgot this bit in the 'bgpctl show rib 192.0.2.1 detail' support I > commited this weekend. > > The problem is that parse_prefix() is entered with 'detail' as argument > and clears the previously set address. So be more careful and

bgpctl parse numbers

2023-04-17 Thread Claudio Jeker
This does the same trick as with communities of matching both the keyword and parsing the next argument in one go. Again a few helper tables go away. -- :wq Claudio Index: parser.c === RCS file: /cvs/src/usr.sbin/bgpctl/parser.c,v r

bgpctl show rib 192.0.2.1 detail

2023-04-17 Thread Claudio Jeker
Forgot this bit in the 'bgpctl show rib 192.0.2.1 detail' support I commited this weekend. The problem is that parse_prefix() is entered with 'detail' as argument and clears the previously set address. So be more careful and only modify the addr pointer if parse_prefix() and parse_addr() are succe

diff: www/faq/pf/carp.html

2023-04-17 Thread YASUOKA Masahiko
Hi, carpdemote is increased/decreased when the link state of the carpdev is down/up. This behavior is not related to net.inet.carp.preempt since "carpdemote" is introduced. But the faq still says the "net.inet.carp.preempt" variable enables it. I'd like to commit the diff. ok or any comment i

Re: bgpctl change parser for communities

2023-04-17 Thread Theo Buehler
On Mon, Apr 17, 2023 at 12:45:43PM +0200, Claudio Jeker wrote: > On Mon, Apr 17, 2023 at 12:12:47PM +0200, Theo Buehler wrote: > > On Mon, Apr 17, 2023 at 11:28:37AM +0200, Claudio Jeker wrote: > > > I want to extend the parser to support lists in a few places. > > > One of them is for communities.

Re: bgpctl change parser for communities

2023-04-17 Thread Claudio Jeker
On Mon, Apr 17, 2023 at 12:12:47PM +0200, Theo Buehler wrote: > On Mon, Apr 17, 2023 at 11:28:37AM +0200, Claudio Jeker wrote: > > I want to extend the parser to support lists in a few places. > > One of them is for communities. This is the first step towards this goal. > > The change uses the fact

Re: bgpctl change parser for communities

2023-04-17 Thread Theo Buehler
On Mon, Apr 17, 2023 at 11:28:37AM +0200, Claudio Jeker wrote: > I want to extend the parser to support lists in a few places. > One of them is for communities. This is the first step towards this goal. > The change uses the fact that match_token() has access to argc and argv > and changes the comm

mg: fix spacing in a few dobeep_msgs() calls

2023-04-17 Thread Omar Polo
as per subject, when dobeep_msgs() was introduced some places weren't converted correctly: it already adds a space between the two arguments, so no need to duplicate. Index: extend.c === RCS file: /cvs/src/usr.bin/mg/extend.c,v retrie

bgpctl change parser for communities

2023-04-17 Thread Claudio Jeker
I want to extend the parser to support lists in a few places. One of them is for communities. This is the first step towards this goal. The change uses the fact that match_token() has access to argc and argv and changes the community parsers to parse the next token for communities. As a nice side-e

Re: bgpd first bunch of flowspec code

2023-04-17 Thread Theo Buehler
On Thu, Apr 13, 2023 at 03:35:33PM +0200, Claudio Jeker wrote: > If you have better suggestions on how to work with such a blob I'm happy > to hear. I tried to keep the madness in one place and have a mostly sane > API on top. I see and understand that and you did that wrapping probably as nicely