diff options
Diffstat (limited to 'ospfd')
-rw-r--r-- | ospfd/ospf_api.c | 6 | ||||
-rw-r--r-- | ospfd/ospf_apiserver.c | 12 | ||||
-rw-r--r-- | ospfd/ospf_network.c | 26 | ||||
-rw-r--r-- | ospfd/ospf_opaque.c | 6 | ||||
-rw-r--r-- | ospfd/ospf_packet.c | 4 | ||||
-rw-r--r-- | ospfd/ospf_te.c | 12 |
6 files changed, 33 insertions, 33 deletions
diff --git a/ospfd/ospf_api.c b/ospfd/ospf_api.c index cd69336c..8821d741 100644 --- a/ospfd/ospf_api.c +++ b/ospfd/ospf_api.c @@ -359,7 +359,7 @@ msg_read (int fd) if (rlen < 0) { - zlog_warn ("msg_read: readn %s", strerror (errno)); + zlog_warn ("msg_read: readn %s", safe_strerror (errno)); return NULL; } else if (rlen == 0) @@ -389,7 +389,7 @@ msg_read (int fd) rlen = readn (fd, buf, bodylen); if (rlen < 0) { - zlog_warn ("msg_read: readn %s", strerror (errno)); + zlog_warn ("msg_read: readn %s", safe_strerror (errno)); return NULL; } else if (rlen == 0) @@ -431,7 +431,7 @@ msg_write (int fd, struct msg *msg) wlen = writen (fd, buf, l); if (wlen < 0) { - zlog_warn ("msg_write: writen %s", strerror (errno)); + zlog_warn ("msg_write: writen %s", safe_strerror (errno)); return -1; } else if (wlen == 0) diff --git a/ospfd/ospf_apiserver.c b/ospfd/ospf_apiserver.c index 8bc16dc3..671bbc50 100644 --- a/ospfd/ospf_apiserver.c +++ b/ospfd/ospf_apiserver.c @@ -646,7 +646,7 @@ ospf_apiserver_serv_sock_family (unsigned short port, int family) if (rc < 0) { zlog_warn ("ospf_apiserver_serv_sock_family: listen: %s", - strerror (errno)); + safe_strerror (errno)); close (accept_sock); /* Close socket */ return rc; } @@ -680,7 +680,7 @@ ospf_apiserver_accept (struct thread *thread) new_sync_sock = sockunion_accept (accept_sock, &su); if (new_sync_sock < 0) { - zlog_warn ("ospf_apiserver_accept: accept: %s", strerror (errno)); + zlog_warn ("ospf_apiserver_accept: accept: %s", safe_strerror (errno)); return -1; } @@ -693,7 +693,7 @@ ospf_apiserver_accept (struct thread *thread) ret = getpeername (new_sync_sock, (struct sockaddr *)&peer_sync, &peerlen); if (ret < 0) { - zlog_warn ("ospf_apiserver_accept: getpeername: %s", strerror (errno)); + zlog_warn ("ospf_apiserver_accept: getpeername: %s", safe_strerror (errno)); close (new_sync_sock); return -1; } @@ -718,7 +718,7 @@ ospf_apiserver_accept (struct thread *thread) new_async_sock = socket (AF_INET, SOCK_STREAM, 0); if (new_async_sock < 0) { - zlog_warn ("ospf_apiserver_accept: socket: %s", strerror (errno)); + zlog_warn ("ospf_apiserver_accept: socket: %s", safe_strerror (errno)); close (new_sync_sock); return -1; } @@ -728,7 +728,7 @@ ospf_apiserver_accept (struct thread *thread) if (ret < 0) { - zlog_warn ("ospf_apiserver_accept: connect: %s", strerror (errno)); + zlog_warn ("ospf_apiserver_accept: connect: %s", safe_strerror (errno)); close (new_sync_sock); close (new_async_sock); return -1; @@ -740,7 +740,7 @@ ospf_apiserver_accept (struct thread *thread) ret = shutdown (new_async_sock, SHUT_RD); if (ret < 0) { - zlog_warn ("ospf_apiserver_accept: shutdown: %s", strerror (errno)); + zlog_warn ("ospf_apiserver_accept: shutdown: %s", safe_strerror (errno)); close (new_sync_sock); close (new_async_sock); return -1; 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; diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c index 8563b85a..74bb5b7b 100644 --- a/ospfd/ospf_opaque.c +++ b/ospfd/ospf_opaque.c @@ -387,7 +387,7 @@ ospf_register_opaque_functab ( sizeof (struct ospf_opaque_functab))) == NULL) { zlog_warn ("ospf_register_opaque_functab: XMALLOC: %s", - strerror (errno)); + safe_strerror (errno)); goto out; } @@ -536,7 +536,7 @@ register_opaque_info_per_type (struct ospf_opaque_functab *functab, if ((oipt = XCALLOC (MTYPE_OPAQUE_INFO_PER_TYPE, sizeof (struct opaque_info_per_type))) == NULL) { - zlog_warn ("register_opaque_info_per_type: XMALLOC: %s", strerror (errno)); + zlog_warn ("register_opaque_info_per_type: XMALLOC: %s", safe_strerror (errno)); goto out; } @@ -689,7 +689,7 @@ register_opaque_info_per_id (struct opaque_info_per_type *oipt, if ((oipi = XCALLOC (MTYPE_OPAQUE_INFO_PER_ID, sizeof (struct opaque_info_per_id))) == NULL) { - zlog_warn ("register_opaque_info_per_id: XMALLOC: %s", strerror (errno)); + zlog_warn ("register_opaque_info_per_id: XMALLOC: %s", safe_strerror (errno)); goto out; } oipi->opaque_id = GET_OPAQUE_ID (ntohl (new->data->id.s_addr)); diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index c582533b..729c8f7e 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -539,7 +539,7 @@ ospf_write_frags (int fd, struct ospf_packet *op, struct ip *iph, iph->ip_id, iph->ip_off, iph->ip_len, - strerror (errno)); + safe_strerror (errno)); if (IS_DEBUG_OSPF_PACKET (type - 1, SEND)) { @@ -690,7 +690,7 @@ ospf_write (struct thread *thread) if (ret < 0) zlog_warn ("*** sendmsg in ospf_write to %s failed with %s", - inet_ntoa (iph.ip_dst), strerror (errno)); + inet_ntoa (iph.ip_dst), safe_strerror (errno)); /* Show debug sending packet. */ if (IS_DEBUG_OSPF_PACKET (type - 1, SEND)) diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c index 4a28ae83..ff89350e 100644 --- a/ospfd/ospf_te.c +++ b/ospfd/ospf_te.c @@ -563,7 +563,7 @@ ospf_mpls_te_new_if (struct interface *ifp) if ((new = XMALLOC (MTYPE_OSPF_MPLS_TE_LINKPARAMS, sizeof (struct mpls_te_link))) == NULL) { - zlog_warn ("ospf_mpls_te_new_if: XMALLOC: %s", strerror (errno)); + zlog_warn ("ospf_mpls_te_new_if: XMALLOC: %s", safe_strerror (errno)); goto out; } memset (new, 0, sizeof (struct mpls_te_link)); @@ -1647,7 +1647,7 @@ DEFUN (mpls_te_link_maxbw, ntohf (&lp->max_bw.value, &f1); if (sscanf (argv[0], "%g", &f2) != 1) { - vty_out (vty, "mpls_te_link_maxbw: fscanf: %s%s", strerror (errno), VTY_NEWLINE); + vty_out (vty, "mpls_te_link_maxbw: fscanf: %s%s", safe_strerror (errno), VTY_NEWLINE); return CMD_WARNING; } @@ -1689,7 +1689,7 @@ DEFUN (mpls_te_link_max_rsv_bw, ntohf (&lp->max_rsv_bw.value, &f1); if (sscanf (argv[0], "%g", &f2) != 1) { - vty_out (vty, "mpls_te_link_max_rsv_bw: fscanf: %s%s", strerror (errno), VTY_NEWLINE); + vty_out (vty, "mpls_te_link_max_rsv_bw: fscanf: %s%s", safe_strerror (errno), VTY_NEWLINE); return CMD_WARNING; } @@ -1733,14 +1733,14 @@ DEFUN (mpls_te_link_unrsv_bw, /* We don't have to consider about range check here. */ if (sscanf (argv[0], "%d", &priority) != 1) { - vty_out (vty, "mpls_te_link_unrsv_bw: fscanf: %s%s", strerror (errno), VTY_NEWLINE); + vty_out (vty, "mpls_te_link_unrsv_bw: fscanf: %s%s", safe_strerror (errno), VTY_NEWLINE); return CMD_WARNING; } ntohf (&lp->unrsv_bw.value [priority], &f1); if (sscanf (argv[1], "%g", &f2) != 1) { - vty_out (vty, "mpls_te_link_unrsv_bw: fscanf: %s%s", strerror (errno), VTY_NEWLINE); + vty_out (vty, "mpls_te_link_unrsv_bw: fscanf: %s%s", safe_strerror (errno), VTY_NEWLINE); return CMD_WARNING; } @@ -1781,7 +1781,7 @@ DEFUN (mpls_te_link_rsc_clsclr, if (sscanf (argv[0], "0x%lx", &value) != 1) { - vty_out (vty, "mpls_te_link_rsc_clsclr: fscanf: %s%s", strerror (errno), VTY_NEWLINE); + vty_out (vty, "mpls_te_link_rsc_clsclr: fscanf: %s%s", safe_strerror (errno), VTY_NEWLINE); return CMD_WARNING; } |