diff --git a/discardd.c b/discardd.c index 3297c92..01b2e1b 100644 --- a/discardd.c +++ b/discardd.c @@ -1,6 +1,6 @@ /* * discard - * Written in 2020 by Lucas + * Written in 2020-2021 by Lucas * CC0 1.0 Universal/Public domain - No rights reserved * * To the extent possible under law, the author(s) have dedicated all @@ -26,6 +26,7 @@ usage(void) int main(int argc, char *argv[]) { + const char *port = NULL; int ch, do_tcp, do_udp; do_tcp = do_udp = 0; @@ -44,6 +45,8 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + port = geteuid() == 0 ? "discard" : "9999"; + if (argc > 0) usage(); if (!do_tcp && !do_udp)