summaryrefslogtreecommitdiffstats
path: root/ax25
Commit message (Collapse)AuthorAgeFilesLines
* treewide: Kill assignments in if conditions.Ralf Baechle2017-07-3112-87/+181
| | | | | | | | | | | | | | | | | | | | Somewhat hard to read and the code base already has many overlong lines. Found with below spatch file and some manual editing in ax25/access.c to restore a comment lost by spatch. @parens@ expression E, F, G; binary operator X; statement S; @@ - if ((E = F) X G) + E = F; + if (E X G) S Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axwrapper: Compute nfds argument of select() instead of using a constant.Ralf Baechle2017-07-261-1/+10
| | | | | | | In particular this remove reliance on how file descriptors are assigned and ensures we don't pass an unnecessarily high nfds argument to select. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axwrapper: Remove unused code resulting in warning.Ralf Baechle2017-07-261-7/+0
| | | | | | | | | | | | | | | | | gcc -g -O2 -Wall -o axspawn axspawn.o access.o md5.o -lax25 -lutil gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/us r/local/var/ax25/"\" -g -O2 -Wall -MT axwrapper.o -MD -MP -MF .deps/axwrapper.Tpo -c -o axwrapper.o axwrapper.c axwrapper.c:49:13: warning: ‘sigchld_handler’ defined but not used [-Wunused-function] static void sigchld_handler(int sig) ^~~~~~~~~~~~~~~ Since 71918b7d4e95 ("axwrapper: Mark functions sigchld_handler and convert_{cr_lf,lf_cr} static.") made sigchld_handler() static gcc was warning about the function being unused. No point in keeping this around; SIGCHLD is perfectly fine. Fixes: 71918b7d4e95 ("axwrapper: Mark functions sigchld_handler and convert_{cr_lf,lf_cr} static.") Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axwrapper: Handle EINTR error return from select().Ralf Baechle2017-07-261-0/+3
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axwrapper: Delete FILES section from man page.Ralf Baechle2017-07-261-1/+0
| | | | | | No files were listed in the FILES section. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* ax25: Delete useless casts of malloc's return value.Ralf Baechle2017-02-062-17/+17
| | | | | | | | | | | | | | | malloc returns a void pointer so no cast is necessary when assigning to a pointer type. Found with below coccinelle script: @malloccast@ type T; @@ - (T *) malloc(...) Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axgetput: Don't check for negative return from strlen.Ralf Baechle2017-02-061-1/+1
| | | | | | | | For one strlen does not return any errors. By its very nature strlen does not return negative results and its return type is size_t which happens to be unsigned. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* mheard: Drop unsatisfiable conditions.Ralf Baechle2017-02-061-2/+2
| | | | | | | | | | | | | | gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -O2 -Wall -Wextra -MT mheard.o -MD -MP -MF .deps/mheard.Tpo -c -o mheard.o mheard.c [...] mheard.c:135:22: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if (pr->entry.type < 0 || pr->entry.type > sizeof(types)) ^ mheard.c:168:22: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if (pr->entry.type < 0 || pr->entry.type > sizeof(types)) ^ [...] Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* ax25d: Fix use of 0 instead of NULL as a pointer value.Ralf Baechle2017-02-061-2/+2
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axwrapper: Fix use of 0 instead of NULL as a pointer value.Ralf Baechle2017-02-061-1/+1
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axgetput: Fix use of 0 instead of NULL as a pointer value.Ralf Baechle2017-02-061-2/+2
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axspawn: Fix use of 0 instead of NULL as a pointer value.Ralf Baechle2017-02-061-6/+6
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axgetput: Fix use of 0 instead of NULL as a pointer value.Ralf Baechle2017-02-061-11/+12
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axspawn: Fix use of 0 instead of NULL as a pointer value.Ralf Baechle2017-02-061-7/+7
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* mheard: Fix use of 0 instead of NULL as a pointer value.Ralf Baechle2017-02-061-5/+5
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axgetput: Make function calc_crc static.Ralf Baechle2017-02-061-1/+1
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axgetput: Include util.h into utilc for the prototypes.Ralf Baechle2017-02-061-0/+1
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axgetput: Make do_version static.Ralf Baechle2017-02-061-1/+1
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axgetput: Move definition of several array from a .h to a .c file.Ralf Baechle2017-02-062-3/+7
| | | | | | And add proper declarations to the header file. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* ax25d: Reorder code to avoid the need for forward declarations.Ralf Baechle2017-02-061-461/+454
| | | | | | And then delete those now useless declarations. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* ax25d: Make several functions static.Ralf Baechle2017-02-061-4/+7
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axparms: Make several functions static.Ralf Baechle2017-02-061-9/+9
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axspawn: Remove unused function Xtoupper().Ralf Baechle2017-02-061-9/+0
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axspawn: Sort out homebrew declaration of forkpty(3).Ralf Baechle2017-02-061-9/+1
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axspawn: Make many functions and variables static.Ralf Baechle2017-02-061-42/+38
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axspawn: Move calc_md5_pw to eleminate need for declaration and make static.Ralf Baechle2017-02-061-30/+29
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axspawn: Make several functions and variables static.Ralf Baechle2017-02-061-11/+8
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axwrapper: Mark functions sigchld_handler and convert_{cr_lf,lf_cr} static.Ralf Baechle2017-02-061-3/+3
| | | | | | | | This results in a new warning about sigchld_handler() being unused which is because the caller is currently commented out which we leave to be sorted out later. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* bpqparms: Fix excessive indentation in usage().Ralf Baechle2017-02-061-4/+4
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* bpqparms: Make functions usage and get_hwaddr static.Ralf Baechle2017-02-061-2/+2
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Remove support for !defined(__GLIBC__) and __GLIBC__ != 2.Ralf Baechle2017-02-063-14/+0
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axspawn: Sort out pointer signedness mess.Ralf Baechle2017-01-261-3/+4
| | | | | | | | | | gcc -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -O2 -Wall -pedantic -MT axspawn.o -MD -MP -MF .deps/axspawn.Tpo -c -o axspawn.o axspawn.c axspawn.c: In function ‘encstathuf’: axspawn.c:555:15: warning: overflow in implicit constant conversion [-Woverflow] dest[0] = 255; ^~~ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Use the right way to get the required feature set from glibc.Ralf Baechle2017-01-262-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __USE_XOPEN doesn't work to get ptsname() etc. from libc. This is Linux-specific software so convert to _GNU_SOURCE. make[2]: Entering directory '/home/ralf/src/ax25/ax25-tools/kiss' gcc -DHAVE_CONFIG_H -I. -I.. -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -O 2 -Wall -pedantic -MT kissattach.o -MD -MP -MF .deps/kissattach.Tpo -c -o kissattach.o kissattach.c kissattach.c: In function ‘main’: kissattach.c:312:18: warning: implicit declaration of function ‘ptsname’ [-Wimplicit-function-declaration] if ((namepts = ptsname(fd)) == NULL) { ^~~~~~~ kissattach.c:312:16: warning: assignment makes pointer from integer without a cast [-Wint-conversion] if ((namepts = ptsname(fd)) == NULL) { ^ kissattach.c:317:7: warning: implicit declaration of function ‘unlockpt’ [-Wimplicit-function-declaration] if (unlockpt(fd) == -1) { ^~~~~~~~ [...] gcc -DHAVE_CONFIG_H -I. -I.. -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -O2 -Wall -pedantic -MT kissnetd.o -MD -MP -MF .deps/kissnetd.Tpo -c -o kissnetd.o kissnetd.c kissnetd.c: In function ‘ReopenPort’: kissnetd.c:134:16: warning: implicit declaration of function ‘ptsname’ [-Wimplicit-function-declaration] if ((npts = ptsname(PortList[PortNumber]->Fd)) == NULL) { ^~~~~~~ kissnetd.c:134:14: warning: assignment makes pointer from integer without a cast [-Wint-conversion] if ((npts = ptsname(PortList[PortNumber]->Fd)) == NULL) { ^ kissnetd.c:143:8: warning: implicit declaration of function ‘unlockpt’ [-Wimplicit-function-declaration] if (unlockpt(PortList[PortNumber]->Fd) == -1) { ^~~~~~~~ [...] gcc -DHAVE_CONFIG_H -I. -I.. -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -O2 -Wall -pedantic -MT mkiss.o -MD -MP -MF .deps/mkiss.Tpo -c -o mkiss.o mkiss.c mkiss.c: In function ‘poll’: mkiss.c:68:15: warning: overflow in implicit constant conversion [-Woverflow] #define FEND 0300 /* Frame End (0xC0) */ ^ mkiss.c:149:14: note: in expansion of macro ‘FEND’ buffer[0] = FEND; ^~~~ mkiss.c:68:15: warning: overflow in implicit constant conversion [-Woverflow] #define FEND 0300 /* Frame End (0xC0) */ ^ mkiss.c:151:14: note: in expansion of macro ‘FEND’ buffer[2] = FEND; ^~~~ mkiss.c: In function ‘main’: mkiss.c:568:16: warning: implicit declaration of function ‘ptsname’ [-Wimplicit-function-declaration] if ((npts = ptsname(pty[i]->fd)) == NULL) { ^~~~~~~ mkiss.c:568:14: warning: assignment makes pointer from integer without a cast [-Wint-conversion] if ((npts = ptsname(pty[i]->fd)) == NULL) { ^ mkiss.c:578:8: warning: implicit declaration of function ‘unlockpt’ [-Wimplicit-function-declaration] if (unlockpt(pty[i]->fd) == -1) { ^~~~~~~~ mkiss.c:672:33: warning: ISO C does not support the ‘%m’ gnu_printf format [-Wformat=] syslog(LOG_ERR, "tty->fd: %m"); ^ mkiss.c:698:38: warning: ISO C does not support the ‘%m’ gnu_printf format [-Wformat=] syslog(LOG_ERR, "pty[%d]->fd: %m\n", i); [...] ^ gcc -DHAVE_CONFIG_H -I. -I.. -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -O2 -Wall -pedantic -MT net2kiss.o -MD -MP -MF .deps/net2kiss.Tpo -c -o net2kiss.o net2kiss.c net2kiss.c: In function ‘main’: net2kiss.c:630:18: warning: implicit declaration of function ‘ptsname’ [-Wimplicit-function-declaration] if ((namepts = ptsname(fdpty)) == NULL) { ^~~~~~~ net2kiss.c:630:16: warning: assignment makes pointer from integer without a cast [-Wint-conversion] if ((namepts = ptsname(fdpty)) == NULL) { ^ net2kiss.c:635:7: warning: implicit declaration of function ‘unlockpt’ [-Wimplicit-function-declaration] if (unlockpt(fdpty) == -1) { ^~~~~~~~ [...] gcc -DHAVE_CONFIG_H -I. -I.. -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -O2 -Wall -pedantic -MT m6pack.o -MD -MP -MF .deps/m6pack.Tpo -c -o m6pack.o m6pack.c m6pack.c: In function ‘main’: m6pack.c:537:16: warning: implicit declaration of function ‘ptsname’ [-Wimplicit-function-declaration] if ((npts = ptsname(pty[i]->fd)) == NULL) { ^~~~~~~ m6pack.c:537:14: warning: assignment makes pointer from integer without a cast [-Wint-conversion] if ((npts = ptsname(pty[i]->fd)) == NULL) { ^ m6pack.c:545:8: warning: implicit declaration of function ‘unlockpt’ [-Wimplicit-function-declaration] if (unlockpt(pty[i]->fd) == -1) { ^~~~~~~~ m6pack.c:626:33: warning: ISO C does not support the ‘%m’ gnu_printf format [-Wformat=] syslog(LOG_ERR, "tty->fd: %m"); ^ m6pack.c:658:29: warning: ISO C does not support the ‘%m’ gnu_printf format [-Wformat=] "pty[%d]->fd: %m\n",i); ^ [...] Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* beacon: Fix confusing indentation.Ralf Baechle2017-01-261-1/+4
| | | | | | | | | | | | beacon.c: In function ‘main’: beacon.c:146:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (addr != NULL) free(addr); addr = NULL; ^~ beacon.c:146:32: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ if (addr != NULL) free(addr); addr = NULL; ^~~~ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* beacon: Fix confusing indentation.Ralf Baechle2017-01-261-1/+4
| | | | | | | | | | | | beacon.c: In function ‘main’: beacon.c:128:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (addr != NULL) free(addr); addr = NULL; ^~ beacon.c:128:32: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ if (addr != NULL) free(addr); addr = NULL; ^~~~ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axspawn: Fix missleading indentation.Ralf Baechle2017-01-261-1/+1
| | | | | | | | | | | axspawn.c:1777:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (pw->pw_dir && *(pw->pw_dir)) ^~ axspawn.c:1779:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ ret = chdir(p); ^~~ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Add a git suffix to the version number used by all programs.Ralf Baechle2017-01-249-10/+20
| | | | | | | This uses a setlocalversion script derived from the kernel's scripts/setlocalversion. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* mheardd: Delete duplicate inclusion of <config.h>.Ralf Baechle2017-01-231-1/+0
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axparms: Fix name of bpqether proc file in man page.Ralf Baechle2017-01-191-1/+1
| | | | | | | As far as I can track this back in history /proc/net/ax25_bpqether has never been correct. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Makefile.am: axwapper.8 was not in the list of the man pages to be installed.Thomas Osterried2016-11-161-2/+2
| | | | Signed-off-by: Thomas Osterried <ax25@x-berg.in-berlin.de>
* got rid of ctime() and using localtime()/strftime().Thomas Osterried2016-07-181-29/+21
| | | | | | Has nicer time representation, too. Signed-off-by: Thomas Osterried <ax25@x-berg.in-berlin.de>
* fix for segfault issue:Thomas Osterried2016-07-181-22/+60
| | | | | | | | | | | | | | | port record data can be garbled. We cannot trust the data. i.e., ctime() returns NULL at time_t 2^33 (72057594037927936). char lh[] was size 30. This is not enough for year > 999999999. also assure that pr->entry.type is < sizeof(types), and in 'case 4:', only up to 8 digipeaters are copied. Thanks to Guido Trentalancia <iz6rdb@trentalancia.net> for the patch. Also changed printf to %u (because mheard's struct has unsigned int values) and enhanced formating (%8 instead of %5). Signed-off-by: Thomas Osterried <ax25@x-berg.in-berlin.de>
* beacon with new option -H: -> beacon intervals relative to the hour.Thomas Osterried2016-07-042-8/+33
| | | | | | Idea by Folkert van Heusden <mail@vanheusden.com>. Signed-off-by: Thomas Osterried <ax25@x-berg.in-berlin.de>
* beacon: new option -f: do not fork.Thomas Osterried2016-07-042-5/+14
| | | | | | patch submitted by Folkert van Heusden <mail@vanheusden.com>. Signed-off-by: Thomas Osterried <ax25@x-berg.in-berlin.de>
* added "-d a" option to mheard:Thomas Osterried2016-07-041-2/+5
| | | | | | | Display the data from c and s combined in one view. Requires wide screen. by Folkert van Heusden <mail@vanheusden.com> Signed-off-by: Thomas Osterried <ax25@x-berg.in-berlin.de>
* added "-d a" option to mheard:Thomas Osterried2016-07-041-8/+63
| | | | | | | Display the data from c and s combined in one view. Requires wide screen. Patch by Folkert van Heusden <mail@vanheusden.com> Signed-off-by: Thomas Osterried <ax25@x-berg.in-berlin.de>
* Fixed regression in axgetput (bget/bput crc was calculated wrong)Thomas Osterried2016-02-121-27/+27
| | | | Signed-off-by: Thomas Osterried <ax25@x-berg.in-berlin.de>
* Fix spelling of "subsequent".Ralf Baechle2015-07-161-1/+1
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Remove all references to axassociate(8) and axsetcall(8).Ralf Baechle2015-07-162-9/+3
| | | | | | | These programs were removed around 20 years ago and today the references only clutter the man pages. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axparms: Accept numeric user ID.Ralf Baechle2015-06-192-7/+22
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>