Commits
- Commit:
f459035d5797be5280d488d899a5928bcea0e381
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
we use sqlite3_prepare_v2() so sqlite3_step() can return any error code
- Commit:
0b0bdb50885c888de89592492c7198061933689b
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
in sq3simple, replace a handrolled strlen()+malloc() with strdup()
- Commit:
c1f7b2cc26e859c6e29009c1ade477891952159d
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
plug a small memory leak in pr_environment()
- Commit:
c0130f838ee9ccc1da39369dce8119349000c571
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
make 'show arp' respect the current routing table
ok Tom
- Commit:
f9706d00427c6794f1ba7342cf290f7f627254c4
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
make 'flush routes' and 'flush arp' operate on the current rtable
These commands were hard-coded to use rtable 0.
Problem found by Tom.
- Commit:
9f47d3c105eb081e79daab6ad87db92caa6bf1ba
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
have 'flush arp' filter routes to be deleted like 'no arp' and 'arp -d' do
test + ok Tom
- Commit:
e611bb500f7361785dc85a312fcdfd5bf00fba42
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix 'flush arp'; the previous commit changed AF_LINK to AF_INET accidentally
- Commit:
726548d572a41307b43e1288ed24f82b51350c1d
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
Hide informative output of flush routes/arp behind a verbose flag
Suggested by Tom
- Commit:
6ee01971ba6608ecc75f4604494d732471fe2c77
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix error when flush arp/route run into deleted routing table entries
It is possible to get "no such process" (ESRCH) errors during flush
arp or flush route commands due to concurrent deletion of routing
table entries by another process.
This is no reason to stop trying to delete more routes, so do not
abort the loop in this case.
Also, make nsh print a more informative error message in this case,
rather than "no such process". Example of the new error message:
% No such route to delete: 100.64.1.2 fe:e1:ba:d0:8e:45 255.255.255.255 fe:e1:bb:d1:c4:b8 100.64.1.3
Testing + OK Tom
- Commit:
d4510bcfd5422baabd848014c09e477d68a8a772
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
do not try to remove routes for local addresses during 'flush arp'
Attempting this results in "invalid argument" errors from the kernel.
testing + ok Tom
- Commit:
8c06089ad5cd59aaaad887949808bd94a1c77ffb
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Merge pull request #166 from yellowman/fix-flush-pf-cmds
Fix flush pf commands and improve flush documentation
OK STSP
- Commit:
94e2f9700de638cd21a4fe0aa58bf6254215ae02
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix nsh -i/-c appending rules to daemon config files over and over
nsh -i/-c wrote daemon config files in /var/run by opening the file in
append-only mode, adding a single line, closing the file again, and
running chmod on the file. All this over and over, for every line.
This is inefficient and also results in the problem that the full
file content gets re-appended to the file each time nsh -i is run.
Instead, open the file once when a new rules section is encountered,
and close it when a different file needs to be written or when we can
tell that we have left a "rules" section. The last open file might end
up being closed implicitly when nsh -i/-c exits.
While nsh -i should only be run once at boot-time which renders this
issue moot, nsh -c can be run often, and the issue will also trigger
during manual testing of nsh -i which is quite irritating.
testing + OK Tom
- Commit:
cc62bfba2bbada1cb362d12dde73c48ad8542dd1
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Update flush-test.nshrc
update flush test script to remove defunct commands and add new commands related to flush pf
- Commit:
e1e572aed6981d7de50ea265e3360d3a6f006a96
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
prevent leading spaces in rdomain-specific daemon config files
Rules for rdomain-specific daemons have double-indentation in nshrc.
When generating configuration files for daemons strip double-indentation
instead of stripping only one level of indentation.
testing + ok Tom
- Commit:
9c2afa13b94867593a343682d9e4501b1a249a69
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Fix flush pf commands and improve flush documentation
flush nat and flush queues dont work, added in new flush commands to match pfctl -F [modifier]
- Commit:
01bc5d48c9c87c8feffb618640ae989586f58c09
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
convert all command handlers to variadic functions
Resolves dozens of: warning: passing arguments to a function without a
prototype is deprecated in all versions of C and is not supported in C2x
In traditional C the empty argument list () indicates that a function
accepts an arbitrary amount of arguments of arbitary types. A function
which takes no arguments must be declared with a (void) prototype instead.
nsh has been making elaborate use of this feature by defining command handlers
with () and passing arbitrary arguments to handlers depending on the use case.
This coding style is not future-proof. In C++, () means "no arguments", the
same as (void), and clang is now warning about this C feature going away in
C2x, aligning C with C++.
Make nsh future-proof by using variadic function prototypes (...) instead
of () prototypes. Every handler now uses (int argc, char **argv, ...) as
prototype: the argument count, an argument vector, followed by arbitrary
arguments which can be extracted using the va_arg(3) function from stdarg.h.
The variadic part of the argument list can be used to pass arguments of types
other than char * without needing to convert them to strings and back.
Using () as function prototype defeats type-checking done by the compiler,
and the same is true for variadic arguments. We still need to manually make
sure that the correct amount and types of arguments are passed in the variadic
part of the handler's argument list.
Many handlers already use the argument count + argument vector approach and
do not need internal changes, just a new prototype.
Some handlers now require use of va_start/va_arg/va_end to access additional
arguments. For example, the interfaces handlers were passing an interface
name and file descriptor before the argument count/vector. The order of
arguments is now swapped, such that interface name and file descriptor get
passed as part of the variable argument list.
Testing + OK Tom
- Commit:
34841712b18142cef2d1307f14a58d87f0fa14eb
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Create no-config-change-test.nshrc
added these basic test scripts to allow for testing nsh commands
that dont alter configs
- Commit:
c01470d76de8add2ac75ff1569941b9f997eaf06
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Update no-config-change-test.nshrc
remove extra telnet command
and edit telnet command so it fails saying connection refused
- Commit:
462a289a42f01612bb72252bea13a562aa77bb49
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Rename flush-commands-test to flush-test.nshrc
rename flush-commands-test to flush-test.nshrc
- Commit:
59b4c3c0ceefce4a9c3c8a6c2dbaaffbe5f63d7d
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Create flush-commands-test
used to assist in testing nsh
can be run interactively or called in a nsh -c command
- Commit:
d718c3b8fb88be531d442d1e9f9f05cb76bbd56b
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Merge pull request #165 from yellowman/reload-reboot-alias
implement a reload reboot command alias
- Commit:
b96221e6b0fba68943e0414aebee615838bf6e58
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
update K&R-C-style prototypes in kroute.c to modern C
Fixes warning: a function definition without a prototype is deprecated in
all versions of C and is not supported in C2x
- Commit:
e7863f1a59c1ec9ccb34a205c5a02817382af8e0
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
improve readability of reboot and reload help and correct some mandoc style issues
- Commit:
d3156eb934103cf1c3498a8908ef62b7dfa1b4d5
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
implement 'clear' command in interface/bridge mode
resolves warning: unused function 'int_clear' [-Wunused-function]
- Commit:
5aabeb522f621a3b2e1aa2582fa8bc33b11c7bc3
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
add reload alias for reboot command
reload is a common command used to restart routers / switches added a reload alisas and updated the manual to improve the help for the reboot command
reload is added to the list that does not get listed in help / ambiguous checks
trivial Change ...