MCPcopy Create free account
hub / github.com/F-Stack/f-stack / is_addr_different

Function is_addr_different

dpdk/app/test/test_cmdline_ipaddr.c:287–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285
286
287static int
288is_addr_different(cmdline_ipaddr_t addr1, cmdline_ipaddr_t addr2)
289{
290 if (addr1.family != addr2.family)
291 return 1;
292
293 if (addr1.prefixlen != addr2.prefixlen)
294 return 1;
295
296 switch (addr1.family) {
297 /* IPv4 */
298 case AF_INET:
299 if (memcmp(&addr1.addr.ipv4, &addr2.addr.ipv4,
300 sizeof(struct in_addr)) != 0)
301 return 1;
302 break;
303 /* IPv6 */
304 case AF_INET6:
305 {
306 if (memcmp(&addr1.addr.ipv6, &addr2.addr.ipv6,
307 sizeof(struct in6_addr)) != 0)
308 return 1;
309 break;
310 }
311 /* thing that should not be */
312 default:
313 return -1;
314 }
315 return 0;
316}
317
318static int
319can_parse_addr(unsigned addr_flags, unsigned test_flags)

Callers 1

test_parse_ipaddr_validFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected