View Issue Details

IDProjectCategoryView StatusLast Update
0008049GNUnetutil librarypublic2024-03-07 19:26
Reporterfefe Assigned ToChristian Grothoff Due Date
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Fixed in Version0.21.0 
Summary0008049: GNUNET_STRINGS_parse_ipv4_policy: confusing code
DescriptionThis is in gnunet/src/lib/util/strings.c:

```
1300 int slash;

1416 /* try third notation */
1417 slash = 32;

1440 while (slash > 0)
1441 {
1442 result[i].netmask.s_addr = (result[i].netmask.s_addr >> 1) + 0x80000000;
1443 slash--;
1444 }
```

slash will always be 32 when we enter the while-loop in line 1440.
It looks like we could just set netmask.s_addr to 0xffffffff and get rid of the while loop?
TagsNo tags attached.

Activities

Christian Grothoff

2024-01-09 19:09

manager   ~0020854

Setting more than one bit at a time might overheat the CPU ;-).

Christian Grothoff

2024-01-09 19:09

manager   ~0020855

Fixed with tons of other style fixes for that function in 9746a780b..407286ffd

schanzen

2024-03-07 19:26

administrator   ~0021797

0.21 released

Issue History

Date ModifiedUsernameFieldChange
2024-01-09 17:17fefeNew Issue
2024-01-09 19:09Christian GrothoffNote Added: 0020854
2024-01-09 19:09Christian GrothoffAssigned To => Christian Grothoff
2024-01-09 19:09Christian GrothoffStatusnew => resolved
2024-01-09 19:09Christian GrothoffResolutionopen => fixed
2024-01-09 19:09Christian GrothoffNote Added: 0020855
2024-01-09 19:10Christian GrothoffProjectTaler => GNUnet
2024-01-09 19:10Christian GrothoffCategoryother => util library
2024-03-07 19:26schanzenFixed in Version => 0.21.0
2024-03-07 19:26schanzenNote Added: 0021797
2024-03-07 19:26schanzenStatusresolved => closed