We have built BB without NC_SERVER, i.e. without the '-l' option enabled. However, when we run nc (e.g. 'nc -vz google.com 80'), we get an error "nc: NO OPT l!" I suspect this is because the complementary options in nc_bloaty.c define the 'l' option unconditionally in line 794 by mistake: 790 getopt32(argv, "^" 791 "np:s:uvw:+"/* -w N */ IF_NC_SERVER("lk") 792 IF_NC_EXTRA("i:o:z") 793 "\0" 794 "?2:vv:ll", /* max 2 params; -v and -l are counters */ Line 794 should define the complementary option l conditional on NC_SERVER: "?2:vv" IF_NC_SERVER(":ll"), /* max 2 params; -v and -l are counters */
I should have mentioned: we use 1.28.3, downloaded from https://busybox.net/downloads/busybox-1.28.3.tar.
Does this change work? IF_NC_EXTRA("i:o:z") "\0" - "?2:vv:ll", /* max 2 params; -v and -l are counters */ + "?2:vv"IF_NC_SERVER(":ll"), /* max 2 params; -v and -l are counters */
My apologies, I have only noticed now that my email response that I sent back in May to Denys' email did not get attached as a comment, thus my response now also as a comment here: yes, that line change worked perfectly fine for me, when I built 1.28.3 with that change included.