View Issue Details

IDProjectCategoryView StatusLast Update
0008049GNUnetutil librarypublic2024-03-07 20:26
Reporterfefe Assigned ToChristian Grothoff  
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 20:09

manager   ~0020854

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

Christian Grothoff

2024-01-09 20:09

manager   ~0020855

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

schanzen

2024-03-07 20:26

administrator   ~0021797

0.21 released

Issue History

Date Modified Username Field Change
2024-01-09 18:17 fefe New Issue
2024-01-09 20:09 Christian Grothoff Note Added: 0020854
2024-01-09 20:09 Christian Grothoff Assigned To => Christian Grothoff
2024-01-09 20:09 Christian Grothoff Status new => resolved
2024-01-09 20:09 Christian Grothoff Resolution open => fixed
2024-01-09 20:09 Christian Grothoff Note Added: 0020855
2024-01-09 20:10 Christian Grothoff Project Taler => GNUnet
2024-01-09 20:10 Christian Grothoff Category other => util library
2024-03-07 20:26 schanzen Fixed in Version => 0.21.0
2024-03-07 20:26 schanzen Note Added: 0021797
2024-03-07 20:26 schanzen Status resolved => closed