packages/net/addrwatch/patches/002-fix-uclibc-sysconf.patch
Ondřej Caletka 3c3063e2df addrwatch: new package
Maintainer: Ondrej Caletka / @Oskar456
Compile tested: TurrisOS 3.1 (fork of OpenWRT Chaos Calmer), Trunk (both uClibC and musl)
Run tested: mpc85xx - Turris 1.0 -  TurrisOS - no problems observed
Upstream: https://github.com/fln/addrwatch / @fln

Description:

This is a tool similar to arpwatch. It's main purpose is to monitor network
and log discovered ethernet/ip pairings.

The package has been UCIfied, care has been taken to reload the deamon
every time an interface goes up or down.

Signed-off-by: Ondřej Caletka <ondrej@caletka.cz>
2016-07-14 18:32:29 +02:00

11 lines
375 B
Diff

--- a/src/addrwatch.c
+++ b/src/addrwatch.c
@@ -492,7 +492,7 @@ int main(int argc, char *argv[])
argp_parse(&argp, argc, argv, 0, &optind, 0);
if (!cfg.hostname) {
- cfg.hostname_len = sysconf(_SC_HOST_NAME_MAX);
+ cfg.hostname_len = HOST_NAME_MAX;
cfg.hostname = (char *)calloc(cfg.hostname_len, sizeof(char));
gethostname(cfg.hostname, cfg.hostname_len);
}