Split (*pr_usrreq)() by multiple handlers
The current (*pr_usrreq)() is not useful for sockets locking work. We already have former PRU_ATTACH and PRU_DETACH splitted to the (*pr_attach)() and (*pr_detach)() handlers. We don't want to add new commands to (*pr_usrreq)() but introduce hew handlers to the 'protosw' like (*pr_lock)() and (*pr_unlock)() from bluhm's "arallel divert packet soreceive" diff. This introduces (*pr_bind), (*pr_listen), (*pr_accept), (*pr_connect), (*pr_connect2) and (*pr_disconnect) handlers for the corresponding PRU_ commands. I used these six ones mostly to expose, how this modification will be and collect opinions, do we like the direction I propose. The diff is mostly mechanical but huge, so I think these PRU_ commands should be enough. Anyway, if this direction will be accepted, I want to split the send/receive PRU_ commands separately. Also if the diff below is fine, I could commit it as is and make the next (*pr_usrreq)() modifications with separate diffs just to make them not very large. Please note, the `so_pcb' can't be NULL. We nullify it only on dead socket, which should not be passed to (*pr_userreq)(). The newly created socket has `so_pcb' set to NULL only until we pass it to (*pr_attach)() and we don't use sockets if attach failed. So I use KASSERT() instead of pcb != NULL check. Also, please keep in mind, this modification increases RAMDISK kernel size. For amd64 it bumped from 4417155 to 4418234 bytes. Index: sys/kern/uipc_proto.c === RCS file: /cvs/src/sys/kern/uipc_proto.c,v retrieving revision 1.22 diff -u -p -r1.22 uipc_proto.c --- sys/kern/uipc_proto.c 25 Feb 2022 23:51:03 - 1.22 +++ sys/kern/uipc_proto.c 7 Aug 2022 00:48:45 - @@ -46,31 +46,49 @@ const struct protosw unixsw[] = { { - .pr_type = SOCK_STREAM, - .pr_domain = , - .pr_protocol = PF_UNIX, - .pr_flags= PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS, - .pr_usrreq = uipc_usrreq, - .pr_attach = uipc_attach, - .pr_detach = uipc_detach, + .pr_type = SOCK_STREAM, + .pr_domain = , + .pr_protocol = PF_UNIX, + .pr_flags= PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS, + .pr_usrreq = uipc_usrreq, + .pr_attach = uipc_attach, + .pr_detach = uipc_detach, + .pr_bind = uipc_bind, + .pr_listen = uipc_listen, + .pr_accept = uipc_accept, + .pr_connect = uipc_connect, + .pr_connect2 = uipc_connect2, + .pr_disconnect = uipc_disconnect, }, { - .pr_type = SOCK_SEQPACKET, - .pr_domain = , - .pr_protocol = PF_UNIX, - .pr_flags= PR_ATOMIC|PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS, - .pr_usrreq = uipc_usrreq, - .pr_attach = uipc_attach, - .pr_detach = uipc_detach, + .pr_type = SOCK_SEQPACKET, + .pr_domain = , + .pr_protocol = PF_UNIX, + .pr_flags= PR_ATOMIC|PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS, + .pr_usrreq = uipc_usrreq, + .pr_attach = uipc_attach, + .pr_detach = uipc_detach, + .pr_bind = uipc_bind, + .pr_listen = uipc_listen, + .pr_accept = uipc_accept, + .pr_connect = uipc_connect, + .pr_connect2 = uipc_connect2, + .pr_disconnect = uipc_disconnect, }, { - .pr_type = SOCK_DGRAM, - .pr_domain = , - .pr_protocol = PF_UNIX, - .pr_flags= PR_ATOMIC|PR_ADDR|PR_RIGHTS, - .pr_usrreq = uipc_usrreq, - .pr_attach = uipc_attach, - .pr_detach = uipc_detach, + .pr_type = SOCK_DGRAM, + .pr_domain = , + .pr_protocol = PF_UNIX, + .pr_flags= PR_ATOMIC|PR_ADDR|PR_RIGHTS, + .pr_usrreq = uipc_usrreq, + .pr_attach = uipc_attach, + .pr_detach = uipc_detach, + .pr_bind = uipc_bind, + .pr_listen = uipc_listen, + .pr_accept = uipc_accept, + .pr_connect = uipc_connect, + .pr_connect2 = uipc_connect2, + .pr_disconnect = uipc_disconnect, } }; Index: sys/kern/uipc_socket.c === RCS file: /cvs/src/sys/kern/uipc_socket.c,v retrieving revision 1.280 diff -u -p -r1.280 uipc_socket.c --- sys/kern/uipc_socket.c 25 Jul 2022 07:28:22 - 1.280 +++ sys/kern/uipc_socket.c 7 Aug 2022 00:48:45 - @@ -214,7 +214,7 @@ sobind(struct socket *so, struct mbuf *n soassertlocked(so); - error = (*so->so_proto->pr_usrreq)(so, PRU_BIND, NULL, nam, NULL, p); + error = (*so->so_proto->pr_bind)(so, nam, p); return (error); } @@ -231,8 +231,7 @@ solisten(struct socket *so, int backlog) if (isspliced(so) || issplicedback(so)) return (EOPNOTSUPP); #endif /* SOCKET_SPLICE */ - error = (*so->so_proto->pr_usrreq)(so, PRU_LISTEN, NULL, NULL, NULL, - curproc); + error = (*so->so_proto->pr_listen)(so);
Re: parallel divert packet soreceive
On Sat, Aug 06, 2022 at 12:19:45AM +0200, Alexander Bluhm wrote: > On Sat, Aug 06, 2022 at 01:07:31AM +0300, Vitaliy Makkoveev wrote: > > I thought you will introduce something like below. This does the > > same but it has no heuristic under the hood. > > > > int > > sbwait_shared(struct socket *so, struct sockbuf *sb) > > { > > int error; > > > > if (so->so_proto->pr_unlock != NULL) > > (*so->so_proto->pr_unlock)(so); > > error = sbwait(so, sb); > > if (so->so_proto->pr_lock != NULL) > > (*so->so_proto->pr_lock)(so); > > > > return error; > > } > > sbwait() needs the mutex for sb->sb_flags |= SB_WAIT. > > sblock() also has to release the mutex while sleeping. > My sosleep_nsec() does that. > > Better ideas are welcome. Maybe some day sosleep_nsec() will always > have a shared net lock. > > bluhm Sorry for my yesterday idiotia. I'm not very happy with rw_status(9) magic under the sosleep_nsec() hood. But I don't think the `shared' arg for sbwait()/sblock() and sosleep_nsec() is better solution. We also could make something like _sbwait(..., shared) and use sbwait() and sbwait_shared() wrappers but I also don't think this is good enough. This diff is ok by me. Feel free to commit it with newly introduced NET_LOCK_SHARED() macros unless nobody has objections.
ipv6 fragment checksum
Hi, If interface drivers have enabled transmit offloading for the payload checksum , IPv6 fragments contain invalid checksum. For fragments the protocol checksum has to be calculated before fragmentation. Hardware cannot do this as it is too late. Do it earlier in software. ip_fragement() has such code, but in IPv6 it is missing. Note that in6_proto_cksum_out() has to be called before the next protocol is set to IPPROTO_FRAGMENT. ok? bluhm Index: netinet6/ip6_output.c === RCS file: /data/mirror/openbsd/cvs/src/sys/netinet6/ip6_output.c,v retrieving revision 1.269 diff -u -p -r1.269 ip6_output.c --- netinet6/ip6_output.c 29 Jun 2022 22:45:24 - 1.269 +++ netinet6/ip6_output.c 6 Aug 2022 22:21:04 - @@ -729,6 +729,12 @@ reroute: mtu = IPV6_MAXPACKET; /* +* If we are doing fragmentation, we can't defer TCP/UDP +* checksumming; compute the checksum and clear the flag. +*/ +in6_proto_cksum_out(m, NULL); + + /* * Change the next header field of the last header in the * unfragmentable part. */
Re: Consistency and cleanup in /share/misc/airport
On Sat, Aug 06, 2022 at 10:45:35PM +0200, Thomas Wager wrote: > On Sun, 2022-07-31 at 13:11 +0200, Thomas Wager wrote: > > On Sat, 2022-07-30 at 22:44 +0100, Stuart Henderson wrote: > > > Due to the rule for this file mentioned in the header, I think you'll > > > need to find a developer who has been to the added airports that have > > > replaced the metro areas, i.e. KCK MFW QDV QSF, either that or just > > > remove them. > > > > You are right. I'll give it a try: > > Anyone been on one of those? > > > > KCK:Kirensk, Russia > > MFW:Magaruque Island, Mozambique > > QDV:Comte. Rolim Adolfo Amaro, Jundiai, Brazil > > QSF:8 May 1945, Setif, Algeria > > > > If no response I'll submit a revised patch with them removed next > > weekend. > > > > Since nobody was on the airports above, here is a revised patch to remove > them: > Why are non-developers so obsessed with misc/airports? It would be way more productive to spend time on other parts of the source tree. > > Index: share/misc/airport > === > RCS file: /cvs/src/share/misc/airport,v > retrieving revision 1.84 > diff -u -p -u -p -r1.84 airport > --- share/misc/airport 31 Jul 2022 06:12:20 - 1.84 > +++ share/misc/airport 6 Aug 2022 20:36:58 - > @@ -470,7 +470,7 @@ DUD:Momona, Dunedin, New Zealand > DUJ:Jefferson County, Du Bois, Pennsylvania, USA > DUQ:Quamichan Lake, Duncan / Quam, British Columbia, Canada > DUR:King Shaka International, Durban, South Africa > -DUS:Dusseldorf, Germany > +DUS:Duesseldorf, Germany > DUT:Dutch Harbor, Alaska, USA > DVO:Mati, Davao, Philippines > DXB:Dubai, UAE > @@ -656,7 +656,7 @@ HAD:Halmstad, Halland, Sweden > HAH:Moroni (Hahaya), Comoros > HAJ:Langenhagen, Hanover, Germany > HAK:Haikou, China > -HAM:Fuhlsbuettel Hamburg, Germany > +HAM:Hamburg, Germany > HAN:Noibai, Hanoi, Vietnam > HAU:Karmoy, Haugesund, Norway > HAV:Jose Marti, Havana, Cuba > @@ -849,7 +849,6 @@ KBP:Kyiv Borispil International, Kyiv, U > KBR:Sultan Ismail Petra, Kota Bharu, Malaysia > KCG:Fisheries, Chignik, Alaska, USA > KCH:Kuching, Sarawak, Malaysia > -KCK:All Airports around Kansas City, Kansas, USA > KCL:Lagoon, Chignik, Alaska, USA > KDG:Kardjali, Bulgaria > KEF:Keflavik, Reykjavik, Iceland > @@ -940,7 +939,7 @@ LAW:Municipal, Lawton, Oklahoma, USA > LAX:Los Angeles International, California, USA > LBA:Leeds/Bradford, England, United Kingdom > LBB:Lubbock, Texas, USA > -LBC:Lubeck, Germany > +LBC:Luebeck, Germany > LBE:Westmoreland County, Latrobe, Pennsylvania, USA > LBF:North Platte Lee Bird Field, Nebraska, USA > LBL:Glenn L Martin Terminal, Liberal, Kansas, USA > @@ -1089,7 +1088,6 @@ MEY:Meghauli, Nepal > MFE:Mc Allen/Mission, Texas, USA > MFM:Macau > MFN:Milford Sound, New Zealand > -MFW:All Airports around Miami, Ft. Lauderdale and West Palm Beach, Florida, > USA > MGA:Managua, Nicaragua > MGM:Montgomery Municipal/Dannelly Field, Alabama, USA > MGQ:Mogadishu, Somalia > @@ -1413,11 +1411,9 @@ PZE:Penzance, England, United Kingdom > PZO:Puerto Ordaz, Venezuela > PZU:Port Sudan, Sudan > QBF:Vail/Eagle, Colorado, USA > -QDV:All Airports around Denver, Colorado, USA > QKB:Breckenridge, Colorado, USA > QLA:All Airports around Los Angeles, California, USA > QRO:Queretaro, Mexico > -QSF:All Airports around San Francisco, California, USA > QSY:Sydney, New South Wales, Australia > RAB:Lakunai, Rabaul, Papua New Guinea > RAJ:Rajkot, India > @@ -1673,7 +1669,6 @@ TGM:Tirgu Mures, Romania > TGU:Toncontin, Tegucigalpa, Honduras > TGZ:Llano San Juan, Tuxtla Gutierrez, Chiapas, Mexico > THE:Teresina, Piaui, Brazil > -THF:Tempelhof, Berlin, Germany > THN:Trollhattan, Sweden > THR:Mehrabad, Tehran, Iran > THU:Thule, Pituffik, Greenland > @@ -1852,7 +1847,7 @@ XBR:Brockville, Ontario, Canada > XCM:Chatham, Ontario, Canada > XDM:Drummondville, Quebec, Canada > XFD:Stratford, Ontario, Canada > -XFW:Flugplatz Hamburg-Finkenwerder, Hamburg, Germany > +XFW:Hamburg-Finkenwerder, Hamburg, Germany > XIY:Xianyang, Xi An, China > XLV:Niagara Falls, Ontario, Canada > XLZ:Truro, Nova Scotia, Canada > -- :wq Claudio
Re: Consistency and cleanup in /share/misc/airport
On Sun, 2022-07-31 at 13:11 +0200, Thomas Wager wrote: > On Sat, 2022-07-30 at 22:44 +0100, Stuart Henderson wrote: > > Due to the rule for this file mentioned in the header, I think you'll > > need to find a developer who has been to the added airports that have > > replaced the metro areas, i.e. KCK MFW QDV QSF, either that or just > > remove them. > > You are right. I'll give it a try: > Anyone been on one of those? > > KCK:Kirensk, Russia > MFW:Magaruque Island, Mozambique > QDV:Comte. Rolim Adolfo Amaro, Jundiai, Brazil > QSF:8 May 1945, Setif, Algeria > > If no response I'll submit a revised patch with them removed next > weekend. > Since nobody was on the airports above, here is a revised patch to remove them: Index: share/misc/airport === RCS file: /cvs/src/share/misc/airport,v retrieving revision 1.84 diff -u -p -u -p -r1.84 airport --- share/misc/airport 31 Jul 2022 06:12:20 - 1.84 +++ share/misc/airport 6 Aug 2022 20:36:58 - @@ -470,7 +470,7 @@ DUD:Momona, Dunedin, New Zealand DUJ:Jefferson County, Du Bois, Pennsylvania, USA DUQ:Quamichan Lake, Duncan / Quam, British Columbia, Canada DUR:King Shaka International, Durban, South Africa -DUS:Dusseldorf, Germany +DUS:Duesseldorf, Germany DUT:Dutch Harbor, Alaska, USA DVO:Mati, Davao, Philippines DXB:Dubai, UAE @@ -656,7 +656,7 @@ HAD:Halmstad, Halland, Sweden HAH:Moroni (Hahaya), Comoros HAJ:Langenhagen, Hanover, Germany HAK:Haikou, China -HAM:Fuhlsbuettel Hamburg, Germany +HAM:Hamburg, Germany HAN:Noibai, Hanoi, Vietnam HAU:Karmoy, Haugesund, Norway HAV:Jose Marti, Havana, Cuba @@ -849,7 +849,6 @@ KBP:Kyiv Borispil International, Kyiv, U KBR:Sultan Ismail Petra, Kota Bharu, Malaysia KCG:Fisheries, Chignik, Alaska, USA KCH:Kuching, Sarawak, Malaysia -KCK:All Airports around Kansas City, Kansas, USA KCL:Lagoon, Chignik, Alaska, USA KDG:Kardjali, Bulgaria KEF:Keflavik, Reykjavik, Iceland @@ -940,7 +939,7 @@ LAW:Municipal, Lawton, Oklahoma, USA LAX:Los Angeles International, California, USA LBA:Leeds/Bradford, England, United Kingdom LBB:Lubbock, Texas, USA -LBC:Lubeck, Germany +LBC:Luebeck, Germany LBE:Westmoreland County, Latrobe, Pennsylvania, USA LBF:North Platte Lee Bird Field, Nebraska, USA LBL:Glenn L Martin Terminal, Liberal, Kansas, USA @@ -1089,7 +1088,6 @@ MEY:Meghauli, Nepal MFE:Mc Allen/Mission, Texas, USA MFM:Macau MFN:Milford Sound, New Zealand -MFW:All Airports around Miami, Ft. Lauderdale and West Palm Beach, Florida, USA MGA:Managua, Nicaragua MGM:Montgomery Municipal/Dannelly Field, Alabama, USA MGQ:Mogadishu, Somalia @@ -1413,11 +1411,9 @@ PZE:Penzance, England, United Kingdom PZO:Puerto Ordaz, Venezuela PZU:Port Sudan, Sudan QBF:Vail/Eagle, Colorado, USA -QDV:All Airports around Denver, Colorado, USA QKB:Breckenridge, Colorado, USA QLA:All Airports around Los Angeles, California, USA QRO:Queretaro, Mexico -QSF:All Airports around San Francisco, California, USA QSY:Sydney, New South Wales, Australia RAB:Lakunai, Rabaul, Papua New Guinea RAJ:Rajkot, India @@ -1673,7 +1669,6 @@ TGM:Tirgu Mures, Romania TGU:Toncontin, Tegucigalpa, Honduras TGZ:Llano San Juan, Tuxtla Gutierrez, Chiapas, Mexico THE:Teresina, Piaui, Brazil -THF:Tempelhof, Berlin, Germany THN:Trollhattan, Sweden THR:Mehrabad, Tehran, Iran THU:Thule, Pituffik, Greenland @@ -1852,7 +1847,7 @@ XBR:Brockville, Ontario, Canada XCM:Chatham, Ontario, Canada XDM:Drummondville, Quebec, Canada XFD:Stratford, Ontario, Canada -XFW:Flugplatz Hamburg-Finkenwerder, Hamburg, Germany +XFW:Hamburg-Finkenwerder, Hamburg, Germany XIY:Xianyang, Xi An, China XLV:Niagara Falls, Ontario, Canada XLZ:Truro, Nova Scotia, Canada
Re: [PATCH] adds -t timeout to slowcgi
after the other thread on tech@ reminded me this is still pending, i took a look, tested and committed it with some minor tweaks. Thanks! Florian Obser wrote: > On 2022-06-10 04:27 -07, Alfred Morgan wrote: > > Index: slowcgi.8 > > === > > RCS file: /cvs/src/usr.sbin/slowcgi/slowcgi.8,v > > retrieving revision 1.16 > > diff -u -p -r1.16 slowcgi.8 > > --- slowcgi.8 2 Sep 2021 14:14:44 - 1.16 > > +++ slowcgi.8 10 Jun 2022 11:20:04 - > > @@ -76,6 +76,10 @@ effectively disables the chroot. i've mentioned the -t flag in the SYNOPSIS. > > .It Fl s Ar socket > > Create and bind to alternative local socket at > > .Ar socket . > > +.It Fl t Ar timeout > > +Closes the file descriptors after All other descriptions uses the imperative, also > > +.Ar timeout > > +seconds instead of the default 120 seconds. The CGI is left to run. new sentence, new line. I changed the description also to be (hopefully) clearer: what "file descriptors" will be closed? I went with -t timeout Terminate the request after timeout seconds instead of the default 120 seconds. The CGI script is left to run but its standard input, output and error will be closed. > > .It Fl U Ar user > > Change the owner of > > .Pa /var/www/run/slowcgi.sock > > Index: slowcgi.c > > === > > RCS file: /cvs/src/usr.sbin/slowcgi/slowcgi.c,v > > retrieving revision 1.62 > > diff -u -p -r1.62 slowcgi.c > > --- slowcgi.c 2 Sep 2021 14:14:44 - 1.62 > > +++ slowcgi.c 10 Jun 2022 11:20:04 - > > @@ -40,6 +40,7 @@ > > #include > > > > #define TIMEOUT_DEFAULT 120 > > +#define TIMEOUT_MAX 86400 * 365 > > #define SLOWCGI_USER"www" > > > > #define FCGI_CONTENT_SIZE 65535 > > @@ -252,7 +253,7 @@ usage(void) > > { > > extern char *__progname; > > fprintf(stderr, > > - "usage: %s [-dv] [-p path] [-s socket] [-U user] [-u user]\n", > > + "usage: %s [-dv] [-p path] [-s socket] [-t timeout] [-U user] [-u > > user]\n", line >80 chars, folded > > __progname); > > exit(1); > > } > > @@ -275,6 +276,7 @@ main(int argc, char *argv[]) > > const char *chrootpath = NULL; > > const char *sock_user = SLOWCGI_USER; > > const char *slowcgi_user = SLOWCGI_USER; > > + const char *errstr; > > > ^ space vs. tab > > With that fixed this is OK florian > > No need to resend the diff, I trust whoever ends up commiting this can > fix that up before commit. done :) > > /* > > * Ensure we have fds 0-2 open so that we have no fd overlaps > > @@ -293,7 +295,7 @@ main(int argc, char *argv[]) > > } > > } > > > > - while ((c = getopt(argc, argv, "dp:s:U:u:v")) != -1) { > > + while ((c = getopt(argc, argv, "dp:s:t:U:u:v")) != -1) { > > switch (c) { > > case 'd': > > debug++; > > @@ -304,6 +306,11 @@ main(int argc, char *argv[]) > > case 's': > > fcgi_socket = optarg; > > break; > > + case 't': > > + timeout.tv_sec = strtonum(optarg, 1, TIMEOUT_MAX, > > ); folded too > > + if (errstr != NULL) > > + errx(1, "timeout is %s: %s", errstr, optarg); > > + break; > > case 'U': > > sock_user = optarg; > > break; > > @@ -507,7 +514,12 @@ slowcgi_accept(int fd, short events, voi > > void > > slowcgi_timeout(int fd, short events, void *arg) > > { > > - cleanup_request((struct request*) arg); > > + struct request *req; > > + > > + req = arg; > > + > > + lwarnx("timeout child %i", req->script_pid); > > + cleanup_request(req); I skipped this hunk. (fwiw, I have some doubts on how slowcgi_timeout works, as it doesn't correctly shut down the requests from the FastGCI pov -- httpd still hangs a bit on slowcgi timeouts -- but this diff doesn't make it worse anyway so i went ahead and committed it.)
Re: Build llvm-cov in base
On Sat, Jul 30, 2022 at 12:19:54AM +0200, Frederic Cambus wrote: > Now that we have llvm-profdata in base, I would like to propose adding > llvm-cov as well. Just like llvm-profdata, it is fast to build and > only takes a few seconds on my amd64 machine. > > Having it in base would allow producing reports from coverage data > processed with llvm-profdata without having to install the devel/llvm > port. Ping. Any feedback on this? I haven't received any comments, neither publicly nor privately. Comments? OK? Any objection?
Framework/PixArt clickpad quirk
The Framework clickpad (a PixArt PIXA3854) announces that it has 4 buttons which defeats the normal heuristic of "2 or more buttons means it's a touchpad". When it's identified as a touchpad, right hand mouse clicks don't work (apart from that, I can't tell any difference between clickpad and touchpad in operation!). Linux/libinput also have a quirk for this device [1], although they simply disable the second button. The patch at the end of this mail adds a quirk that detects the PIXA3854 and forces it to be identified as a clickpad. To say that I am unfamiliar with these parts of the kernel is an understatement: this patch works for me, but I don't know whether it's the best, or even an acceptable, way of dealing with "right hand mouse clicks don't work" on this particular device! Laurie [1] https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/665 Index: hid/hidmt.c === RCS file: /cvs/src/sys/dev/hid/hidmt.c,v retrieving revision 1.12 diff -u -p -u -r1.12 hidmt.c --- hid/hidmt.c 9 Jul 2020 21:01:08 - 1.12 +++ hid/hidmt.c 6 Aug 2022 17:00:18 - @@ -150,7 +150,9 @@ hidmt_setup(struct device *self, struct } /* find whether this is a clickpad or not */ - if (hid_locate(desc, dlen, HID_USAGE2(HUP_DIGITIZERS, HUD_BUTTON_TYPE), + if (mt->sc_flags & HIDMT_REALLY_CLICKPAD) + mt->sc_clickpad = 1; + else if (hid_locate(desc, dlen, HID_USAGE2(HUP_DIGITIZERS, HUD_BUTTON_TYPE), mt->sc_rep_cap, hid_feature, , NULL)) { d = hid_get_udata(rep, capsize, ); mt->sc_clickpad = (d == 0); Index: hid/hidmtvar.h === RCS file: /cvs/src/sys/dev/hid/hidmtvar.h,v retrieving revision 1.8 diff -u -p -u -r1.8 hidmtvar.h --- hid/hidmtvar.h 8 Nov 2019 01:20:22 - 1.8 +++ hid/hidmtvar.h 6 Aug 2022 17:00:18 - @@ -37,6 +37,7 @@ struct hidmt { int sc_enabled; uint32_tsc_flags; #define HIDMT_REVY 0x0001 /* Y-axis is reversed ("natural" scrolling) */ +#define HIDMT_REALLY_CLICKPAD 0x0002 /* incorrectly identified as touchpad */ struct device *sc_device; int (*hidev_report_type_conv)(int); Index: i2c/imt.c === RCS file: /cvs/src/sys/dev/i2c/imt.c,v retrieving revision 1.5 diff -u -p -u -r1.5 imt.c --- i2c/imt.c 9 Jul 2020 21:01:56 - 1.5 +++ i2c/imt.c 6 Aug 2022 17:00:18 - @@ -159,6 +159,11 @@ imt_attach(struct device *parent, struct /* assume everything has "natural scrolling" where Y axis is reversed */ mt->sc_flags = HIDMT_REVY; + struct i2c_hid_desc *hid_desc = >sc_hdev.sc_parent->hid_desc; + /* The PixArt PIXA3854 clickpad offers 4 buttons, causing hidmt to + recognise it as a trackpad, not a clickpad. */ + if (hid_desc->wVendorID == 0x093A && hid_desc->wProductID == 0x274) + mt->sc_flags |= HIDMT_REALLY_CLICKPAD; mt->hidev_report_type_conv = ihidev_report_type_conv; mt->hidev_get_report = imt_hidev_get_report;
tcpbench maxhost
Hi, I tried to compile our tcpbench with a GNU/Linux gcc 8.3. There was a warning that snprinf() in saddr_ntop() might truncate the string. It is actually better to use NI_MAXHOST and NI_MAXSERV constants than some arbitrary 64 or 128 values. ok? bluhm Index: tcpbench.c === RCS file: /data/mirror/openbsd/cvs/src/usr.bin/tcpbench/tcpbench.c,v retrieving revision 1.65 diff -u -p -r1.65 tcpbench.c --- tcpbench.c 12 Jul 2021 15:09:20 - 1.65 +++ tcpbench.c 6 Aug 2022 14:00:11 - @@ -331,7 +331,6 @@ kfind_tcb(int sock) socklen_t melen, themlen; struct sockaddr_in *in4; struct sockaddr_in6 *in6; - char tmp1[64], tmp2[64]; int nretry; nretry = 10; @@ -345,6 +344,9 @@ kfind_tcb(int sock) if (me.ss_family != AF_INET && me.ss_family != AF_INET6) errx(1, "%s: unknown socket family", __func__); if (ptb->vflag >= 2) { + char tmp1[NI_MAXHOST + 2 + NI_MAXSERV]; + char tmp2[NI_MAXHOST + 2 + NI_MAXSERV]; + saddr_ntop((struct sockaddr *), me.ss_len, tmp1, sizeof(tmp1)); saddr_ntop((struct sockaddr *), them.ss_len, @@ -385,6 +387,9 @@ retry: continue; } if (ptb->vflag >= 2) { + char tmp1[NI_MAXHOST]; + char tmp2[NI_MAXHOST]; + inet_ntop(AF_INET, _laddr, tmp1, sizeof(tmp1)); inet_ntop(AF_INET, _faddr, @@ -408,6 +413,9 @@ retry: if ((inpcb.inp_flags & INP_IPV6) == 0) continue; if (ptb->vflag >= 2) { + char tmp1[NI_MAXHOST]; + char tmp2[NI_MAXHOST]; + inet_ntop(AF_INET6, _laddr6, tmp1, sizeof(tmp1)); inet_ntop(AF_INET6, _faddr6, @@ -780,7 +788,7 @@ tcp_server_accept(int fd, short event, v struct statctx *sc; struct sockaddr_storage ss; socklen_t sslen; - char tmp[128]; + char tmp[NI_MAXHOST + 2 + NI_MAXSERV]; sslen = sizeof(ss); @@ -838,7 +846,6 @@ tcp_server_accept(int fd, short event, v static void server_init(struct addrinfo *aitop) { - char tmp[128]; int sock, on = 1; struct addrinfo *ai; struct event *ev; @@ -847,6 +854,8 @@ server_init(struct addrinfo *aitop) lnfds = 0; for (ai = aitop; ai != NULL; ai = ai->ai_next) { + char tmp[NI_MAXHOST + 2 + NI_MAXSERV]; + saddr_ntop(ai->ai_addr, ai->ai_addrlen, tmp, sizeof(tmp)); if (ptb->vflag) fprintf(stderr, "Try to bind to %s\n", tmp); @@ -959,11 +968,12 @@ client_init(struct addrinfo *aitop, int { struct statctx *sc; struct addrinfo *ai; - char tmp[128]; int i, r, sock; for (i = 0; i < nconn; i++) { for (sock = -1, ai = aitop; ai != NULL; ai = ai->ai_next) { + char tmp[NI_MAXHOST + 2 + NI_MAXSERV]; + saddr_ntop(ai->ai_addr, ai->ai_addrlen, tmp, sizeof(tmp)); if (ptb->vflag && i == 0)
Re: slowcgi with configurable timeout
Hello, Fox Steward wrote: > Hi, > > requests to slowcgi by default have a timeout limit of 120 seconds. > In certain scenarios this may not be sufficient (e.g. slow internet > connection). > > I propose to add a flag "-t" for this value to be configurable. > In the following patch I set the upper limit to 900 seconds. this was already discussed on tech@ some time ago, see this thread "[PATCH] adds -t timeout to slowcgi": https://marc.info/?l=openbsd-tech=165476378330734=2 it even got an ok, but AFAICS it wasn't committed
move swblk_t from sys/types.h to sys/blist.h and use it in blist (was: change its type and us Re: patch: change swblk_t type and use it in blist)
On Sat, Aug 06 2022, Sebastien Marie wrote: > On Sat, Aug 06, 2022 at 02:19:31AM +0200, Jeremie Courreges-Anglas wrote: >> On Fri, Aug 05 2022, Sebastien Marie wrote: >> > Hi, >> > >> > When initially ported blist from DragonFlyBSD, we used custom type bsblk_t >> > and >> > bsbmp_t instead of the one used by DragonFlyBSD (swblk_t and u_swblk_t). >> > >> > The reason was swblk_t is already defined on OpenBSD, and was incompatible >> > with >> > blist (int32_t). It is defined, but not used (outside some regress file >> > which >> > seems to be not affected by type change). >> > >> > This diff changes the __swblk_t definition in sys/_types.h to be 'unsigned >> > long', and switch back blist to use swblk_t (and u_swblk_t, even if it >> > isn't >> > 'unsigned swblk_t'). >> > >> > It makes the diff with DragonFlyBSD more thin. I added a comment with the >> > git id >> > used for the initial port. >> > >> > I tested it on i386 and amd64 (kernel and userland). >> > >> > By changing bitmap type from 'u_long' to 'u_swblk_t' ('u_int64_t'), it >> > makes the >> > regress the same on 64 and 32bits archs (and it success on both). >> > >> > Comments or OK ? >> >> This seems fair, but maybe we should just zap the type from sys/types.h and >> define it only in sys/blist.h, as done in DragonflyBSD? > > Yes, it makes lot of sense. > > Updated diff below. > >> I'm building a release on amd64 with the type removed (also from >> regress). I don't expect fallout in ports (and I can take care of it if >> there is any). > > I also have a release building on i386. > > Thanks. As expected, make release passes on amd64, with the diff below which also includes the regress bits. Feel free to commit it (ok jca@) before your blist changes (which I won't review today, EBUSY). Index: sys/sys/_types.h === RCS file: /home/cvs/src/sys/sys/_types.h,v retrieving revision 1.9 diff -u -p -r1.9 _types.h --- sys/sys/_types.h22 Aug 2014 23:05:15 - 1.9 +++ sys/sys/_types.h6 Aug 2022 00:02:30 - @@ -60,7 +60,6 @@ typedef __uint8_t __sa_family_t; /* sock typedef__int32_t __segsz_t; /* segment size */ typedef__uint32_t __socklen_t;/* length type for network syscalls */ typedeflong__suseconds_t; /* microseconds (signed) */ -typedef__int32_t __swblk_t; /* swap offset */ typedef__int64_t __time_t; /* epoch time */ typedef__int32_t __timer_t; /* POSIX timer identifiers */ typedef__uint32_t __uid_t;/* user id */ Index: sys/sys/types.h === RCS file: /home/cvs/src/sys/sys/types.h,v retrieving revision 1.48 diff -u -p -r1.48 types.h --- sys/sys/types.h 9 Feb 2019 04:54:11 - 1.48 +++ sys/sys/types.h 6 Aug 2022 00:02:41 - @@ -144,7 +144,6 @@ typedef __mode_tmode_t; /* permissions typedef__nlink_t nlink_t;/* link count */ typedef__rlim_trlim_t; /* resource limit */ typedef__segsz_t segsz_t;/* segment size */ -typedef__swblk_t swblk_t;/* swap offset */ typedef__uid_t uid_t; /* user id */ typedef__useconds_tuseconds_t; /* microseconds */ typedef__suseconds_t suseconds_t;/* microseconds (signed) */ Index: regress/misc/c++abi/nm1.C === RCS file: /home/cvs/src/regress/misc/c++abi/nm1.C,v retrieving revision 1.2 diff -u -p -r1.2 nm1.C --- regress/misc/c++abi/nm1.C 7 Feb 2017 12:57:12 - 1.2 +++ regress/misc/c++abi/nm1.C 5 Aug 2022 23:58:59 - @@ -23,7 +23,6 @@ D(sa_family_t) D(segsz_t) D(socklen_t) D(suseconds_t) -D(swblk_t) D(uid_t) D(uint64_t) D(uint32_t) Index: regress/misc/c++abi/nm1.ref === RCS file: /home/cvs/src/regress/misc/c++abi/nm1.ref,v retrieving revision 1.3 diff -u -p -r1.3 nm1.ref --- regress/misc/c++abi/nm1.ref 29 Oct 2013 03:00:40 - 1.3 +++ regress/misc/c++abi/nm1.ref 5 Aug 2022 23:59:47 - @@ -18,7 +18,6 @@ sa_family_t(unsigned char) segsz_t(int) socklen_t(unsigned int) suseconds_t(long) -swblk_t(int) uid_t(unsigned int) uint64_t(unsigned long long) uint32_t(unsigned int) -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
bug: rm -rfv nonexistant will echo
rm -rfv nonexistent will echo "nonexistent" -alfred
Re: patch: change swblk_t type and use it in blist
On Sat, Aug 06, 2022 at 02:19:31AM +0200, Jeremie Courreges-Anglas wrote: > On Fri, Aug 05 2022, Sebastien Marie wrote: > > Hi, > > > > When initially ported blist from DragonFlyBSD, we used custom type bsblk_t > > and > > bsbmp_t instead of the one used by DragonFlyBSD (swblk_t and u_swblk_t). > > > > The reason was swblk_t is already defined on OpenBSD, and was incompatible > > with > > blist (int32_t). It is defined, but not used (outside some regress file > > which > > seems to be not affected by type change). > > > > This diff changes the __swblk_t definition in sys/_types.h to be 'unsigned > > long', and switch back blist to use swblk_t (and u_swblk_t, even if it > > isn't > > 'unsigned swblk_t'). > > > > It makes the diff with DragonFlyBSD more thin. I added a comment with the > > git id > > used for the initial port. > > > > I tested it on i386 and amd64 (kernel and userland). > > > > By changing bitmap type from 'u_long' to 'u_swblk_t' ('u_int64_t'), it > > makes the > > regress the same on 64 and 32bits archs (and it success on both). > > > > Comments or OK ? > > This seems fair, but maybe we should just zap the type from sys/types.h and > define it only in sys/blist.h, as done in DragonflyBSD? Yes, it makes lot of sense. Updated diff below. > I'm building a release on amd64 with the type removed (also from > regress). I don't expect fallout in ports (and I can take care of it if > there is any). I also have a release building on i386. Thanks. -- Sebastien Marie diff /home/semarie/repos/openbsd/src commit - 73f52ef7130cefbe5a8fe028eedaad0e54be7303 path + /home/semarie/repos/openbsd/src blob - 4cf6259417df583dadc5d63e7bb1753628eb8b50 file + sys/kern/subr_blist.c --- sys/kern/subr_blist.c +++ sys/kern/subr_blist.c @@ -1,4 +1,5 @@ /* $OpenBSD: subr_blist.c,v 1.1 2022/07/29 17:47:12 semarie Exp $ */ +/* DragonFlyBSD:7b80531f545c7d3c51c1660130c71d01f6bccbe0:/sys/kern/subr_blist.c */ /* * BLIST.C - Bitmap allocator/deallocator, using a radix tree with hinting * @@ -133,29 +134,29 @@ * static support functions */ -static bsblk_t blst_leaf_alloc(blmeta_t *scan, bsblk_t blkat, - bsblk_t blk, bsblk_t count); -static bsblk_t blst_meta_alloc(blmeta_t *scan, bsblk_t blkat, - bsblk_t blk, bsblk_t count, - bsblk_t radix, bsblk_t skip); -static void blst_leaf_free(blmeta_t *scan, bsblk_t relblk, bsblk_t count); -static void blst_meta_free(blmeta_t *scan, bsblk_t freeBlk, bsblk_t count, - bsblk_t radix, bsblk_t skip, - bsblk_t blk); -static bsblk_t blst_leaf_fill(blmeta_t *scan, bsblk_t blk, bsblk_t count); -static bsblk_t blst_meta_fill(blmeta_t *scan, bsblk_t fillBlk, bsblk_t count, - bsblk_t radix, bsblk_t skip, - bsblk_t blk); -static void blst_copy(blmeta_t *scan, bsblk_t blk, bsblk_t radix, - bsblk_t skip, blist_t dest, bsblk_t count); -static bsblk_t blst_radix_init(blmeta_t *scan, bsblk_t radix, - bsblk_t skip, bsblk_t count); -static int blst_radix_gapfind(blmeta_t *scan, bsblk_t blk, bsblk_t radix, bsblk_t skip, -int state, bsblk_t *maxbp, bsblk_t *maxep, bsblk_t *bp, bsblk_t *ep); +static swblk_t blst_leaf_alloc(blmeta_t *scan, swblk_t blkat, + swblk_t blk, swblk_t count); +static swblk_t blst_meta_alloc(blmeta_t *scan, swblk_t blkat, + swblk_t blk, swblk_t count, + swblk_t radix, swblk_t skip); +static void blst_leaf_free(blmeta_t *scan, swblk_t relblk, swblk_t count); +static void blst_meta_free(blmeta_t *scan, swblk_t freeBlk, swblk_t count, + swblk_t radix, swblk_t skip, + swblk_t blk); +static swblk_t blst_leaf_fill(blmeta_t *scan, swblk_t blk, swblk_t count); +static swblk_t blst_meta_fill(blmeta_t *scan, swblk_t fillBlk, swblk_t count, + swblk_t radix, swblk_t skip, + swblk_t blk); +static void blst_copy(blmeta_t *scan, swblk_t blk, swblk_t radix, + swblk_t skip, blist_t dest, swblk_t count); +static swblk_t blst_radix_init(blmeta_t *scan, swblk_t radix, + swblk_t skip, swblk_t count); +static int blst_radix_gapfind(blmeta_t *scan, swblk_t blk, swblk_t radix, swblk_t skip, +int state, swblk_t *maxbp, swblk_t *maxep, swblk_t *bp, swblk_t *ep); #if defined(BLIST_DEBUG) || defined(DDB) -static voidblst_radix_print(blmeta_t *scan, bsblk_t blk, - bsblk_t radix, bsblk_t skip, int tab); +static voidblst_radix_print(blmeta_t *scan, swblk_t blk, +