Hello community, here is the log from the commit of package ser2net for openSUSE:Factory checked in at 2020-07-27 17:42:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ser2net (Old) and /work/SRC/openSUSE:Factory/.ser2net.new.3592 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ser2net" Mon Jul 27 17:42:30 2020 rev:12 rq:822854 version:4.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ser2net/ser2net.changes 2020-05-26 17:21:24.696244557 +0200 +++ /work/SRC/openSUSE:Factory/.ser2net.new.3592/ser2net.changes 2020-07-27 17:44:34.599235083 +0200 @@ -1,0 +2,60 @@ +Wed Jul 8 18:53:31 UTC 2020 - Martin Hauke <[email protected]> + +- Update to version 4.2.0 + telnet: + * There was an issue with telnet handling where it could get + into a loop talking to the remote end. + * Fix an issue where an error in a certain place could cause + closing to hang. + selector: + Allow an arbitrary number of file descriptors with epoll. With + epoll, you can set the max number of fds > FD_SETSIZE. Allow + that. + IPv6: + * There was a bug in the Linux SCTP stack dealing with IPv6 + handling that I thought was a bug in ser2net. So I looked, and + I found some issues with IPv6 in general and the way it handles + IPv4 address mapping. In the new code: + Modify the operation of an address without "ipv6," explicitly + in front of it to all V4 mapped addresses. And fix the connect + side to set V6 only on the socket if "ipv6,"is in front of it. + This means you cannot mix "ipv6," and "ipv6n4," addresses on + the same connection, and the default is now "ipv6n4" + This broke handling of things like "tcp,1234", so rework those + to only use IPv6 when it is mapped. That, in turn, broke UDP. + Or, more accurately, expose a UDP bug, so some work had to be + done to handle IPv4 mapped addresses in IPv6 by reworking + address comparison to handle that. + general: + convert gensio_raddr_to_str(), gensio_get_raddr(), and + gensio_remote_id() to use gensio_control(). Having separate + functions for those added to the API and added a lot of code + to all the intermediate layer. The function are there but + deprecated, and use the ioctls underneath them. + Have gensio snprint functions return a gensiods + Add dll visibililty handling. This is required for windows, + and makes things cleaner. As part of this, functions should + all be the right visibility now. + Lots of other little bug fixes and such. + relpkt: + There were issues with the way the base code handled certain + things. For a real protocol that might have outstanding data + to send but cannot send due to flow control, new functions + needs to be added to the base layer to account for this, and + relpkt needed to use them. + Fixed several other issues dealing with close handling and flow + control. It runs much better now. + msgdelim: + There was an issue with telnet handling where it could get into + a loop talking to the remote end. + Fix an issue where an error in a certain place could cause + closing to hang. + file descriptor based gensios: + Fixed an issue that would result in a callback being done after + close is compelete. + UDP: + As part of an added test, I found a situation where if the + upper layer doesn't accept the data for a UDP packet, the UDP + layer would not accept any more data from the socket. + +------------------------------------------------------------------- Old: ---- ser2net-4.1.8.tar.gz New: ---- ser2net-4.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ser2net.spec ++++++ --- /var/tmp/diff_new_pack.iDEJZW/_old 2020-07-27 17:44:36.391236765 +0200 +++ /var/tmp/diff_new_pack.iDEJZW/_new 2020-07-27 17:44:36.395236769 +0200 @@ -17,7 +17,7 @@ Name: ser2net -Version: 4.1.8 +Version: 4.2.0 Release: 0 Summary: Serial port to network proxy License: GPL-2.0-or-later ++++++ ser2net-4.1.8.tar.gz -> ser2net-4.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ser2net-4.1.8/auth.c new/ser2net-4.2.0/auth.c --- old/ser2net-4.1.8/auth.c 2020-05-13 00:42:57.000000000 +0200 +++ new/ser2net-4.2.0/auth.c 2020-06-28 20:27:05.000000000 +0200 @@ -23,6 +23,7 @@ #include <limits.h> #include <errno.h> #include <gensio/gensio.h> +#include "ser2net.h" /* * The next few functions are for authentication handling. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ser2net-4.1.8/configure.ac new/ser2net-4.2.0/configure.ac --- old/ser2net-4.1.8/configure.ac 2020-05-13 00:42:57.000000000 +0200 +++ new/ser2net-4.2.0/configure.ac 2020-06-28 20:27:05.000000000 +0200 @@ -1,4 +1,4 @@ -AC_INIT([ser2net], [4.1.8], [[email protected]]) +AC_INIT([ser2net], [4.2.0], [[email protected]]) AM_INIT_AUTOMAKE([-Wall]) AC_PROG_CC AM_PROG_AR diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ser2net-4.1.8/controller.c new/ser2net-4.2.0/controller.c --- old/ser2net-4.1.8/controller.c 2020-05-13 00:42:57.000000000 +0200 +++ new/ser2net-4.2.0/controller.c 2020-06-28 20:27:05.000000000 +0200 @@ -302,7 +302,7 @@ /* Process a line of input. This scans for commands, reads any parameters, then calls the actual code to handle the command. */ -int +static int process_input_line(controller_info_t *cntlr) { char *strtok_data; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ser2net-4.1.8/dataxfer.c new/ser2net-4.2.0/dataxfer.c --- old/ser2net-4.1.8/dataxfer.c 2020-05-13 00:42:57.000000000 +0200 +++ new/ser2net-4.2.0/dataxfer.c 2020-06-28 20:27:05.000000000 +0200 @@ -129,8 +129,7 @@ return ENOMEM; buf->maxsize = size; - buf->cursize = 0; - buf->pos = 0; + gbuf_reset(buf); return 0; } @@ -491,8 +490,6 @@ rcb->str = strdup(str); if (!rcb->str) { - free(rcb); - rcb = NULL; err = GE_NOMEM; goto out; } @@ -516,11 +513,9 @@ gensio_free_addrinfo(so, r->ai); free(r); } - if (rcb) { - if (rcb->str) - free(rcb->str); + if (rcb) + /* rcb->str cannot be set, the last failure is its allocation. */ free(rcb); - } if (ai) gensio_free_addrinfo(so, ai); } @@ -676,6 +671,36 @@ return 0; } +static gensiods +net_raddr_str(struct gensio *io, char *buf, gensiods buflen) +{ +#if (defined(gensio_version_major) && (gensio_version_major > 2 || \ + (gensio_version_major == 2 && gensio_version_minor > 0))) + int err = gensio_control(io, GENSIO_CONTROL_DEPTH_FIRST, true, + GENSIO_CONTROL_RADDR, buf, &buflen); +#else + int err = gensio_raddr_to_str(io, &buflen, buf, buflen); +#endif + if (err) + buflen = 0; + + return buflen; +} + +static gensiods +net_raddr(struct gensio *io, struct sockaddr_storage *addr, gensiods *socklen) +{ + *socklen = sizeof(*addr); +#if (defined(gensio_version_major) && (gensio_version_major > 2 || \ + (gensio_version_major == 2 && gensio_version_minor > 0))) + return gensio_control(io, GENSIO_CONTROL_DEPTH_FIRST, true, + GENSIO_CONTROL_RADDR_BIN, + (char *) addr, socklen); +#else + return gensio_get_raddr(io, (char *) addr, socklen); +#endif +} + static void reset_timer(net_info_t *netcon) { @@ -709,7 +734,7 @@ return pos; } -int +static int trace_write(port_info_t *port, trace_info_t *t, const unsigned char *buf, gensiods buf_len, const char *prefix) { @@ -817,7 +842,8 @@ len += timestamp(&tr, buf, sizeof(buf)); if (sizeof(buf) > len) len += snprintf(buf + len, sizeof(buf) - len, "OPEN ("); - gensio_raddr_to_str(netcon->net, &len, buf, sizeof(buf)); + if (sizeof(buf) > len) + len += net_raddr_str(netcon->net, buf + len, sizeof(buf) - len); if (sizeof(buf) > len) len += snprintf(buf + len, sizeof(buf) - len, ")\n"); @@ -871,7 +897,7 @@ port->dev_to_net_state = PORT_WAITING_OUTPUT_CLEAR; } -void +static void send_timeout(struct gensio_timer *timer, void *data) { port_info_t *port = (port_info_t *) data; @@ -1225,10 +1251,8 @@ buf->pos += written; port->dev_bytes_sent += written; - if (buf->pos >= buf->cursize) { - buf->pos = 0; - buf->cursize = 0; - } + if (buf->pos >= buf->cursize) + gbuf_reset(buf); return 0; } @@ -1921,10 +1945,8 @@ /* ser2net serial parms. */ { char str[1024]; - int err; - err = gensio_raddr_to_str(port->io, NULL, str, sizeof(str)); - if (err) + if (net_raddr_str(port->io, str, sizeof(str)) == 0) break; t = strchr(str, ','); if (!t) @@ -2147,7 +2169,7 @@ netcon = first_live_net_con(port); if (!netcon) break; - if (gensio_raddr_to_str(netcon->net, NULL, ip, sizeof(ip))) + if (net_raddr_str(netcon->net, ip, sizeof(ip)) == 0) break; for (ipp = ip; *ipp; ipp++) op(data, *ipp); @@ -2352,11 +2374,9 @@ static void extract_bps_bpc(port_info_t *port) { - int err; char buf[1024], *s, *speed; - err = gensio_raddr_to_str(port->io, NULL, buf, sizeof(buf)); - if (err) + if (net_raddr_str(port->io, buf, sizeof(buf)) == 0) goto out_broken; s = strchr(buf, ','); @@ -2551,8 +2571,7 @@ goto next; if (port->dev_to_net_state == PORT_CLOSING) goto next; - socklen = sizeof(addr); - err = gensio_get_raddr(net, &addr, &socklen); + err = net_raddr(net, &addr, &socklen); if (err) goto next; if (!remaddr_check(port->remaddrs, @@ -2586,7 +2605,8 @@ setup_port(port, netcon); } -int gensio_log_level_to_syslog(int gloglevel) +static int +gensio_log_level_to_syslog(int gloglevel) { switch (gloglevel) { case GENSIO_LOG_FATAL: @@ -2748,7 +2768,7 @@ rotators = NULL; } -void +static void rot_timeout(struct gensio_timer *timer, void *cb_data) { rotator_t *rot = cb_data; @@ -2929,8 +2949,7 @@ goto out_err; } - socklen = sizeof(addr); - if (!gensio_get_raddr(net, &addr, &socklen)) { + if (!net_raddr(net, &addr, &socklen)) { if (!remaddr_check(port->remaddrs, (struct sockaddr *) &addr, socklen)) { err = "Accessed denied due to your net address\r\n"; @@ -3538,7 +3557,7 @@ return false; } -void +static void got_timeout(struct gensio_timer *timer, void *data) { port_info_t *port = (port_info_t *) data; @@ -4412,8 +4431,7 @@ showshortport(struct controller_info *cntlr, port_info_t *port) { char buffer[NI_MAXHOST + NI_MAXSERV + 2]; - int count; - int err; + int count = 0; net_info_t *netcon = NULL; controller_outputf(cntlr, "%-22s ", port->name); @@ -4428,8 +4446,8 @@ netcon = &(port->netcons[0]); if (port_in_use(port)) { - gensio_raddr_to_str(netcon->net, NULL, buffer, sizeof(buffer)); - count = controller_outputf(cntlr, "%s", buffer); + if (net_raddr_str(netcon->net, buffer, sizeof(buffer)) != 0) + count = controller_outputf(cntlr, "%s", buffer); } else { count = controller_outputf(cntlr, "unconnected"); } @@ -4448,8 +4466,7 @@ controller_outputf(cntlr, "%9lu ", (unsigned long)port->dev_bytes_received); controller_outputf(cntlr, "%9lu ", (unsigned long) port->dev_bytes_sent); - err = gensio_raddr_to_str(port->io, NULL, buffer, sizeof(buffer)); - if (!err) + if (net_raddr_str(port->io, buffer, sizeof(buffer)) != 0) controller_outputf(cntlr, "%s", buffer); controller_outs(cntlr, "\r\n"); @@ -4461,7 +4478,6 @@ { char buffer[NI_MAXHOST + NI_MAXSERV + 2], *cfg, *oth = NULL; net_info_t *netcon; - int err; controller_outputf(cntlr, "Port %s\r\n", port->name); controller_outputf(cntlr, " accepter: %s\r\n", port->accstr); @@ -4471,7 +4487,8 @@ for_each_connection(port, netcon) { if (netcon->net) { - gensio_raddr_to_str(netcon->net, NULL, buffer, sizeof(buffer)); + buffer[0] = '\0'; + net_raddr_str(netcon->net, buffer, sizeof(buffer)); controller_outputf(cntlr, " connected to: %s\r\n", buffer); controller_outputf(cntlr, " bytes read from TCP: %lu\r\n", (unsigned long) netcon->bytes_received); @@ -4488,8 +4505,7 @@ else controller_outputf(cntlr, " device: %s\r\n", port->devname); - err = gensio_raddr_to_str(port->io, NULL, buffer, sizeof(buffer)); - if (!err) { + if (net_raddr_str(port->io, buffer, sizeof(buffer)) != 0) { cfg = strchr(buffer, ','); if (cfg) { cfg++; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ser2net-4.1.8/led_sysfs.c new/ser2net-4.2.0/led_sysfs.c --- old/ser2net-4.1.8/led_sysfs.c 2020-05-13 00:42:57.000000000 +0200 +++ new/ser2net-4.2.0/led_sysfs.c 2020-06-28 20:27:05.000000000 +0200 @@ -32,6 +32,7 @@ #include <syslog.h> #include <limits.h> #include "led.h" +#include "led_sysfs.h" #define SYSFS_LED_BASE "/sys/class/leds" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ser2net-4.1.8/ser2net.8 new/ser2net-4.2.0/ser2net.8 --- old/ser2net-4.1.8/ser2net.8 2020-05-13 00:42:57.000000000 +0200 +++ new/ser2net-4.2.0/ser2net.8 2020-06-28 20:27:05.000000000 +0200 @@ -24,10 +24,11 @@ .TP .I "\-c config\-file" Set the configuration file to one other than the default of -.BR "/etc/ser2net/ser2net.yaml". If the filename does not end in +.BR "/etc/ser2net/ser2net.yaml". +If the filename does not end in ".yaml" or the first line in the file does not begin with "%YAML", the configuration file is parsed as an old-style configuration file, which -is not supported any more. If the +should work but is no longer supported. If the .B config-file is .B "-" @@ -36,7 +37,7 @@ .I "\-C config-line" Handle a single configuration line. This may be specified multiple times for multiple lines. This is just like a -line in the config file. This disables the default config file, +line in the old style config file. This disables the default config file, you must specify a -c after the last -C to have it read a config file, too. @@ -57,7 +58,7 @@ -Y 'connection: &con01# accepter: tcp,2013' -Y ' connector: serialdev,/dev/ttyEcho0,9600n81,local' - -Y ' options:# banner: "### A Banner ###\r\n"' + -Y ' options:# banner: "### A Banner ###\er\en"' can be put on the ser2net command line. .TP @@ -75,7 +76,6 @@ by default, you must specify this to create one. Note also that this filename must be specific with the full path, as ser2net will change directory to "/" when it becomes a daemon. -when it .TP .I \-u If UUCP locking is enabled, this will disable the use of UUCP locks. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ser2net-4.1.8/ser2net.yaml.5 new/ser2net-4.2.0/ser2net.yaml.5 --- old/ser2net-4.1.8/ser2net.yaml.5 2020-05-13 00:42:57.000000000 +0200 +++ new/ser2net-4.2.0/ser2net.yaml.5 2020-06-28 20:27:05.000000000 +0200 @@ -60,8 +60,6 @@ .RS connection: &<alias> .RS -name: <name> -.br accepter: <accepter> .br timeout: <number> @@ -80,7 +78,7 @@ .RE An <accepter> is an accepting gensio specification. When ser2net -receive a connection on the accepter, it attempts to make a connection +receives a connection on the accepter, it attempts to make a connection to the <connector> gensio. The alias is required, it sets the name that is used for the connection in the admin interface and for referencing from rotators. @@ -95,9 +93,9 @@ there are users connected and you disable a port and send a SIGHUP, the users will be kicked off. -An is a configuration setting that doesn't have anything to do -with specific gensios, they are controls for ser2net in general. -The option section is optional. +An option is a configuration setting that doesn't have anything to do +with specific gensios, they are controls for ser2net in general. The +option section is optional. See gensio(5) for a lot of information about the specific gensios available. @@ -105,10 +103,8 @@ To allow a TCP connection to a serial port and ignore modem control, you can do: .RS -connection: +connection: &toS0tcp .RS -name: connection to /dev/ttyS0 -.br accepter: tcp,1234 .br connector: serialdev,/dev/ttyS0,local @@ -119,10 +115,8 @@ Both accepting and connecting gensios stack, so if you want to add telnet with RFC2217 support, you can do: .RS -connection: +connection: &toS0telnet .RS -name: connection to /dev/ttyS0 -.br accepter: telnet(rfc2217)tcp,1234 .br connector: serialdev,/dev/ttyS0,local @@ -133,10 +127,8 @@ localhost and connect to a telnet connection with SSL over tcp, you can do: .RS -connection: +connection: &tomyhost .RS -name: connection to myhost.domain.org,1234 -.br accepter: telnet,sctp,::1,1234 .br connector: telnet,ssl,tcp,myhost.domain.org,1234 @@ -155,11 +147,9 @@ connects to an IPMI sol connection. Notice how splitting the connector line is done with YAML. .RS -connection: +connection: &authsol .RS .br -name: connection to ipimsol on ipmiserver.domain.org -.br accepter: telnet(rfc2217),mux,certauth,ssl,sctp,1234 .br connector: ipmisol,lan -U ipmiusr -P test -p 9001 @@ -379,7 +369,7 @@ .I sendon: <sendon string> If the given string is seen coming from the connector side of the connection, sends buffered data up to and including the -string. Disabled by default. As an example, this can be set to \r\n +string. Disabled by default. As an example, this can be set to \er\en with appropriate chardelay settings to send one line at a time. It uses string handling as described in "SPECIAL STRING HANDLING" above. See the notes on the closeon string for important information on how @@ -449,7 +439,7 @@ A rotator specification looks like: .RS -connection: [&<alias>] +rotator: &<alias> .RS accepter: <accepter> .br @@ -470,8 +460,8 @@ .RE .RE -A rotator two possible options, "authdir", and "accepter-retry-time", -both same as connections. +A rotator has two possible options, "authdir", and +"accepter-retry-time", both same as connections. You should use YAML aliases for the connections. @@ -971,16 +961,29 @@ .PP to generate the default keys in /etc/ser2net (or wherever). The certificate/key will be named /etc/ser2net/ser2net.crt|key. + +.B NOTE: +If you compile ser2net yourself, by default autoconf sets the system +configuration directory (normally /etc) as /usr/etc. This is a major +annoyance with autoconf. So if you don't change it, you would need +/usr/etc above where it says /etc. However, generally the right way to +do this is to add "--sysconfdir=/etc" to the configure command line +when you configure ser2net. If a distro has compiled ser2net for you, +that should have done that by default, so no worries in that case. + Then copy ser2net.crt over to the user system and provide it to connection commands, like: .IP gensiot telnet,ssl(CA=ser2net.crt),<server>,1234 +.PP +or +.IP telnet -z ssl,secure,cacert=ser2net.crt 1234 .PP Then you will have an encrypted connection. Just make sure your certificates are valid. .PP -Note that the "-<server>" at the end of the key is important because it +Note that the "-ser2net" at the end of the key is important because it make the subject name of the certificate more unique. You can really put anything you want for what you provide to keygen, as long as you rename it properly. That will be the subject name of the certificate. @@ -1000,7 +1003,7 @@ default <authdir> is /usr/share/ser2net/auth, but you can change that with the authdir default in the ser2net config file or by setting authdir on individual connections (in case you want differet -ones for different ports). You then much rehash the allowed_certs +ones for different ports). You then must rehash the allowed_certs directory: .IP gtlssh-keygen rehash <authdir>/username/allowed_certs @@ -1013,9 +1016,9 @@ telnet -z ssl,secure,cacert=ser2net.crt,cert=username.crt,key=username.key server 1234 .PP .SS "AUTHENTICATION WITH CERTAUTH (GTLSSH)" -All of the above is a big pain. Fortunately there is an easier -way. gtlssh is a ssh-like program, but runs over TLS and it -implements a custom ssh-like authentication protocol. +All of the above is a big pain. Fortunately there is an easier way. +gtlssh is a ssh-like program, but runs over TLS and it implements a +ssh-like authentication protocol using the certauth gensio. ser2net supports this authentication system running on top of the ssl and certauth gensios. Those gensios provide the framework @@ -1049,7 +1052,7 @@ .PP The --nosctp thing keep gtlssh from trying sctp, which will fail because we put tcp in the port line. You could use sctp there and -get all it's advantages for free! Then --nosctp would no longer +get all its advantages for free! Then --nosctp would no longer be required to avoid the nagging. The username is optional if it's the same as your current user. @@ -1092,7 +1095,7 @@ and make the appropriate changes. If an inuse port is changed or deleted, the actual change will not occur until the port is disconnected. -.SH "Error" +.SH "ERRORS" Almost all error output goes to syslog, not standard output. .SH "FILES" @@ -1103,8 +1106,7 @@ ser2net(8) telnet(1), hosts_access(5), gensio(5), gtlssh(1), gtlssh-keygen(1) .SH "KNOWN PROBLEMS" -Using serial ports with fork() and UUCP locking can result in wrong -behavior. See the serialdev section for details. +If they were known, they would be fixed :). .SH AUTHOR .PP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ser2net-4.1.8/tests/Makefile.am new/ser2net-4.2.0/tests/Makefile.am --- old/ser2net-4.1.8/tests/Makefile.am 2020-05-13 00:42:57.000000000 +0200 +++ new/ser2net-4.2.0/tests/Makefile.am 2020-06-28 20:27:05.000000000 +0200 @@ -25,7 +25,8 @@ test_xfer_small_ipmisol.py test_xfer_small_sctp.py \ test_xfer_large_stdio.py test_xfer_large_tcp.py \ test_xfer_large_telnet.py test_xfer_large_ssl_tcp.py \ - test_xfer_large_ipmisol.py test_xfer_large_sctp.py + test_xfer_large_ipmisol.py test_xfer_large_sctp.py \ + test_xfer_large_udp.py EXTRA_DIST = $(TESTS) utils.py dataxfer.py ipmisimdaemon.py termioschk.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ser2net-4.1.8/tests/ipmisimdaemon.py new/ser2net-4.2.0/tests/ipmisimdaemon.py --- old/ser2net-4.1.8/tests/ipmisimdaemon.py 2020-05-13 00:42:57.000000000 +0200 +++ new/ser2net-4.2.0/tests/ipmisimdaemon.py 2020-06-28 20:27:05.000000000 +0200 @@ -101,7 +101,7 @@ # the ipmisim daemon printed. #self.handler.debug = 2 - self.pid = self.io.remote_id() + self.pid = utils.remote_id_int(self.io) self.handler.set_waitfor("> ") if (self.handler.wait_timeout(2000) == 0): raise Exception("Timeout waiting for ipmi_sim to start") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ser2net-4.1.8/tests/termioschk.py new/ser2net-4.2.0/tests/termioschk.py --- old/ser2net-4.1.8/tests/termioschk.py 2020-05-13 00:42:57.000000000 +0200 +++ new/ser2net-4.2.0/tests/termioschk.py 2020-06-28 20:27:05.000000000 +0200 @@ -80,7 +80,7 @@ expected_termios = handler.op(io1, io2) - io2_rem_termios = get_remote_termios(io2.remote_id()) + io2_rem_termios = get_remote_termios(utils.remote_id_int(io2)) c = compare_termios(expected_termios, io2_rem_termios) if (c != -1): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ser2net-4.1.8/tests/test_rfc2217.py new/ser2net-4.2.0/tests/test_rfc2217.py --- old/ser2net-4.1.8/tests/test_rfc2217.py 2020-05-13 00:42:57.000000000 +0200 +++ new/ser2net-4.2.0/tests/test_rfc2217.py 2020-06-28 20:27:05.000000000 +0200 @@ -345,30 +345,30 @@ io1.read_cb_enable(True); io2.read_cb_enable(True); - set_remote_null_modem(io2.remote_id(), False); + set_remote_null_modem(utils.remote_id_int(io2), False); val = sio1.sg_dtr_s(0) if (val != gensio.SERGENSIO_DTR_ON): raise Exception("Expected DTR on at start, got %d" % val); - val = get_remote_modem_ctl(io2.remote_id()) + val = get_remote_modem_ctl(utils.remote_id_int(io2)) if (not (val & SERIALSIM_TIOCM_DTR)): raise Exception("Expected remote DTR on at start"); val = sio1.sg_dtr_s(gensio.SERGENSIO_DTR_OFF) if (val != gensio.SERGENSIO_DTR_OFF): raise Exception("Expected DTR off"); - val = get_remote_modem_ctl(io2.remote_id()) + val = get_remote_modem_ctl(utils.remote_id_int(io2)) if (val & SERIALSIM_TIOCM_DTR): raise Exception("Expected remote DTR off"); val = sio1.sg_dtr_s(gensio.SERGENSIO_DTR_ON) if (val != gensio.SERGENSIO_DTR_ON): raise Exception("Expected DTR on"); - val = get_remote_modem_ctl(io2.remote_id()) + val = get_remote_modem_ctl(utils.remote_id_int(io2)) if (not (val & SERIALSIM_TIOCM_DTR)): raise Exception("Expected remote DTR on"); - set_remote_null_modem(io2.remote_id(), True); + set_remote_null_modem(utils.remote_id_int(io2), True); utils.finish_2_ser2net(ser2net, io1, io2, handle_except = False) print(" Success!") return @@ -398,30 +398,30 @@ io1.read_cb_enable(True); io2.read_cb_enable(True); - set_remote_null_modem(io2.remote_id(), False); + set_remote_null_modem(utils.remote_id_int(io2), False); val = sio1.sg_rts_s(0) if (val != gensio.SERGENSIO_RTS_ON): raise Exception("Expected RTS on at start, got %d" % val); - val = get_remote_modem_ctl(io2.remote_id()) + val = get_remote_modem_ctl(utils.remote_id_int(io2)) if (not (val & SERIALSIM_TIOCM_RTS)): raise Exception("Expected remote RTS on at start"); val = sio1.sg_rts_s(gensio.SERGENSIO_RTS_OFF) if (val != gensio.SERGENSIO_RTS_OFF): raise Exception("Expected RTS off"); - val = get_remote_modem_ctl(io2.remote_id()) + val = get_remote_modem_ctl(utils.remote_id_int(io2)) if (val & SERIALSIM_TIOCM_RTS): raise Exception("Expected remote RTS off"); val = sio1.sg_rts_s(gensio.SERGENSIO_RTS_ON) if (val != gensio.SERGENSIO_RTS_ON): raise Exception("Expected RTS on"); - val = get_remote_modem_ctl(io2.remote_id()) + val = get_remote_modem_ctl(utils.remote_id_int(io2)) if (not (val & SERIALSIM_TIOCM_RTS)): raise Exception("Expected remote RTS on"); - set_remote_null_modem(io2.remote_id(), True); + set_remote_null_modem(utils.remote_id_int(io2), True); utils.finish_2_ser2net(ser2net, io1, io2, handle_except = False) print(" Success!") return @@ -441,8 +441,8 @@ o = utils.o ser2net, io1, io2 = utils.setup_2_ser2net(o, config, io1str, io2str, do_io1_open = False) - set_remote_null_modem(io2.remote_id(), False); - set_remote_modem_ctl(io2.remote_id(), (SERIALSIM_TIOCM_CAR | + set_remote_null_modem(utils.remote_id_int(io2), False); + set_remote_modem_ctl(utils.remote_id_int(io2), (SERIALSIM_TIOCM_CAR | SERIALSIM_TIOCM_CTS | SERIALSIM_TIOCM_DSR | SERIALSIM_TIOCM_RNG) << 16) @@ -458,7 +458,7 @@ io1.handler.set_expected_modemstate(gensio.SERGENSIO_MODEMSTATE_CD_CHANGED | gensio.SERGENSIO_MODEMSTATE_CD) - set_remote_modem_ctl(io2.remote_id(), ((SERIALSIM_TIOCM_CAR << 16) | + set_remote_modem_ctl(utils.remote_id_int(io2), ((SERIALSIM_TIOCM_CAR << 16) | SERIALSIM_TIOCM_CAR)) if (io1.handler.wait_timeout(2000) == 0): raise Exception("%s: %s: Timed out waiting for modemstate 2" % @@ -467,7 +467,7 @@ io1.handler.set_expected_modemstate(gensio.SERGENSIO_MODEMSTATE_DSR_CHANGED | gensio.SERGENSIO_MODEMSTATE_CD | gensio.SERGENSIO_MODEMSTATE_DSR) - set_remote_modem_ctl(io2.remote_id(), ((SERIALSIM_TIOCM_DSR << 16) | + set_remote_modem_ctl(utils.remote_id_int(io2), ((SERIALSIM_TIOCM_DSR << 16) | SERIALSIM_TIOCM_DSR)) if (io1.handler.wait_timeout(2000) == 0): raise Exception("%s: %s: Timed out waiting for modemstate 3" % @@ -477,7 +477,7 @@ gensio.SERGENSIO_MODEMSTATE_CD | gensio.SERGENSIO_MODEMSTATE_DSR | gensio.SERGENSIO_MODEMSTATE_CTS) - set_remote_modem_ctl(io2.remote_id(), ((SERIALSIM_TIOCM_CTS << 16) | + set_remote_modem_ctl(utils.remote_id_int(io2), ((SERIALSIM_TIOCM_CTS << 16) | SERIALSIM_TIOCM_CTS)) if (io1.handler.wait_timeout(2000) == 0): raise Exception("%s: %s: Timed out waiting for modemstate 4" % @@ -488,7 +488,7 @@ gensio.SERGENSIO_MODEMSTATE_DSR | gensio.SERGENSIO_MODEMSTATE_CTS | gensio.SERGENSIO_MODEMSTATE_RI) - set_remote_modem_ctl(io2.remote_id(), ((SERIALSIM_TIOCM_RNG << 16) | + set_remote_modem_ctl(utils.remote_id_int(io2), ((SERIALSIM_TIOCM_RNG << 16) | SERIALSIM_TIOCM_RNG)) if (io1.handler.wait_timeout(2000) == 0): raise Exception("%s: %s: Timed out waiting for modemstate 5" % @@ -498,7 +498,7 @@ gensio.SERGENSIO_MODEMSTATE_CD_CHANGED | gensio.SERGENSIO_MODEMSTATE_DSR_CHANGED | gensio.SERGENSIO_MODEMSTATE_CTS_CHANGED) - set_remote_modem_ctl(io2.remote_id(), (SERIALSIM_TIOCM_CAR | + set_remote_modem_ctl(utils.remote_id_int(io2), (SERIALSIM_TIOCM_CAR | SERIALSIM_TIOCM_CTS | SERIALSIM_TIOCM_DSR | SERIALSIM_TIOCM_RNG) << 16) @@ -512,7 +512,7 @@ gensio.SERGENSIO_MODEMSTATE_CD | gensio.SERGENSIO_MODEMSTATE_DSR | gensio.SERGENSIO_MODEMSTATE_CTS) - set_remote_null_modem(io2.remote_id(), True); + set_remote_null_modem(utils.remote_id_int(io2), True); if (io1.handler.wait_timeout(2000) == 0): raise Exception("%s: %s: Timed out waiting for modemstate 7" % ("test dtr", io1.handler.name)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ser2net-4.1.8/tests/test_xfer_large_udp.py new/ser2net-4.2.0/tests/test_xfer_large_udp.py --- old/ser2net-4.1.8/tests/test_xfer_large_udp.py 1970-01-01 01:00:00.000000000 +0100 +++ new/ser2net-4.2.0/tests/test_xfer_large_udp.py 2020-06-28 20:27:05.000000000 +0200 @@ -0,0 +1,15 @@ +#!/usr/bin/python3 + +import os +import gensio +from dataxfer import test_transfer + +rb = os.urandom(1048576) + +test_transfer("udp large random", rb, + ("connection: &con", + " accepter: relpkt,udp,3023", + " connector: serialdev,/dev/ttyPipeA1,115200n81"), + "relpkt,udp,localhost,3023", + "serialdev,/dev/ttyPipeB1,115200N81", + timeout=150000) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ser2net-4.1.8/tests/utils.py new/ser2net-4.2.0/tests/utils.py --- old/ser2net-4.1.8/tests/utils.py 2020-05-13 00:42:57.000000000 +0200 +++ new/ser2net-4.2.0/tests/utils.py 2020-06-28 20:27:05.000000000 +0200 @@ -514,7 +514,7 @@ self.err.open_s() self.err.closeme = True - self.pid = self.io.remote_id() + self.pid = remote_id_int(self.io) self.handler.set_waitfor("Ready\n") if (self.handler.wait_timeout(2000) == 0): raise Exception("Timeout waiting for ser2net to start") @@ -754,3 +754,6 @@ srcdir = os.path.dirname(sys.argv[0]) if (not srcdir): srcdir = "." + +def remote_id_int(io): + return int(io.control(0, True, gensio.GENSIO_CONTROL_REMOTE_ID, None))
