Re: [PATCH v3] BUG/MINOR: dns: allow 63 char in hostname

2020-01-27 Thread Baptiste
On Sun, Jan 26, 2020 at 8:15 PM Илья Шипицин wrote: > > > вс, 26 янв. 2020 г. в 23:12, William Dauchy : > >> On Sun, Jan 26, 2020 at 7:08 PM Илья Шипицин >> wrote: >> > such things are fragile. once fixed, they can silently break during >> further refactoring. >> > on other hand, such

Re: [PATCH v3] BUG/MINOR: dns: allow 63 char in hostname

2020-01-26 Thread Илья Шипицин
вс, 26 янв. 2020 г. в 23:12, William Dauchy : > On Sun, Jan 26, 2020 at 7:08 PM Илья Шипицин wrote: > > such things are fragile. once fixed, they can silently break during > further refactoring. > > on other hand, such functions are good candidates to write unit tests. > > I considered it but

Re: [PATCH v3] BUG/MINOR: dns: allow 63 char in hostname

2020-01-26 Thread Tim Düsterhus
William, Am 26.01.20 um 19:34 schrieb William Dauchy: > On Sun, Jan 26, 2020 at 7:20 PM Tim Düsterhus wrote: >>> int i; >> >> Consider moving this into the `while` loop to reduce the scope of `i`. > > I'm not against doing this when this is a block condition, but for a > loop, I find it a

Re: [PATCH v3] BUG/MINOR: dns: allow 63 char in hostname

2020-01-26 Thread William Dauchy
Thanks for your review Tim On Sun, Jan 26, 2020 at 7:20 PM Tim Düsterhus wrote: > > int i; > > Consider moving this into the `while` loop to reduce the scope of `i`. I'm not against doing this when this is a block condition, but for a loop, I find it a bit dirty and confusing. > For

Re: [PATCH v3] BUG/MINOR: dns: allow 63 char in hostname

2020-01-26 Thread Tim Düsterhus
Ilya, Am 26.01.20 um 19:06 schrieb Илья Шипицин: > such things are fragile. once fixed, they can silently break during > further refactoring. The function is fairly self contained. I don't expect there to be any need for refactoring. Also the previous version was fairly elaborate for a simple

Re: [PATCH v3] BUG/MINOR: dns: allow 63 char in hostname

2020-01-26 Thread Tim Düsterhus
William, Am 26.01.20 um 18:41 schrieb William Dauchy: > int dns_hostname_validation(const char *string, char **err) > { > - const char *c, *d; > int i; Consider moving this into the `while` loop to reduce the scope of `i`. > + while (*string && *string != '.' && i <

Re: [PATCH v3] BUG/MINOR: dns: allow 63 char in hostname

2020-01-26 Thread William Dauchy
On Sun, Jan 26, 2020 at 7:08 PM Илья Шипицин wrote: > such things are fragile. once fixed, they can silently break during further > refactoring. > on other hand, such functions are good candidates to write unit tests. I considered it but to my knowledge, this is currently not possible with

Re: [PATCH v3] BUG/MINOR: dns: allow 63 char in hostname

2020-01-26 Thread Илья Шипицин
such things are fragile. once fixed, they can silently break during further refactoring. on other hand, such functions are good candidates to write unit tests. maybe we should consider things like cmocka ? вс, 26 янв. 2020 г. в 22:44, William Dauchy : > hostname were limited to 62 char, which

[PATCH v3] BUG/MINOR: dns: allow 63 char in hostname

2020-01-26 Thread William Dauchy
hostname were limited to 62 char, which is not RFC1035 compliant; - the parsing loop should stop when above max label char - fix len label test where d[i] was wrongly used - simplify the whole function to avoid using two extra char* variable this should fix github issue #387 Signed-off-by: