summaryrefslogtreecommitdiff
path: root/ospfd/ospf_network.c
diff options
context:
space:
mode:
authorajs <ajs>2004-11-20 02:06:59 +0000
committerajs <ajs>2004-11-20 02:06:59 +0000
commit6099b3b56956322567323c11fd698b2328c6826b (patch)
treefa537bd0eaa9f7d824f39445eabc928db59050ca /ospfd/ospf_network.c
parentae5e24d8678f1e3a60dde58d3382c5ba73d6bb27 (diff)
2004-11-19 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* global: Replace strerror with safe_strerror. And vtysh/vtysh.c needs to include "log.h" to pick up the declaration.
Diffstat (limited to 'ospfd/ospf_network.c')
-rw-r--r--ospfd/ospf_network.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/ospfd/ospf_network.c b/ospfd/ospf_network.c
index 266f775a..7d5b7301 100644
--- a/ospfd/ospf_network.c
+++ b/ospfd/ospf_network.c
@@ -56,7 +56,7 @@ ospf_if_add_allspfrouters (struct ospf *top, struct prefix *p,
ifindex);
if (ret < 0)
zlog_warn ("can't setsockopt IP_ADD_MEMBERSHIP (AllSPFRouters): %s",
- strerror (errno));
+ safe_strerror (errno));
else
zlog_info ("interface %s join AllSPFRouters Multicast group.",
inet_ntoa (p->u.prefix4));
@@ -75,7 +75,7 @@ ospf_if_drop_allspfrouters (struct ospf *top, struct prefix *p,
ifindex);
if (ret < 0)
zlog_warn("can't setsockopt IP_DROP_MEMBERSHIP (AllSPFRouters): %s",
- strerror (errno));
+ safe_strerror (errno));
else
zlog_info ("interface %s leave AllSPFRouters Multicast group.",
inet_ntoa (p->u.prefix4));
@@ -95,7 +95,7 @@ ospf_if_add_alldrouters (struct ospf *top, struct prefix *p, unsigned int
ifindex);
if (ret < 0)
zlog_warn ("can't setsockopt IP_ADD_MEMBERSHIP (AllDRouters): %s",
- strerror (errno));
+ safe_strerror (errno));
else
zlog_info ("interface %s join AllDRouters Multicast group.",
inet_ntoa (p->u.prefix4));
@@ -114,7 +114,7 @@ ospf_if_drop_alldrouters (struct ospf *top, struct prefix *p, unsigned int
ifindex);
if (ret < 0)
zlog_warn ("can't setsockopt IP_DROP_MEMBERSHIP (AllDRouters): %s",
- strerror (errno));
+ safe_strerror (errno));
else
zlog_info ("interface %s leave AllDRouters Multicast group.",
inet_ntoa (p->u.prefix4));
@@ -134,18 +134,18 @@ ospf_if_ipmulticast (struct ospf *top, struct prefix *p, unsigned int ifindex)
/* Prevent receiving self-origined multicast packets. */
ret = setsockopt (top->fd, IPPROTO_IP, IP_MULTICAST_LOOP, (void *)&val, len);
if (ret < 0)
- zlog_warn ("can't setsockopt IP_MULTICAST_LOOP(0): %s", strerror (errno));
+ zlog_warn ("can't setsockopt IP_MULTICAST_LOOP(0): %s", safe_strerror (errno));
/* Explicitly set multicast ttl to 1 -- endo. */
val = 1;
ret = setsockopt (top->fd, IPPROTO_IP, IP_MULTICAST_TTL, (void *)&val, len);
if (ret < 0)
- zlog_warn ("can't setsockopt IP_MULTICAST_TTL(1): %s", strerror (errno));
+ zlog_warn ("can't setsockopt IP_MULTICAST_TTL(1): %s", safe_strerror (errno));
ret = setsockopt_multicast_ipv4 (top->fd, IP_MULTICAST_IF,
p->u.prefix4, 0, ifindex);
if (ret < 0)
- zlog_warn ("can't setsockopt IP_MULTICAST_IF: %s", strerror (errno));
+ zlog_warn ("can't setsockopt IP_MULTICAST_IF: %s", safe_strerror (errno));
return ret;
}
@@ -158,15 +158,15 @@ ospf_sock_init (void)
if ( ospfd_privs.change (ZPRIVS_RAISE) )
zlog_err ("ospf_sock_init: could not raise privs, %s",
- strerror (errno) );
+ safe_strerror (errno) );
ospf_sock = socket (AF_INET, SOCK_RAW, IPPROTO_OSPFIGP);
if (ospf_sock < 0)
{
if ( ospfd_privs.change (ZPRIVS_LOWER) )
zlog_err ("ospf_sock_init: could not lower privs, %s",
- strerror (errno) );
- zlog_err ("ospf_read_sock_init: socket: %s", strerror (errno));
+ safe_strerror (errno) );
+ zlog_err ("ospf_read_sock_init: socket: %s", safe_strerror (errno));
exit(-1);
}
@@ -177,7 +177,7 @@ ospf_sock_init (void)
{
if ( ospfd_privs.change (ZPRIVS_LOWER) )
zlog_err ("ospf_sock_init: could not lower privs, %s",
- strerror (errno) );
+ safe_strerror (errno) );
zlog_warn ("Can't set IP_HDRINCL option");
}
#elif defined (IPTOS_PREC_INTERNETCONTROL)
@@ -191,7 +191,7 @@ ospf_sock_init (void)
{
if ( ospfd_privs.change (ZPRIVS_LOWER) )
zlog_err ("ospf_sock_init: could not lower privs, %s",
- strerror (errno) );
+ safe_strerror (errno) );
zlog_warn ("can't set sockopt IP_TOS %d to socket %d", tos, ospf_sock);
close (ospf_sock); /* Prevent sd leak. */
return ret;
@@ -209,7 +209,7 @@ ospf_sock_init (void)
if (ospfd_privs.change (ZPRIVS_LOWER))
{
zlog_err ("ospf_sock_init: could not lower privs, %s",
- strerror (errno) );
+ safe_strerror (errno) );
}
return ospf_sock;