do not rely on the uninitialized bits on stack for testing, otherwise
there is chance that we have following test failure:
64: ../src/test/test_ipaddr.cc:226: Failure
64: Expected equality of these values:
64: two.ifa_addr
64: Which is: 127.0.0.1:57677
64: result
64: Which is: 127.0.0.1:57677
the root cause is just that the "result" is actually `one.ifa_addr`,
which is marked UP as that's what the uninitialized bits on stack
indicate.
Signed-off-by: Kefu Chai <kchai@redhat.com>
struct sockaddr_in a_three;
one.ifa_next = &two;
+ one.ifa_flags &= ~IFF_UP;
one.ifa_addr = (struct sockaddr*)&a_one;
one.ifa_name = lo;
struct sockaddr_in6 a_three;
one.ifa_next = &two;
+ one.ifa_flags &= ~IFF_UP;
ipv6(&a_one, "::1");
one.ifa_addr = (struct sockaddr*)&a_one;
one.ifa_name = lo;