summaryrefslogtreecommitdiff
path: root/src/test/test-in-addr-util.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-06-22 22:28:46 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-06-22 22:34:26 +0900
commita32badc5a6c3f1bbf27250a12830908bd0fd20e8 (patch)
treefdbecf1fc3583890b8b744057ecec16c9091acd6 /src/test/test-in-addr-util.c
parentb48ed70c79c6482e1f39b77d16e62043ff5042a5 (diff)
downloadsystemd-a32badc5a6c3f1bbf27250a12830908bd0fd20e8.tar.gz
Revert "networkd: NetLabel integration"
This reverts PR #23269 and its follow-up commit. Especially, 2299b1cae32c1fb8911da0ce26efced68032f4f8 (partially), and 3cf63830acdef9d8afdc9ef1cf25aa7e85a5e4d5. The PR was merged without final approval, and has several issues: - The NetLabel for static addresses are not assigned, as labels are stored in the Address objects managed by Network, instead of Link. - If NetLabel is specified for a static address, then the address section will be invalid and the address will not be configured, - It should be implemented with Request object, - There is no test about the feature.
Diffstat (limited to 'src/test/test-in-addr-util.c')
-rw-r--r--src/test/test-in-addr-util.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/test/test-in-addr-util.c b/src/test/test-in-addr-util.c
index 623e9f831e..f5dcad65d5 100644
--- a/src/test/test-in-addr-util.c
+++ b/src/test/test-in-addr-util.c
@@ -364,35 +364,4 @@ TEST(in_addr_to_string) {
test_in_addr_to_string_one(AF_INET6, "fe80::");
}
-TEST(in_addr_prefixlen_to_netmask) {
- union in_addr_union addr;
- static const char *const ipv4_netmasks[] = {
- "0.0.0.0", "128.0.0.0", "192.0.0.0", "224.0.0.0", "240.0.0.0",
- "248.0.0.0", "252.0.0.0", "254.0.0.0", "255.0.0.0",
- "255.128.0.0", "255.192.0.0", "255.224.0.0", "255.240.0.0",
- "255.248.0.0", "255.252.0.0", "255.254.0.0", "255.255.0.0",
- "255.255.128.0", "255.255.192.0", "255.255.224.0", "255.255.240.0",
- "255.255.248.0", "255.255.252.0", "255.255.254.0", "255.255.255.0",
- "255.255.255.128", "255.255.255.192", "255.255.255.224", "255.255.255.240",
- "255.255.255.248", "255.255.255.252", "255.255.255.254", "255.255.255.255",
- };
-
- for (unsigned char prefixlen = 0; prefixlen <= 32; prefixlen++) {
- _cleanup_free_ char *r = NULL;
-
- assert_se(in_addr_prefixlen_to_netmask(AF_INET, &addr, prefixlen) >= 0);
- assert_se(in_addr_to_string(AF_INET, &addr, &r) >= 0);
- printf("test_in_addr_prefixlen_to_netmask: %s == %s\n", ipv4_netmasks[prefixlen], r);
- assert_se(streq(ipv4_netmasks[prefixlen], r));
- }
-
- for (unsigned char prefixlen = 0; prefixlen <= 128; prefixlen++) {
- _cleanup_free_ char *r = NULL;
-
- assert_se(in_addr_prefixlen_to_netmask(AF_INET6, &addr, prefixlen) >= 0);
- assert_se(in_addr_to_string(AF_INET6, &addr, &r) >= 0);
- printf("test_in_addr_prefixlen_to_netmask: %s\n", r);
- }
-}
-
DEFINE_TEST_MAIN(LOG_DEBUG);