mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
CLEANUP: standard: Use len2mask4 in str2mask
The len2mask4 function was introduced in commit: 70473a5f8c56d8ec2e837b9b66443dc252b24da9 which is about six years later than the commit that introduced the str2mask function: 2937c0dd20f2f3c0065b671bbfe3fafcd8862eaf This is a clean up in preparation for a str2mask6 function which will use len2mask6.
This commit is contained in:
parent
92bb034209
commit
8575f72e93
@ -1022,10 +1022,8 @@ int str2mask(const char *str, struct in_addr *mask)
|
||||
|
||||
if (!*str || (err && *err) || (unsigned)len > 32)
|
||||
return 0;
|
||||
if (len)
|
||||
mask->s_addr = htonl(~0UL << (32 - len));
|
||||
else
|
||||
mask->s_addr = 0;
|
||||
|
||||
len2mask4(len, mask);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user