Re: umb(4) doesn't need a custom network input function

2023-08-25 Thread Gerhard Roth
On Fri, 2023-08-25 at 20:40 +1000, David Gwynne wrote: > umb(4) is a hardware p2p driver, it just has ip coming in, so we can do > the same thing we do for the address family and input processing as > other p2p interfaces. > > the short packet check that umb_input does is already done by the ip >

Re: ober_scanf_elements() and empty sequences

2023-08-22 Thread Gerhard Roth
On Tue, 2023-08-22 at 13:27 +0200, Martijn van Duren wrote: > On Tue, 2023-08-22 at 10:16 +0000, Gerhard Roth wrote: > > On Tue, 2023-08-22 at 11:16 +0200, Martijn van Duren wrote: > > > On Mon, 2023-08-21 at 07:35 +, Gerhard Roth wrote: > > > > Hi Martijn, >

Re: ober_scanf_elements() and empty sequences

2023-08-22 Thread Gerhard Roth
On Tue, 2023-08-22 at 11:16 +0200, Martijn van Duren wrote: > On Mon, 2023-08-21 at 07:35 +0000, Gerhard Roth wrote: > > Hi Martijn, > > > > last November you fixed ber.c so that sequences won't generate > > an uninitialized subelement. > > > > This reve

ober_scanf_elements() and empty sequences

2023-08-21 Thread Gerhard Roth
Hi Martijn, last November you fixed ber.c so that sequences won't generate an uninitialized subelement. This revealed another bug in ober_scanf_elements(): it couldn't process sequences with an empty list of subelements. The following code failed in ober_scanf_elements(): struct

Fix dhcrelay6 on carp

2023-07-13 Thread Gerhard Roth
This patch fixes dhcrelay on carp. Without it, the AF_LINK entry (the only one containing the interface index and rdomain of the carp interface) of carp interfaces was ignored. When doing the IPV6_JOIN_GROUP, ip6_setmoptions() would see an zero interface index and picked an arbitrary,

iked processes are orphans

2023-06-28 Thread Gerhard Roth
Hi Tobi, a recent change to iked.c moved the call to daemon() behind proc_init(). Now iked forks all its children and afterwards daemonizes itself into background leaving the kids behind orphaned. The patch below restores the parent/child relationship. With it, the parent calls daemon() first.

Fix possible mem-leak in snmpd/usm.c

2023-05-08 Thread Gerhard Roth
Rev 1.25 introduced a mem-leak: Index: usr.sbin/snmpd/usm.c === RCS file: /cvs/src/usr.sbin/snmpd/usm.c,v retrieving revision 1.25 diff -u -p -r1.25 usm.c --- usr.sbin/snmpd/usm.c20 Dec 2022 20:01:25 - 1.25 +++

Re: DIOCGETRULE is slow for large rulesets (2/3)

2023-04-26 Thread Gerhard Roth
On Wed, 2023-04-26 at 13:47 +0200, Alexandr Nedvedicky wrote: > Hello, > > > On Wed, Apr 26, 2023 at 11:37:58AM +1000, David Gwynne wrote: > > >  fail: > > > -   if (flags & FWRITE) > > > -   rw_exit_write(_rw); > > > -   else > > > -   rw_exit_read(_rw); > > > +  

Re: DIOCGETRULE is slow for large rulesets (2/3)

2023-04-26 Thread Gerhard Roth
On Wed, 2023-04-26 at 19:42 +1000, David Gwynne wrote: > On Wed, Apr 26, 2023 at 07:48:18AM +0000, Gerhard Roth wrote: > > On Wed, 2023-04-26 at 00:39 +0200, Alexandr Nedvedicky wrote: > > > Hello, > > > > > > This is the second diff. It introduces a tra

Re: DIOCGETRULE is slow for large rulesets (2/3)

2023-04-26 Thread Gerhard Roth
On Wed, 2023-04-26 at 00:39 +0200, Alexandr Nedvedicky wrote: > Hello, > > This is the second diff. It introduces a transaction (pf_trans). > It's more or less diff with dead code. > > It's still worth to note those two chunks in this diff: > > @@ -1142,10 +1172,7 @@ pfioctl(dev_t dev, u_long

TLS 1.3 ClientHello and Windows 11

2023-03-28 Thread Gerhard Roth
I stumbled upon a problem that xfreerdp couldn't connect to Windows 11 servers with NLA and TLS 1.3. This can also be reproduced with # openssl -tls1_3 -connect :3389 Here openssl will fail with a "tlsv1 alert internal error" instead of blocking in "read R BLOCK". So I played around

Re: 7.2: snmp mibtree command broken

2022-12-20 Thread Gerhard Roth
On Tue, 2022-12-20 at 11:34 +0100, Martijn van Duren wrote: > On Tue, 2022-12-20 at 10:28 +0000, Gerhard Roth wrote: > > Hi Martijn, > > > > On Tue, 2022-12-20 at 11:10 +0100, Martijn van Duren wrote: > > > On Tue, 2022-12-20 at 10:21 +0100, Ma

Re: 7.2: snmp mibtree command broken

2022-12-20 Thread Gerhard Roth
Hi Martijn, On Tue, 2022-12-20 at 11:10 +0100, Martijn van Duren wrote: > On Tue, 2022-12-20 at 10:21 +0100, Matthias Pitzl wrote: > > Hi, > > > > Since the release of OpenBSD 7.2, snmp mibtree is broken: > > > root@host:~# snmp mibtree > > > snmp: No securityName specified > > > > Greetings, >

Possible segfault in iked

2022-05-28 Thread Gerhard Roth
Hi, since there's a 'sa_free(sa)' followed by a 'continue' a few lines down from the RB_FOREACH(), we must use RB_FOREACH_SAFE() instead. Gerhard Index: sbin/iked/ikev2.c === RCS file: /cvs/src/sbin/iked/ikev2.c,v retrieving

Re: ure(4): add support for RTL8156B

2022-04-01 Thread Gerhard Roth
On 4/1/22 07:41, Kevin Lo wrote: > On Fri, Apr 01, 2022 at 12:06:02PM +1000, Jonathan Matthew wrote: >> >> On Thu, Mar 31, 2022 at 09:41:09PM +0800, Kevin Lo wrote: >>> Hi, >>> >>> >>> This diff adds preliminary

Re: [patch] urndis: uncomment watchdog

2021-12-08 Thread Gerhard Roth
On 12/8/21 15:13, Mikhail wrote: On Wed, Dec 08, 2021 at 02:43:04PM +0100, Gerhard Roth wrote: Well, the RNDIS device doesn't respond to REMOTE_NDIS_KEEPALIVE_MSG messages anymore, but now you hope that it'll still process the REMOTE_NDIS_RESET_MSG we are sending? Sounds like wishful thinking

Re: [patch] urndis: uncomment watchdog

2021-12-08 Thread Gerhard Roth
On 12/8/21 14:31, Mikhail wrote: On Wed, Dec 08, 2021 at 02:10:49PM +0100, Gerhard Roth wrote: Well, there's only one watchdog thread for all of the network interfaces. If it is blocked, not other watchdogs can run. I don't think this is a big loss. On one side - no other watchdogs can run

Re: [patch] urndis: uncomment watchdog

2021-12-08 Thread Gerhard Roth
On 12/8/21 14:08, Mikhail wrote: On Wed, Dec 08, 2021 at 10:39:15AM +0100, Gerhard Roth wrote: urndis_watchdog() calls urndis_ctrl_keepalive() which sends an RNDIS keepalive msg and then waits for the reply with USBD_DEFAULT_TIMEOUT. That means if the device stopped responding

Re: [patch] urndis: uncomment watchdog

2021-12-08 Thread Gerhard Roth
On 12/8/21 10:26, Mikhail wrote: On Tue, Nov 30, 2021 at 09:40:35PM +0300, Mikhail wrote: Currently watchdog functionality for urndis driver is disabled (commented), I've tested it and it works properly - reset messages are correctly sent and cmplt packets are received according to RNDIS spec

Re: urndis0: IOERROR

2021-11-22 Thread Gerhard Roth
On 11/22/21 10:47, Mikhail wrote: On Mon, Nov 22, 2021 at 12:32:30PM +0300, Mikhail wrote: On Mon, Nov 22, 2021 at 09:31:59AM +0100, Gerhard Roth wrote: On 11/20/21 17:12, Mikhail wrote: Comparing Windows and OpenBSD tcpdumps I noticed some differences: 1) In REMOTE_NDIS_INITIALIZE_MSG (I

Re: urndis0: IOERROR

2021-11-22 Thread Gerhard Roth
On 11/20/21 17:12, Mikhail wrote: Comparing Windows and OpenBSD tcpdumps I noticed some differences: 1) In REMOTE_NDIS_INITIALIZE_MSG (I patched the kernel to send it before getting MAC address and with proper minor version) bInterfaceClass on OpenBSD is set to Unknown (0x), on Windows it's

Missing semicolon in snmpd/parse.y

2021-10-20 Thread Gerhard Roth
Hi, the rule for 'listen_udptcp' is missing a semicolon at its end. I have no idea what yacc does to the following 'port' rule without that semicolon. Gerhard Index: usr.sbin/snmpd/parse.y === RCS file:

Re: date -j and seconds since the Epoch

2021-08-09 Thread Gerhard Roth
Hello Ingo, thanks for looking into this. On 8/6/21 8:13 PM, Ingo Schwarze wrote: Hi Gerhard and Bryan, Gerhard Roth wrote on Mon, Aug 02, 2021 at 10:36:05AM +0200: Bryan Vyhmeister found a strange behavior in date(1): # date -f %s -j 1627519989 Thu Jul 29 01:53:09 PDT 2021

date -j and seconds since the Epoch

2021-08-02 Thread Gerhard Roth
Hi, Bryan Vyhmeister found a strange behavior in date(1): # date -f %s -j 1627519989 Thu Jul 29 01:53:09 PDT 2021 # date -u -f %s -j 1627519989 Thu Jul 29 00:53:09 UTC 2021 Looks like PDT is GMT-1, which of course is wrong. The problem arises from the -f

Re: Change umb(4) devclass from DV_DULL to DV_IFNET

2021-04-20 Thread Gerhard Roth
On 4/20/21 7:28 PM, Patrick Wildt wrote: Am Mon, Apr 19, 2021 at 10:25:39AM +0200 schrieb Tilo Stritzky: On 10/04/21 22:56 Tilo Stritzky wrote: umb interfaces advertise themselves as generic devices. Network makes a lot more sense, I think. tested on amd64. Having seen no response on this

Re: Huawei ME906s-158 LTE, cdce(4) vs umb(4)

2021-03-29 Thread Gerhard Roth
On 3/28/21 3:16 PM, Stuart Henderson wrote: On 2021/03/28 13:40, Patrick Wildt wrote: Am Sun, Mar 28, 2021 at 10:53:53AM +0100 schrieb Stuart Henderson: On 2021/03/25 00:14, Stuart Henderson wrote: On 2021/03/25 00:30, Patrick Wildt wrote: Without having looked at anything, it might be worth

Fix ix(4) link status

2020-10-12 Thread Gerhard Roth
ix(4) relies on link-state change interrupts the update the link state via if_link_state_change(). However, after ixgbe_stop() all interrupts for the device are disabled and there won't be any IXGBE_EICR_LSC interrupt. Simple solution: manually update link state after ixgbe_stop(). Gerhard ---

Bad definition of SIOCG80211JOIN

2020-10-05 Thread Gerhard Roth
The current definition of SIOCG80211JOIN uses 256 for the command, but the _IOC() macro only allows 8 bit for the command value. Using 256 would set the lowermost bit of the ioctl group. Fortunately, 'i' (0x69) already has the lowermost bit set. Otherwise SIOCG80211JOIN would never reach

Re: usbd_abort_pipe(); usbd_close_pipe; dance

2020-07-31 Thread Gerhard Roth
Hi Marcus, On 2020-07-31 11:22, Marcus Glocker wrote: Maybe I'm missing something here. But is there any specific reason why the most of our USB drivers are calling usbd_abort_pipe() right before usbd_close_pipe()? Since usbd_close_pipe() already will call usbd_abort_pipe() if the pipe isn't

Avoid realloc

2020-07-17 Thread Gerhard Roth
Recently a stat(2) call was added to load_server_config() of ssh to avoid reallocs. However, a buffer of 'st_size' length might be too short to hold the null terminator of the string. Add one more byte to the size, if it is sure that we can't overflow. Gerhard Index: usr.bin/ssh/servconf.c

tmpfs bug in reclaim

2020-07-13 Thread Gerhard Roth
tmpfs_reclaim() has to make sure that the VFS cache has no more locks held for the vnode. Else vclean() could panic because v_holdcnt is non-zero. I know that tmpfs is disabled by default, but it would be nice to have this fix in the code base anyway. Gerhard Index: sys/tmpfs/tmpfs_vnops.c

Re: IPv6 Support for umb(4)

2020-05-01 Thread Gerhard Roth
On 4/30/20 11:07 PM, Stuart Henderson wrote: On 2020/04/30 20:32, Gerhard Roth wrote: Hi Theo, is umb really working that differently for a P2P interface? I think it is very similar to ppp(4) and IPv6. The standard way is to obtain the IP address via PPP protocol. Just like this, umb(4

Re: IPv6 Support for umb(4)

2020-04-30 Thread Gerhard Roth
On 4/30/20 8:04 PM, Theo de Raadt wrote: I also feel noone is going to read the manual page, find this piece of text, and understand it. Honestly, I don't understand this piece of text. I'm not going to set the AUTOCONF6 flag. How does one even set it? ifconfig: AUTOCONF6: bad value Of

Re: IPv6 Support for umb(4)

2020-04-30 Thread Gerhard Roth
. I still argue umb's inet6 should work absolutely as much like regular interfaces, or it is useless. People are not going to treat this interface differently and then gain successful inet6. If inet6 can't work naturally and easily, but instead is a special snowflake, that is just plain dumb. Gerhard

Re: IPv6 Support for umb(4)

2020-04-30 Thread Gerhard Roth
On 4/30/20 4:03 PM, Theo de Raadt wrote: Is that still the true behaviour? I think it isn't, the "before up" aspect is gone isn't it? That's right for IP configuration via MBIM and I deleted the "before up" from the first sentence. But wasn't sure for the SLAAC case. Will autoconf work if

Re: IPv6 Support for umb(4)

2020-04-30 Thread Gerhard Roth
On Mon, 27 Apr 2020 16:59:22 +0200 Gerhard Roth wrote: > On 4/27/20 4:53 PM, Theo de Raadt wrote: > > Gerhard Roth wrote: > > > >> Hi Theo, > >> > >> On 4/27/20 4:39 PM, Theo de Raadt wrote: > >>> Is this code in umb_decode_ip_configur

Re: IPv6 Support for umb(4)

2020-04-27 Thread Gerhard Roth
On 4/27/20 4:53 PM, Theo de Raadt wrote: Gerhard Roth wrote: Hi Theo, On 4/27/20 4:39 PM, Theo de Raadt wrote: Is this code in umb_decode_ip_configuration() reached again, if you do a late ifconfig (don't set inet6 at up time, but set it later) no, seting inet6 later doesn't work. On MBIM

Re: IPv6 Support for umb(4)

2020-04-27 Thread Gerhard Roth
umb0 inet6 eui64' or 'ifconfig umb0 -inet6'. And I'm not sure whether the implicit temporary link loss is appreciated by the user. Gerhard That is how other network interfaces work. I'm trying to make sure this behaviour isn't too weird (ie. requiring a down, then up). Gerhard Roth wrote

Re: IPv6 Support for umb(4)

2020-04-27 Thread Gerhard Roth
And since IPv6 is now optional for umb(4), we can just skip evaluation of the IPv6 part of the IP configuration, if it wasn't enabled. Gerhard Index: sys/dev/usb/if_umb.c === RCS file: /cvs/src/sys/dev/usb/if_umb.c,v retrieving

Re: IPv6 Support for umb(4)

2020-04-27 Thread Gerhard Roth
Hello Claudio, On Mon, 27 Apr 2020 11:51:50 +0200 Claudio Jeker wrote: > On Mon, Apr 27, 2020 at 10:26:01AM +0200, Gerhard Roth wrote: > > Should we change umb(4) so that it only grabs an IPv6 address > > in case somebody does a "ifconfig umb0 inet6 eui64" first? >

Re: IPv6 Support for umb(4)

2020-04-27 Thread Gerhard Roth
Should we change umb(4) so that it only grabs an IPv6 address in case somebody does a "ifconfig umb0 inet6 eui64" first? Anyone willing to ok the patch below? On 2/19/20 9:19 AM, Gerhard Roth wrote: On Wed, 19 Feb 2020 08:45:39 +0100 Claudio Jeker wrote: On Tue, Feb 18, 2020 at

Re: IPv6 Support for umb(4)

2020-02-19 Thread Gerhard Roth
On Wed, 19 Feb 2020 08:45:39 +0100 Claudio Jeker wrote: > On Tue, Feb 18, 2020 at 11:16:54PM +, Stuart Henderson wrote: > > On 2020/02/18 13:40, Gerhard Roth wrote: > > > > > Yes, I tried MBIM_CONTEXT_IPTYPE_IPV4ANDV6 myself first but to no >

Re: IPv6 Support for umb(4)

2020-02-18 Thread Gerhard Roth
On Tue, 18 Feb 2020 12:11:05 + Stuart Henderson wrote: > On 2020/02/18 08:25, Gerhard Roth wrote: > > > > @@ -2393,6 +2581,11 @@ umb_send_connect(struct umb_softc *sc, i > > > > c->authprot = htole32(MBIM_AUTHPROT_NONE); > > > > c-&g

Re: IPv6 Support for umb(4)

2020-02-17 Thread Gerhard Roth
Hi Claudio, thanks for looking at it. For your questions find my replies below. On Mon, 17 Feb 2020 17:30:03 +0100 Claudio Jeker wrote: > On Tue, Feb 04, 2020 at 09:16:34AM +0100, Gerhard Roth wrote: > > Hi Alex, > > > > thanks for looking into it. > > > >

Re: snmpd(8) reduce generic errors

2020-02-14 Thread Gerhard Roth
On 2/14/20 3:42 PM, Martijn van Duren wrote: Apparently not many people check the error count in their snmp stats. This appears to been here since day 1. OK? martijn@ Index: snmpe.c === RCS file: /cvs/src/usr.sbin/snmpd/snmpe.c,v

Re: IPv6 Support for umb(4)

2020-02-04 Thread Gerhard Roth
Hi Alex, thanks for looking into it. On Tue, 4 Feb 2020 00:20:42 +0100 Alexander Bluhm wrote: > On Tue, Jan 28, 2020 at 03:03:47PM +0100, Gerhard Roth wrote: > > this patch adds IPv6 support to umb(4). > > It breaks my IPv4 setup. > > umb0 at uhub0 port 4 config

Re: IPv6 Support for umb(4)

2020-02-03 Thread Gerhard Roth
So far I've got only one ok from job@ and he'd like me to commit this. So I asking if there are any objections against this going into the base. Gerhard On Tue, 28 Jan 2020 15:03:47 +0100 Gerhard Roth wrote: > Hi, > > this patch adds IPv6 support to umb(4). > > It will try t

IPv6 Support for umb(4)

2020-01-28 Thread Gerhard Roth
Hi, this patch adds IPv6 support to umb(4). It will try to obtain a IPv6 address if the kernel is compiled with INET6. Currently there is no option to disable IPv6 on such a kernel (other than manually calling "ifconfig umb0 -inet6"). Nor is there a IPv6-only mode which refrains from obtaining

legacy sending of traps in snmpd

2019-12-09 Thread Gerhard Roth
Hi, any initialization of the form struct ber_oid trapoid = OID(MIB_snmpTrapOID); requires a smi_scalar_oidlen() afterwards to set 'bo_n' to the correct length. The old ber_oid_cmp() from usr.sbin/snmpd/ber.c used to iterate over all elements of 'bo_id' and not just the first 'bo_n'

fix xhci 'actlen' calculation

2019-11-12 Thread Gerhard Roth
Hi, xhci's calculation of 'xfer->actlen' is wrong if the xfer was split into multiple TRBs. That's because the code just looks at the remainder reported by the status TRB. However, this remainder only refers to the total size of this single TRB; not to the total size of the xfer. Example: assume

Re: HID devices without numbered reports

2019-10-28 Thread Gerhard Roth
On Mon, 28 Oct 2019 15:41:34 +0100 Patrick Wildt wrote: > On Mon, Oct 28, 2019 at 03:14:22PM +1100, Damien Miller wrote: > > On Mon, 28 Oct 2019, Damien Miller wrote: > > > > > BTW, the token still becomes unresponsive after the first transaction, > > > but looking at a sniff (using an

Re: Add SHA-2 support to snmpd [2/2] SHA-2/RFC7860

2019-06-07 Thread Gerhard Roth
On 6/7/19 10:45 AM, Martijn van Duren wrote: > On 6/7/19 10:41 AM, Gerhard Roth wrote: >> On 6/7/19 9:52 AM, Martijn van Duren wrote: >>> On 6/7/19 9:50 AM, Martijn van Duren wrote: >>>> Hello tech@, >>>> >>>> I managed to get SHA-2 support

Re: Add SHA-2 support to snmpd [2/2] SHA-2/RFC7860

2019-06-07 Thread Gerhard Roth
On 6/7/19 9:52 AM, Martijn van Duren wrote: > On 6/7/19 9:50 AM, Martijn van Duren wrote: >> Hello tech@, >> >> I managed to get SHA-2 support working for snmpd, based on RFC7860 and >> tested with net-snmp commandline tools. >> >> I split the diff up in 2 steps for readability. > Step 2:

Re: Add SHA-2 support to snmpd [1/2] Digest length is not always 12 bytes

2019-06-07 Thread Gerhard Roth
On 6/7/19 9:50 AM, Martijn van Duren wrote: > Hello tech@, > > I managed to get SHA-2 support working for snmpd, based on RFC7860 and > tested with net-snmp commandline tools. > > I split the diff up in 2 steps for readability. > Step 1: Don't assume the digestlength is always 12 bytes. This

Re: if_umb.c: typos

2019-01-14 Thread Gerhard Roth
Hello Ingo, I must apologize for my sticky fingers and lots of copy & pasting :/ Thanks for finding. ok gerhard@ On Mon, 14 Jan 2019 14:21:37 +0100 Ingo Feinerer wrote: > A few messsage -> message fixes. > > Index: if_umb.c >

Bogus assertwaitok() in usb_block_allocmem()

2018-12-05 Thread Gerhard Roth
usb_block_allocmem() does not sleep and is careful to always use the BUS_DMA_NOWAIT flag. So why the assertwaitok()? Gerhard Index: sys/dev/usb/usb_mem.c === RCS file: /cvs/src/sys/dev/usb/usb_mem.c,v retrieving revision 1.31 diff

Re: umsm(4) and umb(4) separate loading for the same composite USB modem device

2018-08-16 Thread Gerhard Roth
On Thu, 16 Aug 2018 13:56:13 +0300 Denis wrote: > I can change AT!UDUSBCOMP modes for MC7304 and MC7455 I have in production. > > But how to make full dump of all the USB device descriptors for each > UDUSBCOMP mode? Can I make it by usbdevs - or how? Hi Denis, no that won't work. You

Re: [patch] Add kvm_close in mib_hrsystemprocs function

2018-06-04 Thread Gerhard Roth
On Thu, 31 May 2018 17:40:36 +0800 Nan Xiao wrote: > Hi Gerhard, > > Thanks for your reply! > > Yes, if no "kvm_close(kd);", there will be resource (memory, file > descriptor) leak. So hope you can commit it, thanks! > > > On 5/30/2018 4:49 PM, Gerhard R

Re: [patch] Add kvm_close in mib_hrsystemprocs function

2018-05-30 Thread Gerhard Roth
On Wed, 30 May 2018 16:25:55 +0800 Nan Xiao wrote: > Hi tech@, > > Maybe kvm_close is needed if kvm_getprocs returns NULL here? Sorry if I > am wrong, thanks! > > Index: mib.c > === > RCS file: /cvs/src/usr.sbin/snmpd/mib.c,v >

Re: Speed up snmpwalk

2018-05-22 Thread Gerhard Roth
On Tue, 22 May 2018 11:05:48 +0200 Claudio Jeker <cje...@diehard.n-r-g.com> wrote: > On Tue, May 22, 2018 at 10:26:30AM +0200, Gerhard Roth wrote: > > Hi, > > > > a snmpwalk of HOST-RESOURCES-MIB::hrSWRunTable doesn't scale very well > > with an incre

Speed up snmpwalk

2018-05-22 Thread Gerhard Roth
Hi, a snmpwalk of HOST-RESOURCES-MIB::hrSWRunTable doesn't scale very well with an increasing number of running processes. For every process and each of the 7 elements of the table, mib_hrswrun() would call kinfo_proc() which queried all the processes running on the system and sort them by pid.

Re: close filedescriptors of children

2018-03-08 Thread Gerhard Roth
If proc_init() knows about debug mode, we can move the call to daemon(3) into proc_init(). Then only the parent calls daemon(3). The children will inherit stdin/out/err from the parent and don't have to do anything. And since the children don't call daemon(3) themselves anymore, there won't be any

Re: close filedescriptors of children

2018-03-07 Thread Gerhard Roth
On Wed, 7 Mar 2018 17:20:06 +0100 Mike Belopuhov <m...@belopuhov.com> wrote: > On 7 March 2018 at 17:01, Gerhard Roth <gerhard_r...@genua.de> wrote: > > > > Hi Benno, > > > > thanks for your reply. > > > > On Wed, 7 Mar 2018 15:22:28 +0100 Sebas

Re: close filedescriptors of children

2018-03-07 Thread Gerhard Roth
Hi Benno, thanks for your reply. On Wed, 7 Mar 2018 15:22:28 +0100 Sebastian Benoit wrote: > Hi, > > switchd and vmd use the same proc.c,and should stay in sync. Ack. I missed them. > > Also, this breaks -dvv (i.e. debug output when running inthe foreground), > at least

close filedescriptors of children

2018-03-07 Thread Gerhard Roth
Hi, proc_init() is done before daemon() and for the child processes of httpd, relayd and snmpd() this function never returns. That means that the children inherit stdin, stdout, and stderr of the caller and never close them. This fix this, proc_init() should map these filedes to /dev/null for a

Re: [patch] snmpd hrStorageSize negative values

2017-11-27 Thread Gerhard Roth
On Sat, 25 Nov 2017 11:42:07 -0700 Joel Knight wrote: > On Thu, Mar 9, 2017 at 10:02 PM, Joel Knight wrote: > > Hi. > > > > snmpd(8) uses unsigned ints internally to represent the size and used > > space of a file system. The HOST-RESOURCES-MIB

umb(4): recover after temporary loss of packet service

2017-10-23 Thread Gerhard Roth
In case we have a temporary loss of connection in umb(4), the USB xfers may time-out. umb_txeof() should always check whether there are further mbufs in the if_snd queue; not only after successful transmits. Also, aborting the xfer in case the watchdog timer triggers, can help to resume from

Re: Routing table update on link state change

2017-09-05 Thread Gerhard Roth
On Tue, 5 Sep 2017 10:47:11 +0200 Martin Pieuchot <m...@openbsd.org> wrote: > On 04/09/17(Mon) 14:53, Gerhard Roth wrote: > > Hi Martin, > > > > > > On Mon, 4 Sep 2017 14:18:50 +0200 Martin Pieuchot <m...@openbsd.org> wrote: > > > On 04/

Re: Routing table update on link state change

2017-09-04 Thread Gerhard Roth
Hi Martin, On Mon, 4 Sep 2017 14:18:50 +0200 Martin Pieuchot <m...@openbsd.org> wrote: > On 04/09/17(Mon) 13:10, Gerhard Roth wrote: > > Hi, > > > > I noticed a problem with the routing table that is easy to reproduce: put > > multiple IPs on the same carp i

Routing table update on link state change

2017-09-04 Thread Gerhard Roth
Hi, I noticed a problem with the routing table that is easy to reproduce: put multiple IPs on the same carp interface: # ifconfig em0 em0: flags=8843 mtu 1500 lladdr 00:0a:e4:31:9d:6e index 1 priority 0 llprio 3 groups: egress

Re: snmpd: format string for yyerror

2017-07-28 Thread Gerhard Roth
On Fri, 28 Jul 2017 12:36:22 + Florian Obser wrote: > not really a problem, errstr are just various static strings, but still... > > pointed out by clang, OK? > > diff --git snmpd/parse.y snmpd/parse.y > index efd1159c3ab..cc3d4194556 100644 > --- snmpd/parse.y > +++

Re: snmpd: engine id is just a binary string?

2017-07-28 Thread Gerhard Roth
On Fri, 28 Jul 2017 12:39:48 + Florian Obser wrote: > Not sure about this one, a quick glance at RFC 3411 suggests this > is just a binary string, so uint8_t is more appropriate. > > Any snmp nerds around? > > clang complained about this: > >

Re: snmpd getbulk replies

2017-07-27 Thread Gerhard Roth
On Thu, 27 Jul 2017 12:46:23 +0100 Stuart Henderson <s...@spacehopper.org> wrote: > On 2017/07/27 10:58, Gerhard Roth wrote: > > Hi, > > > > snmpd uses the same storage for sm_error and sm_nonrepeaters. Same applies > > to sm_errorindex and sm_maxrepetiti

snmpd getbulk replies

2017-07-27 Thread Gerhard Roth
Hi, snmpd uses the same storage for sm_error and sm_nonrepeaters. Same applies to sm_errorindex and sm_maxrepetitions. If we produce a response PDU to a getbulk request, sm_error will carry the number of non-repeaters from the request and sm_errorindex the max. number of repetitions. This is

Re: Standard conformance of strtol(3)

2017-07-06 Thread Gerhard Roth
On 06.07.2017 17:53, Todd C. Miller wrote: On Thu, 06 Jul 2017 07:37:19 -0600, "Todd C. Miller" wrote: glibc strtol() behavior: AIX FreeBSD GNU/Linux Solaris macOS SunOS 4.1.3 has the same behavior as Solaris. That's as far back as I care to go. - todd FWIW:

Fix possible fault in sysctl_file()

2017-06-20 Thread Gerhard Roth
Hi, file pointer may be incompletely initialized after falloc(). For example, sys_socket() initializes 'f_flag', 'f_type', and 'f_ops' but may sleep then in socreate() before assigning 'f_data'. That is why there is the FIF_LARVAL flag, that is check by the macro FILE_IS_USABLE(). Of the three

Fix umb(4) on big-endian machines

2017-05-03 Thread Gerhard Roth
Hi, all MBIM values are in litte-endian encoding but somewhere in the fine print it reads that "the addresses will be in network byte order". So applying letoh32() on addresses is just plain wrong. On little-endian machines, we didn't notice since letoh32() is a no-op there. But one big-endian

Re: umb: aggregate packets on tx

2017-02-20 Thread Gerhard Roth
On Mon, 12 Dec 2016 14:50:50 +0100 Gerhard Roth <gerhard_r...@genua.de> wrote: > The current umb(4) implementation needs one USB transfer for every packet > that is sent. With the following patch, we can now aggregate several > packets from the ifq into one single USB transfer. >

umb: aggregate packets on tx

2016-12-12 Thread Gerhard Roth
The current umb(4) implementation needs one USB transfer for every packet that is sent. With the following patch, we can now aggregate several packets from the ifq into one single USB transfer. This may speed up the tx path. And even if it doesn't, at least it reduces the number of transfers

umb string padding

2016-11-22 Thread Gerhard Roth
This patch fixes a bug in the padding of umb strings. Instead of padding the right position, umb_padding() would always zero padding bytes at the beginning of the buffer. For the two callers of umb_addstr(), this won't hurt in umb_send_connect() since the first value in the buffer is the session

FCC Auth patch for umb(4)

2016-11-16 Thread Gerhard Roth
Some MBIM devices need a FCC Authentication before they're willing to turn on the radio. This has to be done by sending a QMI command inside an MBIM message. This patch is based on an earlier patch by Stuart Henderson. One crucial thing was missing in sthen@'s patch: first a client-id (CID) has

Re: [PATCH] usbdevs for Sierra Wireless EM7455

2016-11-16 Thread Gerhard Roth
On Tue, 15 Nov 2016 08:11:01 -0800 Bryan Vyhmeister wrote: > This patch adds the Sierra Wireless EM7455 umb(4) device to usbdevs in > preparation for another patch to if_umb.c which adds full support for > the EM7455. > > Bryan > > > Index: sys/dev/usb/usbdevs >

umb: NCM datagram pointer entries

2016-11-14 Thread Gerhard Roth
Hi, according to the NCM spec, the list of datagram pointer entries has to be terminated with an entry where wDatagramIndex and wDatagramLen are zero. Not all implementations seem to follow that rule: otto@ had one that only sets the index to zero while using an arbitrary length value. The patch

Re: [PATCH] umb(4) fixes for ifconfig

2016-11-10 Thread Gerhard Roth
> > The second part of the patch also fixes the last digit of the phone > > number and mulitple digits of the subscriber-id, ICC-id, and IMEI being > > cut off. Both fixes were discussed with Gerhard Roth. I sent him an > > original patch but it only partially solved the issues

Re: umb(4) man page tweaks

2016-06-20 Thread Gerhard Roth
On Mon, 20 Jun 2016 08:50:05 +0200 Gerhard Roth <gerhard_r...@genua.de> wrote: > Hallo Stefan, > > danke, dass Du Dich darum kuemmerst. > > ok gerhard@ Sorry for the German. This mail was intended to go to Stefan only and not the mailing list. My mistake. Gerhard >

Re: umb(4) man page tweaks

2016-06-20 Thread Gerhard Roth
Hallo Stefan, danke, dass Du Dich darum kuemmerst. ok gerhard@ On Sun, 19 Jun 2016 15:03:13 +0200 Stefan Sperling wrote: > Some information in the umb(4) man page seems to be outdated (IPV4 gateway > handling), or doesn't really belong in a man page ("please hack the driver >

Re: MBIM Patch (Round 3)

2016-06-15 Thread Gerhard Roth
On 13.06.2016 12:52, Martin Pieuchot wrote: On 10/06/16(Fri) 21:09, Mark Kettenis wrote: Date: Fri, 10 Jun 2016 17:20:18 +0100 From: Stuart Henderson On 2016/06/10 16:05, Mark Kettenis wrote: In any case this is something we can figure out once the code hits the tree.

Re: MBIM Patch (Round 3)

2016-06-14 Thread Gerhard Roth
On 10.06.2016 14:41, Bryan Vyhmeister wrote: On Fri, Jun 10, 2016 at 09:43:36AM +0200, Gerhard Roth wrote: Hmm, I don't see the missing break. It is still stuck in the same state trying to turn on the radio and always getting non-confirmative resonses. If the break before "case UMB_S_

Re: MBIM Patch (Round 3)

2016-06-10 Thread Gerhard Roth
On 10.06.2016 05:09, Bryan Vyhmeister wrote: On Thu, Jun 09, 2016 at 10:31:58PM +0200, Gerhard Roth wrote: If that doesn't help, please set UMB_DEBUG and set umb_debug to 5. I left that break commented out which perhaps I shouldn't have but below is the output when I set an apn and bring umb0

Re: MBIM Patch (Round 3)

2016-06-09 Thread Gerhard Roth
On 10.06.2016 00:22, Stuart Henderson wrote: On 2016/06/10 00:10, Mark Kettenis wrote: From: Gerhard Roth <gerhard_r...@genua.de> Date: Thu, 9 Jun 2016 23:48:23 +0200 On 09.06.2016 23:42, Mark Kettenis wrote: Date: Thu, 9 Jun 2016 22:59:28 +0200 (CEST) From: Mark Kettenis <m

Re: MBIM Patch (Round 3)

2016-06-09 Thread Gerhard Roth
On 09.06.2016 23:42, Mark Kettenis wrote: Date: Thu, 9 Jun 2016 22:59:28 +0200 (CEST) From: Mark Kettenis <mark.kette...@xs4all.nl> Date: Wed, 8 Jun 2016 15:08:52 +0200 From: Gerhard Roth <gerhard_r...@genua.de> I would be glad to hear from some people trying this with a real

Re: MBIM Patch (Round 3)

2016-06-09 Thread Gerhard Roth
On 09.06.2016 21:35, Bryan Vyhmeister wrote: On Wed, Jun 08, 2016 at 03:08:52PM +0200, Gerhard Roth wrote: I would be glad to hear from some people trying this with a real MBIM device. I have a Sierra Wireless EM7455 MBIM device that I purchased with my ThinkPad X260. I am very excited

Re: MBIM Patch (Round 3)

2016-06-09 Thread Gerhard Roth
On 09.06.2016 19:04, Ingo Schwarze wrote: Hi Gerhard, Gerhard Roth wrote on Wed, Jun 08, 2016 at 03:08:52PM +0200: +.\" Copyright (c) 2016 genua mbH + * Copyright (c) 2016 genua mbH These kinds of Copyright notices without the name of the actual author are misleading. The pu

Re: MBIM Patch (Round 3)

2016-06-09 Thread Gerhard Roth
On 09.06.2016 17:52, Gerhard Roth wrote: But: this payload is only 13 bytes but the length field says 14 bytes (0x0d). Studid me. Can't even read single digit hex values anymore :(

Re: MBIM Patch (Round 3)

2016-06-09 Thread Gerhard Roth
On Thu, 9 Jun 2016 17:37:54 +0200 Gerhard Roth <gerhard_r...@genua.de> wrote: > On Thu, 9 Jun 2016 16:19:14 +0100 Stuart Henderson <s...@spacehopper.org> > wrote: > > On 2016/06/09 15:29, Stuart Henderson wrote: > > > On 2016/06/08 15:08, Gerhard Roth wrote: >

Re: MBIM Patch (Round 3)

2016-06-09 Thread Gerhard Roth
On Thu, 9 Jun 2016 16:19:14 +0100 Stuart Henderson <s...@spacehopper.org> wrote: > On 2016/06/09 15:29, Stuart Henderson wrote: > > On 2016/06/08 15:08, Gerhard Roth wrote: > > > I would be glad to hear from some people trying this with a real MBIM > > > device.

Re: MBIM Patch (Round 3)

2016-06-09 Thread Gerhard Roth
On Thu, 9 Jun 2016 15:29:34 +0100 Stuart Henderson <s...@spacehopper.org> wrote: > On 2016/06/08 15:08, Gerhard Roth wrote: > > I would be glad to hear from some people trying this with a real MBIM > > device. > > So I have a Dell-branded Sierra MC8805, but

MBIM Patch (Round 3)

2016-06-08 Thread Gerhard Roth
Here comes the next version of the MBIM driver. Changes since last version: - incorporated suggestions from mpi@ - renamed to "umb" Only file "mbim.h" which contains MBIM protocol related stuff continues to use "mbim" as prefix. - No longer takes fake addresses nor does it try

Re: MBIM Patch (Round 2)

2016-06-08 Thread Gerhard Roth
On Wed, 8 Jun 2016 11:31:41 +0100 Stuart Henderson <s...@spacehopper.org> wrote: > On 2016/06/08 11:59, Gerhard Roth wrote: > > On Wed, 8 Jun 2016 10:54:00 +0100 Stuart Henderson <s...@spacehopper.org> > > wrote: > > > On 2016/06/08 11:48, Gerhard Roth wr

Re: MBIM Patch (Round 2)

2016-06-08 Thread Gerhard Roth
On Wed, 8 Jun 2016 10:54:00 +0100 Stuart Henderson <s...@spacehopper.org> wrote: > On 2016/06/08 11:48, Gerhard Roth wrote: > > > > Currently I do this to get the interface up and running as my default > > route: > > > > # ifconfig umb0 pin apn xx

  1   2   >