summaryrefslogtreecommitdiffstats
path: root/tcpip/rip98d.c
Commit message (Collapse)AuthorAgeFilesLines
* treewide: Remove useless casts from bind() pointer argument.Ralf Baechle2017-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | This is using the following semantic patch: @bind@ type T; expression A, C; struct sockaddr *B; @@ - bind(A, (struct sockaddr *) B, C) + bind(A, B, C) @bind_in@ type T; expression A, C; struct sockaddr_in *B; @@ - bind(A, (struct sockaddr *) B, C) + bind(A, B, C) Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* treewide: Remove useless casts from memset pointer argument.Ralf Baechle2017-08-031-1/+1
| | | | | | | | | | | | | This is using the following semantic patch: @memset@ type T; expression A, B, C; @@ - memset((T *)A, B, C) + memset(A, B, C) Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* treewide: Remove useless casts from memcpy pointer arguments.Ralf Baechle2017-08-031-1/+2
| | | | | | | | | | | | | | | | | | | This is using the following semantic patch: @memcpy1@ type T; expression A, B, C; @@ - memcpy((T *)A, B, C) + memcpy(A, B, C) @memcpy2@ type T; expression A, B, C; @@ - memcpy(A, (T *)B, C) + memcpy(A, B, C) Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* rip98d: Perform a crapectomy on hex2intrev().Ralf Baechle2017-08-031-46/+4
| | | | | | | | | | | | | hex2intrev is a hilariously complicated function which combine parsing a hexadecimal integer in network byte order and swapping the result to host byte order. Move the endianess swapping to the caller which allows to remove double endianess swapping. Now that hex2intrev no longer deals with byte order rename it to hex2int and replace its implementation with a simple invocation of strtoul. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* rip98d: Replace naive mask2bits and bits2mask implementations.Ralf Baechle2017-08-031-50/+7
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* rip98d: Change bits2mask's return value from unsigned long to unsigned int.Ralf Baechle2017-08-011-1/+1
| | | | | | An IPv4 mask fit into an unsigned int. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* rip98d: Change mask2bits's argument from unsigned long to unsigned int.Ralf Baechle2017-08-011-1/+1
| | | | | | An IPv4 address or mask fits into an unsigned int. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* treewide: Kill assignments in if conditions.Ralf Baechle2017-07-311-6/+12
| | | | | | | | | | | | | | | | | | | | 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>
* rip98d: Fix warning.Ralf Baechle2017-01-261-1/+2
| | | | | | | | | | 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 rip98d.o -MD -MP -MF .deps/rip98d.Tpo -c -o rip98d.o rip98d.c rip98d.c: In function ‘read_routes’: rip98d.c:189:33: warning: format ‘%X’ expects argument of type ‘unsigned int *’, but argument 6 has type ‘int *’ [-Wformat=] n = sscanf(buffer, "%s %s %s %X %d %d %d %s %d %d\n", ^ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Add a git suffix to the version number used by all programs.Ralf Baechle2017-01-241-1/+2
| | | | | | | This uses a setlocalversion script derived from the kernel's scripts/setlocalversion. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Reformat consistently. Strictly whitespace changes only.Ralf Baechle2013-06-171-23/+23
| | | | | | | Indentation by tabs only. Move case labels in switches are on the same level as the switch keyword. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Remove useless initializations to 0 or NULL.Ralf Baechle2013-06-171-2/+2
| | | | | | | They only inflate the .data section of the binary. Initializations to FALSE are still left to do. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Nuke trailing whitespace.Ralf Baechle2013-06-171-15/+15
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* renamed variable "restrict" to "route_restrict"Thomas Osterried2012-10-011-5/+5
| | | | | | | | debian Bug#689322: "restrict" is a keyword in C99 tcpip/rip98d.c uses "restrict" as a variable name. This collides with the fact that in C99 "restrict" is a keyword. Compilers that default to C99-mode, or gcc -std=c99, fail to compile this code.
* added remaining sys/time.h includes for ppcCraig Small2002-06-191-0/+1
|
* fixed sockaddr problem and moved b* to mem* functionsCraig Small2001-05-031-4/+8
|
* Import ax25-tools 0.0.1 from tarballax25-tools-0.0.1Ralf Baechle1999-04-211-0/+360