Page MenuHomeFreeBSD

sucanjan_gmail.com (Ján Sučan)
User

Projects

User does not belong to any projects.

User Details

User Since
Jul 24 2019, 3:40 PM (12 w, 2 d)

Recent Activity

Thu, Sep 19

sucanjan_gmail.com added a comment to D21434: ping6: separate command line tokens parsing from processing of the option arguments.

The parametrization using macros is possible. However, it probably means having the loop defined in a header file and not using an include guard in it so it can be included twice in a single source file. The single parametrized loop would contain cases for options of the two loops (new and compat). If some new options are added in the future, it would be more clear to a reader to have two separate loops at a source level.

Thu, Sep 19, 3:48 PM

Sep 8 2019

sucanjan_gmail.com added a comment to D21434: ping6: separate command line tokens parsing from processing of the option arguments.

I would like to stick with C, but after some basic experiments it seems that it's not possible to use a C preprocessor to parametrize function names. I'm going to do some research on this.

Sep 8 2019, 8:57 PM

Sep 7 2019

sucanjan_gmail.com added a comment to D21434: ping6: separate command line tokens parsing from processing of the option arguments.

Aha, to me it's similar to C++ templates. So there would be only one getopt loop at a source level, and two getopt loops at an object level. The two getopt loops (for the ping6's new option set and for the old one) would be called from a single source file like this:

if (strcmp(argv[0], "ping6") == 0)
    parse_old_options();
else
    parse_new_options();

so the name of the parse function would also need to be parametrized to avoid conflicts of symbols at the object level.

Sep 7 2019, 7:03 PM

Sep 6 2019

sucanjan_gmail.com added a comment to D21434: ping6: separate command line tokens parsing from processing of the option arguments.

The single getopt loop would have to be parametrized at runtime. How do the preprocessor directives fit into this?

Sep 6 2019, 7:51 PM

Sep 4 2019

sucanjan_gmail.com added a comment to D21434: ping6: separate command line tokens parsing from processing of the option arguments.

Does it mean that there could be only one getopt loop with a variable getopt string for solving the compatibility problem?

Yes, exactly.

Sep 4 2019, 7:33 PM
sucanjan_gmail.com added a comment to D21434: ping6: separate command line tokens parsing from processing of the option arguments.

I need to be sure I understand you correctly.

Sep 4 2019, 10:05 AM

Sep 3 2019

sucanjan_gmail.com added a comment to D21434: ping6: separate command line tokens parsing from processing of the option arguments.

Well, I'm not sure yet. I see two solutions:

  • to have two different copies of options_parse. A drawback is that even those parts of the getopt loop that don't need to be duplicated would be duplicated.
  • to have another getoptloop only for translating/replacing option names. This loop would be called first when the program is executed in compatibility mode. Then, the options would be processed by the main getop loop. This solution is possible because the sets of options have the same size and there is only renaming of the options.
Sep 3 2019, 8:32 PM
sucanjan_gmail.com added inline comments to D21434: ping6: separate command line tokens parsing from processing of the option arguments.
Sep 3 2019, 6:20 PM
sucanjan_gmail.com updated the diff for D21434: ping6: separate command line tokens parsing from processing of the option arguments.

Remove semantic check of the -c option from options.c.

Sep 3 2019, 6:19 PM

Sep 2 2019

sucanjan_gmail.com updated the diff for D21434: ping6: separate command line tokens parsing from processing of the option arguments.

Rename struct options_processed to struct options.
Move all strto* argument conversion code to options.c.

Sep 2 2019, 7:50 AM

Sep 1 2019

sucanjan_gmail.com added a comment to D21434: ping6: separate command line tokens parsing from processing of the option arguments.

Yes, it's intended. When a pointer to an argument was an output from the getopt loop, it contained information about the value and whether the user provided the argument (there were basically two variables: the pointer itself and data which it was pointing to). When a number is the output, the information about providing an argument is contained in the boolean flag. Another solution would be to restrict range of values returned by strtoul (or use a wider data type) so it's possible to differentiate between return value of strtoul and a value (outside that range) to which the variable is initialized by default.

Sep 1 2019, 5:12 AM

Aug 31 2019

sucanjan_gmail.com added inline comments to D21434: ping6: separate command line tokens parsing from processing of the option arguments.
Aug 31 2019, 7:23 PM
sucanjan_gmail.com added a comment to D21434: ping6: separate command line tokens parsing from processing of the option arguments.

Sort SRCS in the Makefile alphabetically.
Move string-to-number conversion for -b option to options.c.

Aug 31 2019, 7:22 PM
sucanjan_gmail.com added inline comments to D21434: ping6: separate command line tokens parsing from processing of the option arguments.
Aug 31 2019, 11:02 AM

Aug 30 2019

sucanjan_gmail.com added inline comments to D21434: ping6: separate command line tokens parsing from processing of the option arguments.
Aug 30 2019, 8:13 AM

Aug 29 2019

sucanjan_gmail.com added inline comments to D21434: ping6: separate command line tokens parsing from processing of the option arguments.
Aug 29 2019, 6:15 PM
sucanjan_gmail.com added inline comments to D21434: ping6: separate command line tokens parsing from processing of the option arguments.
Aug 29 2019, 2:56 PM

Aug 28 2019

sucanjan_gmail.com added inline comments to D21434: ping6: separate command line tokens parsing from processing of the option arguments.
Aug 28 2019, 4:54 PM

Aug 27 2019

sucanjan_gmail.com added inline comments to D21434: ping6: separate command line tokens parsing from processing of the option arguments.
Aug 27 2019, 8:28 PM
sucanjan_gmail.com added a comment to D21434: ping6: separate command line tokens parsing from processing of the option arguments.

Add copyright information to options.c and options.h.
Use appropriate data types for each option of struct options_processed.

Aug 27 2019, 8:26 PM
sucanjan_gmail.com added a comment to D21434: ping6: separate command line tokens parsing from processing of the option arguments.

I would also like to ask for help with copyright. What should I use if some code is not mine (mainly the #define directives) and some is?

Aug 27 2019, 12:51 PM
sucanjan_gmail.com created D21434: ping6: separate command line tokens parsing from processing of the option arguments.
Aug 27 2019, 12:48 PM

Aug 24 2019

sucanjan_gmail.com added a comment to D21377: ping: merge ping6 to ping.

Add entries to UPDATING and ObsoleteFiles.inc.
Remove ping6 from tools/build/mk/OptionalObsoleteFiles.inc.

Aug 24 2019, 8:33 PM
sucanjan_gmail.com added a comment to D21406: ping: use CMSG_FIRSTHDR() for accessing ancillary data.

msg.msg_controllen must be initialized for CMSG_FIRSTHDR().

Aug 24 2019, 5:26 PM
sucanjan_gmail.com added a comment to D21405: ping: raise WARNS level to 6.

D21406 should fix it.

Aug 24 2019, 4:36 PM
sucanjan_gmail.com created D21406: ping: use CMSG_FIRSTHDR() for accessing ancillary data.
Aug 24 2019, 4:31 PM
sucanjan_gmail.com created D21405: ping: raise WARNS level to 6.
Aug 24 2019, 1:07 PM
sucanjan_gmail.com added a comment to D21377: ping: merge ping6 to ping.

No ping6 in the usage message.

Aug 24 2019, 6:43 AM

Aug 23 2019

sucanjan_gmail.com added inline comments to D21377: ping: merge ping6 to ping.
Aug 23 2019, 9:07 PM
sucanjan_gmail.com added a comment to D21327: ping: fix alignment errors.

Rebase to the git master branch.

Aug 23 2019, 8:50 PM
sucanjan_gmail.com added inline comments to D21377: ping: merge ping6 to ping.
Aug 23 2019, 8:38 PM
sucanjan_gmail.com added inline comments to D21327: ping: fix alignment errors.
Aug 23 2019, 8:24 PM
sucanjan_gmail.com added a comment to D21327: ping: fix alignment errors.

Data type of variable n for return value of pselect doesn't need to be changed.

Aug 23 2019, 8:24 PM
sucanjan_gmail.com added a comment to D21377: ping: merge ping6 to ping.

Sorry, my bad. It's a side effect of arcanist. If you apply a patch, revert the directory, and reapply the patch, any newly created file gets doubled. You need to rm newly created files after "svn revert". I forgot to do that.

Aug 23 2019, 8:15 PM
sucanjan_gmail.com added inline comments to D21377: ping: merge ping6 to ping.
Aug 23 2019, 8:11 PM
sucanjan_gmail.com added a comment to D21377: ping: merge ping6 to ping.

Sort options in the manual page alphabetically.

Aug 23 2019, 8:10 PM
sucanjan_gmail.com added a comment to D21377: ping: merge ping6 to ping.

It will take me some time to find out why. On my system it builds. Could you please send me your main.c? It's interesting that there are double definitions of the functions.

Aug 23 2019, 7:16 PM
sucanjan_gmail.com added inline comments to D21377: ping: merge ping6 to ping.
Aug 23 2019, 5:38 PM
sucanjan_gmail.com added a comment to D21377: ping: merge ping6 to ping.

Use better wording in the manual page.
Keep the history in chronological order.

Aug 23 2019, 5:38 PM
sucanjan_gmail.com added inline comments to D21377: ping: merge ping6 to ping.
Aug 23 2019, 5:10 PM
sucanjan_gmail.com added a comment to D21377: ping: merge ping6 to ping.

Fix typos in the manual page.

Aug 23 2019, 5:10 PM
sucanjan_gmail.com added inline comments to D21377: ping: merge ping6 to ping.
Aug 23 2019, 5:05 PM
sucanjan_gmail.com added a comment to D21377: ping: merge ping6 to ping.

Add missing articles in the manual page.

Aug 23 2019, 5:05 PM
sucanjan_gmail.com added inline comments to D21377: ping: merge ping6 to ping.
Aug 23 2019, 4:53 PM
sucanjan_gmail.com added a comment to D21377: ping: merge ping6 to ping.

Update rescue/rescue/Makefile.
Fix typos in comments in ping.c and ping6.c.

Aug 23 2019, 4:53 PM
sucanjan_gmail.com added a comment to D21377: ping: merge ping6 to ping.

Delete ping6 directory with its remaining content.

Aug 23 2019, 2:12 PM
sucanjan_gmail.com created D21377: ping: merge ping6 to ping.
Aug 23 2019, 2:09 PM
sucanjan_gmail.com created D21374: ping: fix include guard symbol name to reflect the header file name.
Aug 23 2019, 7:03 AM
sucanjan_gmail.com added a comment to D21338: ping6: make lookup of symbolic names in the reply default.

The default behavior has been unified in D21364. This revision is no longer needed and can be abandoned.

Aug 23 2019, 6:22 AM

Aug 22 2019

sucanjan_gmail.com added inline comments to D21345: ping6: Rename options for unifying option parsing with ping.
Aug 22 2019, 7:45 PM
sucanjan_gmail.com added a comment to D21345: ping6: Rename options for unifying option parsing with ping.

Update date in the manual page.
Sort options in the SYNOPSIS section of the manual page alphabetically.
Use -m for hoplimit.
Change -w to -y.
Sort the getopt string alphabetically.
Sort options in the usage message alphabetically.
Reflect change of the -X option name to the test.

Aug 22 2019, 7:42 PM
sucanjan_gmail.com added inline comments to D21364: ping: do numeric-only output by default.
Aug 22 2019, 6:27 PM
sucanjan_gmail.com added a comment to D21364: ping: do numeric-only output by default.

Add an article in the manual page.

Aug 22 2019, 6:26 PM
sucanjan_gmail.com added a comment to D21292: ping6: add a basic test of ping6's functionality.

Add a copyright header with a $FreeBSD$ tag to ping6_test.sh.

Aug 22 2019, 2:59 PM
sucanjan_gmail.com added a comment to D21292: ping6: add a basic test of ping6's functionality.

The copyright header and the tag are going to be added.

Aug 22 2019, 2:50 PM
sucanjan_gmail.com added a comment to D21289: ping: add a basic test of ping's functionality.

Add a copyright header with a $FreeBSD$ tag to ping_test.sh.

Aug 22 2019, 2:45 PM
sucanjan_gmail.com created D21364: ping: do numeric-only output by default.
Aug 22 2019, 8:42 AM
sucanjan_gmail.com added a comment to D21351: ping: do reverse DNS lookup for a reply by default.

Maybe the title of this revision is not completely exact. The F_NUMERIC option flag has been cleared by default so it's more like ping was intended to do reverse lookups by default.

Aug 22 2019, 8:13 AM
sucanjan_gmail.com added a comment to D21292: ping6: add a basic test of ping6's functionality.

Rebase.
Send only one packet.
Filter out TTL value.
Specify packet size on the command line.
Add -X 1 option to reduce time of waiting for the reply.
Add -u option to diff. This makes the result file more readable in case of an error.

Aug 22 2019, 6:46 AM
sucanjan_gmail.com added a comment to D21289: ping: add a basic test of ping's functionality.

Rebase.
Send only one packet.
Add -t 1 option to reduce time of waiting for the reply.

Aug 22 2019, 6:25 AM

Aug 21 2019

sucanjan_gmail.com added a comment to D21327: ping: fix alignment errors.

Change data type of the variable for recvmsg's return value from int to ssize_t.

Aug 21 2019, 9:04 PM
sucanjan_gmail.com added a comment to D21338: ping6: make lookup of symbolic names in the reply default.

D21356 adds -H option to ping . Eventually I decided to keep the default behavior in ping and ping6.

Aug 21 2019, 8:39 PM
sucanjan_gmail.com created D21356: ping: add -H option for enabling reverse DNS lookup.
Aug 21 2019, 8:34 PM
sucanjan_gmail.com added a comment to D21292: ping6: add a basic test of ping6's functionality.

Yes, the TTL will be filtered out. Both ping and ping6 tests will be sending only one packet.

Aug 21 2019, 7:55 PM
sucanjan_gmail.com added a comment to D21338: ping6: make lookup of symbolic names in the reply default.

OK. I will keep -H in ping6 and add it to ping. It will be default in both of them.

Aug 21 2019, 6:02 PM
sucanjan_gmail.com added inline comments to D21327: ping: fix alignment errors.
Aug 21 2019, 5:59 PM
sucanjan_gmail.com added inline comments to D21345: ping6: Rename options for unifying option parsing with ping.
Aug 21 2019, 2:15 PM
sucanjan_gmail.com added a comment to D21338: ping6: make lookup of symbolic names in the reply default.

I suppose I should've said "make ping use pr_addr when it prints the "bytes from" on line 1170", rather than "implement -H" for ping.

Aug 21 2019, 2:03 PM
sucanjan_gmail.com created D21351: ping: do reverse DNS lookup for a reply by default.
Aug 21 2019, 1:57 PM
sucanjan_gmail.com added a comment to D21289: ping: add a basic test of ping's functionality.

Filter out TTL value.
Specify packet size on the command line.
Add -u option to diff. This makes the result file more readable in case of an error.

Aug 21 2019, 1:42 PM
sucanjan_gmail.com added inline comments to D21289: ping: add a basic test of ping's functionality.
Aug 21 2019, 1:30 PM
sucanjan_gmail.com added inline comments to D21327: ping: fix alignment errors.
Aug 21 2019, 7:52 AM
sucanjan_gmail.com added a comment to D21327: ping: fix alignment errors.

Use MIN() instead of a custom conditional expression.

Aug 21 2019, 7:33 AM
sucanjan_gmail.com added inline comments to D21327: ping: fix alignment errors.
Aug 21 2019, 7:03 AM

Aug 20 2019

sucanjan_gmail.com added a comment to D21338: ping6: make lookup of symbolic names in the reply default.

I'm not sure if I understand you correctly.

Aug 20 2019, 5:46 PM
sucanjan_gmail.com added inline comments to D21340: ping: add tests of the Internet checksum function.
Aug 20 2019, 5:36 PM
sucanjan_gmail.com added a comment to D21340: ping: add tests of the Internet checksum function.

Set WARNS to 6 explicitly for tests.

Aug 20 2019, 5:35 PM
sucanjan_gmail.com added inline comments to D21340: ping: add tests of the Internet checksum function.
Aug 20 2019, 4:37 PM
sucanjan_gmail.com added a comment to D21340: ping: add tests of the Internet checksum function.

Correct unaligned data buffer size.

Aug 20 2019, 4:34 PM
sucanjan_gmail.com added inline comments to D21340: ping: add tests of the Internet checksum function.
Aug 20 2019, 4:22 PM
sucanjan_gmail.com added a comment to D21340: ping: add tests of the Internet checksum function.

Add an entry to etc/mtree/BSD.tests.dist.

Aug 20 2019, 4:21 PM
sucanjan_gmail.com created D21345: ping6: Rename options for unifying option parsing with ping.
Aug 20 2019, 4:11 PM
sucanjan_gmail.com added a comment to D21338: ping6: make lookup of symbolic names in the reply default.

Remove 'H' from the getopt() option string.

Aug 20 2019, 3:42 PM
sucanjan_gmail.com created D21340: ping: add tests of the Internet checksum function.
Aug 20 2019, 1:20 PM
sucanjan_gmail.com created D21338: ping6: make lookup of symbolic names in the reply default.
Aug 20 2019, 12:26 PM
sucanjan_gmail.com added inline comments to D21289: ping: add a basic test of ping's functionality.
Aug 20 2019, 7:21 AM
sucanjan_gmail.com added inline comments to D21289: ping: add a basic test of ping's functionality.
Aug 20 2019, 7:18 AM
sucanjan_gmail.com added a comment to D21327: ping: fix alignment errors.

Fix the warning about signed and unsigned type in conditional
expression.

Aug 20 2019, 6:23 AM

Aug 19 2019

sucanjan_gmail.com added a comment to D21327: ping: fix alignment errors.

If the line 1144 is this line

Aug 19 2019, 7:26 PM
sucanjan_gmail.com created D21327: ping: fix alignment errors.
Aug 19 2019, 6:45 PM
sucanjan_gmail.com created D21325: ping: increase buffer size for the string representation of n_time.
Aug 19 2019, 4:59 PM
sucanjan_gmail.com created D21322: ping: fix uninitialized variable warnings when MK_CASPER=no.
Aug 19 2019, 4:15 PM
sucanjan_gmail.com added a comment to D21289: ping: add a basic test of ping's functionality.

Well, I'm not sure. It's not completely useless. It helped me to discover few bugs during development. Maybe we could keep it just for now when there is no better testing employed. Filtering those information out itself could be considered a check because if a string doesn't match the regular expression, it's not filtered out and it's detected. Please, decide. If you close this review (and the one for ping6), I will understand and I will continue without the ATF sh tests.

Aug 19 2019, 3:54 PM
sucanjan_gmail.com added a comment to D21289: ping: add a basic test of ping's functionality.

Use a single tab width in the ATF test script.

Aug 19 2019, 8:05 AM
sucanjan_gmail.com added a comment to D21292: ping6: add a basic test of ping6's functionality.

Use a single tab width in the ATF test script.

Aug 19 2019, 7:45 AM
sucanjan_gmail.com added a comment to D21319: ping6: Fix insufficient privileges bug introduced by r350857.

Yes.

Aug 19 2019, 5:26 AM

Aug 18 2019

sucanjan_gmail.com created D21319: ping6: Fix insufficient privileges bug introduced by r350857.
Aug 18 2019, 7:21 PM
sucanjan_gmail.com added a comment to D21289: ping: add a basic test of ping's functionality.

It seems that that are far more variable parts in the output than I thought. I think the exact ttl value and ordering of responses cannot be relied on either. Is it OK having a test like this with all of that numeric information filetered out?

Aug 18 2019, 10:00 AM

Aug 17 2019

sucanjan_gmail.com added a comment to D21292: ping6: add a basic test of ping6's functionality.

Could I use getaddrinfo command for that? Like this:

Aug 17 2019, 3:34 PM
sucanjan_gmail.com added a comment to D21288: ping: move in_cksum() to a separate source file.

Use copyright information and ID from ping.c in utils.c.

Aug 17 2019, 3:16 PM