Commit Graph

29 Commits

Author SHA1 Message Date
prx
3642040f5c factorize #3:ban + simpler runcmd 2023-09-03 15:33:28 +02:00
prx
b452300021 less verbose logs 2023-09-03 15:24:29 +02:00
prx
fc07398e49 factorize #2: watch event + fix bug listening a bad file descriptor 2023-09-03 15:10:30 +02:00
prx
fe6a3a32ae factorize \#1: server setup 2023-09-02 15:59:07 +02:00
prx
493dac653d add -t and -p flags to specify table name and port 2023-06-13 10:35:54 +02:00
prx
ba85c1dc9b change to avoid zombies 2023-05-12 12:10:38 +02:00
prx
0265627230 make sure table arg is considered 2022-10-12 22:01:34 +02:00
prx
e364ce9780 listen on localhost, both ipv4 and ipv6 if available. Use kqueue to handle many connections 2022-10-12 21:43:44 +02:00
prx
0662ac5bfa fix duplicate processes 2022-10-08 21:40:27 +02:00
prx
29a5701dee use signal to reap zombies, still WIP 2022-10-08 21:16:32 +02:00
prx
6b6bab5400 add mandatory message 2022-10-08 14:20:01 +02:00
prx
92e8239a50 iblock is now its own server. inetd is no longer required.
Some minor changes too:
* doas is called with flag "-n", this avoid blocking iblock if doas ismisconfigured.
* pfctl calls are run in separate fork process
* iblock listening port is now the better 2507 instead of already used by other softwares 666.
* Added a rc script to start iblock as daemon.
2022-10-08 14:08:57 +02:00
Omar Polo
5ac1e2631b Don't need to copy strings around and hardcode the max table len from pf
internals, just assign a pointer (eventually from argv.)

while here also add a usage() function and error if more than one
argument are passed.
2022-09-24 19:40:39 +02:00
prx
b95e736dc7 add fork check for error and reformat 2022-09-18 14:43:53 +02:00
Solene Rapenne
1f21555152 iblock: kill established connections after the ban 2022-09-17 16:52:03 +02:00
prx
3cadbbe7df no need to look in PATH 2022-08-22 15:02:17 +02:00
prx
9b755ab627 typo 2022-08-22 14:56:35 +02:00
prx
28eb2bfbeb if and switch aren't functions 2022-08-22 14:56:21 +02:00
prx
7c1edb0feb remove useless {} 2022-08-22 14:55:45 +02:00
prx
2b226c9a02 initialize variables, use strlcpy return value 2022-08-22 14:55:25 +02:00
prx
f9d12c9ef5 avoid colision with common table names 2022-08-22 14:50:40 +02:00
prx
7f474df2ee set TABLE_LEN according to pf source 2022-08-22 14:50:27 +02:00
prx
461451d717 Make use of doas mandatory to avoid running iblock as root. 2021-03-20 11:42:00 +01:00
Solene Rapenne
8d03bbd483 Add IPv6 support + many others improvements. Patch from prx@ybad.name 2021-03-10 22:34:50 +01:00
Solene Rapenne
da5ea6f65c use smaller char array for storing host and port 2021-03-01 23:12:11 +01:00
Solene Rapenne
517c24f322 Fix a check issue, from Quentin Rameau 2021-02-28 17:31:08 +01:00
Solene Rapenne
629d57262a Enable blocking as root, ipv4 only 2021-02-28 14:07:01 +01:00
Solene Rapenne
a6e23e761b Add a pfctl call + syslog 2021-02-28 10:54:36 +01:00
Solene Rapenne
40f8a39e3d skeleton 2021-02-26 00:10:12 +01:00