if (ret < 0)
flog_err(
EC_LIB_SOCKET,
- "can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %s, "
- "ifindex %u, AllSPFRouters): %s; perhaps a kernel limit "
- "on # of multicast group memberships has been exceeded?",
- top->fd, inet_ntoa(p->u.prefix4), ifindex,
+ "can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %pI4, ifindex %u, AllSPFRouters): %s; perhaps a kernel limit on # of multicast group memberships has been exceeded?",
+ top->fd, &p->u.prefix4, ifindex,
safe_strerror(errno));
else {
if (IS_DEBUG_OSPF_EVENT)
zlog_debug(
- "interface %s [%u] join AllSPFRouters Multicast group.",
- inet_ntoa(p->u.prefix4), ifindex);
+ "interface %pI4 [%u] join AllSPFRouters Multicast group.",
+ &p->u.prefix4, ifindex);
}
return ret;
ifindex);
if (ret < 0)
flog_err(EC_LIB_SOCKET,
- "can't setsockopt IP_DROP_MEMBERSHIP (fd %d, addr %s, "
- "ifindex %u, AllSPFRouters): %s",
- top->fd, inet_ntoa(p->u.prefix4), ifindex,
+ "can't setsockopt IP_DROP_MEMBERSHIP (fd %d, addr %pI4, ifindex %u, AllSPFRouters): %s",
+ top->fd, &p->u.prefix4, ifindex,
safe_strerror(errno));
else {
if (IS_DEBUG_OSPF_EVENT)
zlog_debug(
- "interface %s [%u] leave AllSPFRouters Multicast group.",
- inet_ntoa(p->u.prefix4), ifindex);
+ "interface %pI4 [%u] leave AllSPFRouters Multicast group.",
+ &p->u.prefix4, ifindex);
}
return ret;
if (ret < 0)
flog_err(
EC_LIB_SOCKET,
- "can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %s, "
- "ifindex %u, AllDRouters): %s; perhaps a kernel limit "
- "on # of multicast group memberships has been exceeded?",
- top->fd, inet_ntoa(p->u.prefix4), ifindex,
+ "can't setsockopt IP_ADD_MEMBERSHIP (fd %d, addr %pI4, ifindex %u, AllDRouters): %s; perhaps a kernel limit on # of multicast group memberships has been exceeded?",
+ top->fd, &p->u.prefix4, ifindex,
safe_strerror(errno));
else
zlog_debug(
- "interface %s [%u] join AllDRouters Multicast group.",
- inet_ntoa(p->u.prefix4), ifindex);
+ "interface %pI4 [%u] join AllDRouters Multicast group.",
+ &p->u.prefix4, ifindex);
return ret;
}
ifindex);
if (ret < 0)
flog_err(EC_LIB_SOCKET,
- "can't setsockopt IP_DROP_MEMBERSHIP (fd %d, addr %s, "
- "ifindex %u, AllDRouters): %s",
- top->fd, inet_ntoa(p->u.prefix4), ifindex,
+ "can't setsockopt IP_DROP_MEMBERSHIP (fd %d, addr %pI4, ifindex %u, AllDRouters): %s",
+ top->fd, &p->u.prefix4, ifindex,
safe_strerror(errno));
else
zlog_debug(
- "interface %s [%u] leave AllDRouters Multicast group.",
- inet_ntoa(p->u.prefix4), ifindex);
+ "interface %pI4 [%u] leave AllDRouters Multicast group.",
+ &p->u.prefix4, ifindex);
return ret;
}
ret = setsockopt_ipv4_multicast_if(top->fd, p->u.prefix4, ifindex);
if (ret < 0)
flog_err(EC_LIB_SOCKET,
- "can't setsockopt IP_MULTICAST_IF(fd %d, addr %s, "
- "ifindex %u): %s",
- top->fd, inet_ntoa(p->u.prefix4), ifindex,
+ "can't setsockopt IP_MULTICAST_IF(fd %d, addr %pI4, ifindex %u): %s",
+ top->fd, &p->u.prefix4, ifindex,
safe_strerror(errno));
#endif
flog_err(EC_LIB_SOCKET,
"ospf_read_sock_init: socket: %s",
safe_strerror(errno));
- exit(1);
+ return -1;
}
#ifdef IP_HDRINCL
flog_err(EC_LIB_SOCKET,
"Can't set IP_HDRINCL option for fd %d: %s",
ospf_sock, safe_strerror(errno));
- close(ospf_sock);
break;
}
#elif defined(IPTOS_PREC_INTERNETCONTROL)
flog_err(EC_LIB_SOCKET,
"can't set sockopt IP_TOS %d to socket %d: %s",
tos, ospf_sock, safe_strerror(errno));
- close(ospf_sock); /* Prevent sd leak. */
break;
}
#else /* !IPTOS_PREC_INTERNETCONTROL */