diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-09-13 21:34:28 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-09-13 21:34:28 +0200 |
commit | 450971aa994e68f7c62c4d45065223d5cfc4a22f (patch) | |
tree | 0128a1e596823272333d8a6616dd2575e8d7c46b /zebra | |
parent | zebra: ZEBRA_[ERR|WARN] -> EC_ZEBRA (diff) | |
download | frr-450971aa994e68f7c62c4d45065223d5cfc4a22f.tar.xz frr-450971aa994e68f7c62c4d45065223d5cfc4a22f.zip |
*: LIB_[ERR|WARN] -> EC_LIB
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/if_ioctl.c | 10 | ||||
-rw-r--r-- | zebra/if_ioctl_solaris.c | 12 | ||||
-rw-r--r-- | zebra/if_netlink.c | 10 | ||||
-rw-r--r-- | zebra/interface.c | 2 | ||||
-rw-r--r-- | zebra/ioctl.c | 4 | ||||
-rw-r--r-- | zebra/ioctl_solaris.c | 4 | ||||
-rw-r--r-- | zebra/ipforward_solaris.c | 6 | ||||
-rw-r--r-- | zebra/ipforward_sysctl.c | 12 | ||||
-rw-r--r-- | zebra/irdp_interface.c | 2 | ||||
-rw-r--r-- | zebra/irdp_main.c | 6 | ||||
-rw-r--r-- | zebra/irdp_packet.c | 8 | ||||
-rw-r--r-- | zebra/kernel_netlink.c | 18 | ||||
-rw-r--r-- | zebra/kernel_socket.c | 6 | ||||
-rw-r--r-- | zebra/rt_socket.c | 4 | ||||
-rw-r--r-- | zebra/rtadv.c | 8 | ||||
-rw-r--r-- | zebra/rtread_getmsg.c | 8 | ||||
-rw-r--r-- | zebra/rule_socket.c | 4 | ||||
-rw-r--r-- | zebra/zebra_mpls_openbsd.c | 14 | ||||
-rw-r--r-- | zebra/zebra_netns_id.c | 10 | ||||
-rw-r--r-- | zebra/zebra_netns_notify.c | 8 | ||||
-rw-r--r-- | zebra/zebra_ptm.c | 6 | ||||
-rw-r--r-- | zebra/zserv.c | 8 |
22 files changed, 85 insertions, 85 deletions
diff --git a/zebra/if_ioctl.c b/zebra/if_ioctl.c index 6155e8c4e..f02cc4627 100644 --- a/zebra/if_ioctl.c +++ b/zebra/if_ioctl.c @@ -58,7 +58,7 @@ static int interface_list_ioctl(void) /* Normally SIOCGIFCONF works with AF_INET socket. */ sock = socket(AF_INET, SOCK_DGRAM, 0); if (sock < 0) { - flog_err_sys(LIB_ERR_SOCKET, + flog_err_sys(EC_LIB_SOCKET, "Can't make AF_INET socket stream: %s", safe_strerror(errno)); return -1; @@ -88,7 +88,7 @@ static int interface_list_ioctl(void) ret = ioctl(sock, SIOCGIFCONF, &ifconf); if (ret < 0) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, "SIOCGIFCONF: %s", + flog_err_sys(EC_LIB_SYSTEM_CALL, "SIOCGIFCONF: %s", safe_strerror(errno)); goto end; } @@ -180,7 +180,7 @@ static int if_getaddrs(void) ret = getifaddrs(&ifap); if (ret != 0) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, "getifaddrs(): %s", + flog_err_sys(EC_LIB_SYSTEM_CALL, "getifaddrs(): %s", safe_strerror(errno)); return -1; } @@ -188,7 +188,7 @@ static int if_getaddrs(void) for (ifapfree = ifap; ifap; ifap = ifap->ifa_next) { if (ifap->ifa_addr == NULL) { flog_err( - LIB_ERR_INTERFACE, + EC_LIB_INTERFACE, "%s: nonsensical ifaddr with NULL ifa_addr, ifname %s", __func__, (ifap->ifa_name ? ifap->ifa_name : "(null)")); @@ -197,7 +197,7 @@ static int if_getaddrs(void) ifp = if_lookup_by_name(ifap->ifa_name, VRF_DEFAULT); if (ifp == NULL) { - flog_err(LIB_ERR_INTERFACE, + flog_err(EC_LIB_INTERFACE, "if_getaddrs(): Can't lookup interface %s\n", ifap->ifa_name); continue; diff --git a/zebra/if_ioctl_solaris.c b/zebra/if_ioctl_solaris.c index 1f12d4c02..1955881f2 100644 --- a/zebra/if_ioctl_solaris.c +++ b/zebra/if_ioctl_solaris.c @@ -65,7 +65,7 @@ static int interface_list_ioctl(int af) } if (sock < 0) { - flog_err_sys(LIB_ERR_SOCKET, "Can't make %s socket stream: %s", + flog_err_sys(EC_LIB_SOCKET, "Can't make %s socket stream: %s", (af == AF_INET ? "AF_INET" : "AF_INET6"), safe_strerror(errno)); return -1; @@ -80,7 +80,7 @@ calculate_lifc_len: } if (ret < 0) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, + flog_err_sys(EC_LIB_SYSTEM_CALL, "interface_list_ioctl: SIOCGLIFNUM failed %s", safe_strerror(errno)); close(sock); @@ -115,7 +115,7 @@ calculate_lifc_len: if (errno == EINVAL) goto calculate_lifc_len; - flog_err_sys(LIB_ERR_SYSTEM_CALL, "SIOCGLIFCONF: %s", + flog_err_sys(EC_LIB_SYSTEM_CALL, "SIOCGLIFCONF: %s", safe_strerror(errno)); goto end; } @@ -207,7 +207,7 @@ static int if_get_index(struct interface *ifp) ret = -1; if (ret < 0) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, "SIOCGLIFINDEX(%s) failed", + flog_err_sys(EC_LIB_SYSTEM_CALL, "SIOCGLIFINDEX(%s) failed", ifp->name); return ret; } @@ -270,7 +270,7 @@ static int if_get_addr(struct interface *ifp, struct sockaddr *addr, if (ret < 0) { if (errno != EADDRNOTAVAIL) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, + flog_err_sys(EC_LIB_SYSTEM_CALL, "SIOCGLIFNETMASK (%s) fail: %s", ifp->name, safe_strerror(errno)); return ret; @@ -291,7 +291,7 @@ static int if_get_addr(struct interface *ifp, struct sockaddr *addr, if (ifp->flags & IFF_POINTOPOINT) prefixlen = IPV6_MAX_BITLEN; else - flog_err_sys(LIB_ERR_SYSTEM_CALL, + flog_err_sys(EC_LIB_SYSTEM_CALL, "SIOCGLIFSUBNET (%s) fail: %s", ifp->name, safe_strerror(errno)); } else { diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index 7953c503f..286931b96 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -82,7 +82,7 @@ static void set_ifindex(struct interface *ifp, ifindex_t ifi_index, && (oifp != ifp)) { if (ifi_index == IFINDEX_INTERNAL) flog_err( - LIB_ERR_INTERFACE, + EC_LIB_INTERFACE, "Netlink is setting interface %s ifindex to reserved internal value %u", ifp->name, ifi_index); else { @@ -92,7 +92,7 @@ static void set_ifindex(struct interface *ifp, ifindex_t ifi_index, ifi_index, oifp->name, ifp->name); if (if_is_up(oifp)) flog_err( - LIB_ERR_INTERFACE, + EC_LIB_INTERFACE, "interface rename detected on up interface: index %d was renamed from %s to %s, results are uncertain!", ifi_index, oifp->name, ifp->name); if_delete_update(oifp); @@ -313,7 +313,7 @@ static void netlink_vrf_change(struct nlmsghdr *h, struct rtattr *tb, vrf = vrf_get((vrf_id_t)ifi->ifi_index, name); // It would create vrf if (!vrf) { - flog_err(LIB_ERR_INTERFACE, "VRF %s id %u not created", + flog_err(EC_LIB_INTERFACE, "VRF %s id %u not created", name, ifi->ifi_index); return; } @@ -335,7 +335,7 @@ static void netlink_vrf_change(struct nlmsghdr *h, struct rtattr *tb, /* Enable the created VRF. */ if (!vrf_enable(vrf)) { - flog_err(LIB_ERR_INTERFACE, + flog_err(EC_LIB_INTERFACE, "Failed to enable VRF %s id %u", name, ifi->ifi_index); return; @@ -924,7 +924,7 @@ int netlink_interface_addr(struct nlmsghdr *h, ns_id_t ns_id, int startup) ifp = if_lookup_by_index_per_ns(zns, ifa->ifa_index); if (ifp == NULL) { flog_err( - LIB_ERR_INTERFACE, + EC_LIB_INTERFACE, "netlink_interface_addr can't find interface by index %d", ifa->ifa_index); return -1; diff --git a/zebra/interface.c b/zebra/interface.c index 812e36659..ba76674c9 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -699,7 +699,7 @@ void if_delete_update(struct interface *ifp) if (if_is_up(ifp)) { flog_err( - LIB_ERR_INTERFACE, + EC_LIB_INTERFACE, "interface %s vrf %u index %d is still up while being deleted.", ifp->name, ifp->vrf_id, ifp->ifindex); return; diff --git a/zebra/ioctl.c b/zebra/ioctl.c index 5c2380cdd..87e98032a 100644 --- a/zebra/ioctl.c +++ b/zebra/ioctl.c @@ -397,7 +397,7 @@ void if_get_flags(struct interface *ifp) ret = vrf_if_ioctl(SIOCGIFFLAGS, (caddr_t)&ifreq, ifp->vrf_id); if (ret < 0) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, + flog_err_sys(EC_LIB_SYSTEM_CALL, "vrf_if_ioctl(SIOCGIFFLAGS) failed: %s", safe_strerror(errno)); return; @@ -416,7 +416,7 @@ void if_get_flags(struct interface *ifp) /* Seems not all interfaces implement this ioctl */ if (if_ioctl(SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) - flog_err_sys(LIB_ERR_SYSTEM_CALL, + flog_err_sys(EC_LIB_SYSTEM_CALL, "if_ioctl(SIOCGIFMEDIA) failed: %s", safe_strerror(errno)); else if (ifmr.ifm_status & IFM_AVALID) /* Link state is valid */ diff --git a/zebra/ioctl_solaris.c b/zebra/ioctl_solaris.c index 2f92cf256..fc554219b 100644 --- a/zebra/ioctl_solaris.c +++ b/zebra/ioctl_solaris.c @@ -381,7 +381,7 @@ int if_prefix_add_ipv6(struct interface *ifp, struct connected *ifc) { char addrbuf[PREFIX_STRLEN]; - flog_warn(LIB_ERR_DEVELOPMENT, "Can't set %s on interface %s", + flog_warn(EC_LIB_DEVELOPMENT, "Can't set %s on interface %s", prefix2str(ifc->address, addrbuf, sizeof(addrbuf)), ifp->name); @@ -392,7 +392,7 @@ int if_prefix_delete_ipv6(struct interface *ifp, struct connected *ifc) { char addrbuf[PREFIX_STRLEN]; - flog_warn(LIB_ERR_DEVELOPMENT, "Can't delete %s on interface %s", + flog_warn(EC_LIB_DEVELOPMENT, "Can't delete %s on interface %s", prefix2str(ifc->address, addrbuf, sizeof(addrbuf)), ifp->name); diff --git a/zebra/ipforward_solaris.c b/zebra/ipforward_solaris.c index 7f372e32f..1bb743059 100644 --- a/zebra/ipforward_solaris.c +++ b/zebra/ipforward_solaris.c @@ -71,7 +71,7 @@ static int solaris_nd(const int cmd, const char *parameter, const int value) else if (cmd == ND_GET) snprintf(nd_buf, ND_BUFFER_SIZE, "%s", parameter); else { - flog_err_sys(LIB_ERR_SYSTEM_CALL, + flog_err_sys(EC_LIB_SYSTEM_CALL, "internal error - inappropriate command given to " "solaris_nd()%s:%d", __FILE__, __LINE__); @@ -85,14 +85,14 @@ static int solaris_nd(const int cmd, const char *parameter, const int value) frr_elevate_privs(&zserv_privs) { if ((fd = open(device, O_RDWR)) < 0) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, + flog_err_sys(EC_LIB_SYSTEM_CALL, "failed to open device %s - %s", device, safe_strerror(errno)); return -1; } if (ioctl(fd, I_STR, &strioctl) < 0) { close(fd); - flog_err_sys(LIB_ERR_SYSTEM_CALL, + flog_err_sys(EC_LIB_SYSTEM_CALL, "ioctl I_STR failed on device %s - %s", device, safe_strerror(errno)); return -1; diff --git a/zebra/ipforward_sysctl.c b/zebra/ipforward_sysctl.c index 24ebf0a28..fcf86afef 100644 --- a/zebra/ipforward_sysctl.c +++ b/zebra/ipforward_sysctl.c @@ -43,7 +43,7 @@ int ipforward(void) len = sizeof ipforwarding; if (sysctl(mib, MIB_SIZ, &ipforwarding, &len, 0, 0) < 0) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, "Can't get ipforwarding value"); + flog_err_sys(EC_LIB_SYSTEM_CALL, "Can't get ipforwarding value"); return -1; } return ipforwarding; @@ -57,7 +57,7 @@ int ipforward_on(void) len = sizeof ipforwarding; frr_elevate_privs(&zserv_privs) { if (sysctl(mib, MIB_SIZ, NULL, NULL, &ipforwarding, len) < 0) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, + flog_err_sys(EC_LIB_SYSTEM_CALL, "Can't set ipforwarding on"); return -1; } @@ -73,7 +73,7 @@ int ipforward_off(void) len = sizeof ipforwarding; frr_elevate_privs(&zserv_privs) { if (sysctl(mib, MIB_SIZ, NULL, NULL, &ipforwarding, len) < 0) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, + flog_err_sys(EC_LIB_SYSTEM_CALL, "Can't set ipforwarding on"); return -1; } @@ -98,7 +98,7 @@ int ipforward_ipv6(void) len = sizeof ip6forwarding; frr_elevate_privs(&zserv_privs) { if (sysctl(mib_ipv6, MIB_SIZ, &ip6forwarding, &len, 0, 0) < 0) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, + flog_err_sys(EC_LIB_SYSTEM_CALL, "can't get ip6forwarding value"); return -1; } @@ -115,7 +115,7 @@ int ipforward_ipv6_on(void) frr_elevate_privs(&zserv_privs) { if (sysctl(mib_ipv6, MIB_SIZ, NULL, NULL, &ip6forwarding, len) < 0) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, + flog_err_sys(EC_LIB_SYSTEM_CALL, "can't get ip6forwarding value"); return -1; } @@ -132,7 +132,7 @@ int ipforward_ipv6_off(void) frr_elevate_privs(&zserv_privs) { if (sysctl(mib_ipv6, MIB_SIZ, NULL, NULL, &ip6forwarding, len) < 0) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, + flog_err_sys(EC_LIB_SYSTEM_CALL, "can't get ip6forwarding value"); return -1; } diff --git a/zebra/irdp_interface.c b/zebra/irdp_interface.c index f9afe9e65..5fdaae4fe 100644 --- a/zebra/irdp_interface.c +++ b/zebra/irdp_interface.c @@ -136,7 +136,7 @@ static int if_group(struct interface *ifp, int sock, uint32_t group, ret = setsockopt(sock, IPPROTO_IP, add_leave, (char *)&m, sizeof(struct ip_mreq)); if (ret < 0) - flog_err_sys(LIB_ERR_SOCKET, "IRDP: %s can't setsockopt %s: %s", + flog_err_sys(EC_LIB_SOCKET, "IRDP: %s can't setsockopt %s: %s", add_leave == IP_ADD_MEMBERSHIP ? "join group" : "leave group", inet_2a(group, b1), safe_strerror(errno)); diff --git a/zebra/irdp_main.c b/zebra/irdp_main.c index fe7e58e1a..ce1bfdf50 100644 --- a/zebra/irdp_main.c +++ b/zebra/irdp_main.c @@ -90,7 +90,7 @@ int irdp_sock_init(void) } if (sock < 0) { - flog_err_sys(LIB_ERR_SOCKET, + flog_err_sys(EC_LIB_SOCKET, "IRDP: can't create irdp socket %s", safe_strerror(save_errno)); return sock; @@ -99,7 +99,7 @@ int irdp_sock_init(void) i = 1; ret = setsockopt(sock, IPPROTO_IP, IP_TTL, (void *)&i, sizeof(i)); if (ret < 0) { - flog_err_sys(LIB_ERR_SOCKET, "IRDP: can't do irdp sockopt %s", + flog_err_sys(EC_LIB_SOCKET, "IRDP: can't do irdp sockopt %s", safe_strerror(errno)); close(sock); return ret; @@ -107,7 +107,7 @@ int irdp_sock_init(void) ret = setsockopt_ifindex(AF_INET, sock, 1); if (ret < 0) { - flog_err_sys(LIB_ERR_SOCKET, "IRDP: can't do irdp sockopt %s", + flog_err_sys(EC_LIB_SOCKET, "IRDP: can't do irdp sockopt %s", safe_strerror(errno)); close(sock); return ret; diff --git a/zebra/irdp_packet.c b/zebra/irdp_packet.c index 60fe3dc63..15235f0e4 100644 --- a/zebra/irdp_packet.c +++ b/zebra/irdp_packet.c @@ -200,17 +200,17 @@ static int irdp_recvmsg(int sock, uint8_t *buf, int size, int *ifindex) ret = recvmsg(sock, &msg, 0); if (ret < 0) { - flog_warn(LIB_ERR_SOCKET, "IRDP: recvmsg: read error %s", + flog_warn(EC_LIB_SOCKET, "IRDP: recvmsg: read error %s", safe_strerror(errno)); return ret; } if (msg.msg_flags & MSG_TRUNC) { - flog_warn(LIB_ERR_SOCKET, "IRDP: recvmsg: truncated message"); + flog_warn(EC_LIB_SOCKET, "IRDP: recvmsg: truncated message"); return ret; } if (msg.msg_flags & MSG_CTRUNC) { - flog_warn(LIB_ERR_SOCKET, + flog_warn(EC_LIB_SOCKET, "IRDP: recvmsg: truncated control message"); return ret; } @@ -236,7 +236,7 @@ int irdp_read_raw(struct thread *r) ret = irdp_recvmsg(irdp_sock, (uint8_t *)buf, IRDP_RX_BUF, &ifindex); if (ret < 0) - flog_warn(LIB_ERR_SOCKET, "IRDP: RX Error length = %d", ret); + flog_warn(EC_LIB_SOCKET, "IRDP: RX Error length = %d", ret); ifp = if_lookup_by_index(ifindex, VRF_DEFAULT); if (!ifp) diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c index cfc369dbc..bcdc35784 100644 --- a/zebra/kernel_netlink.c +++ b/zebra/kernel_netlink.c @@ -163,7 +163,7 @@ static int netlink_recvbuf(struct nlsock *nl, uint32_t newsize) ret = getsockopt(nl->sock, SOL_SOCKET, SO_RCVBUF, &oldsize, &oldlen); if (ret < 0) { - flog_err_sys(LIB_ERR_SOCKET, + flog_err_sys(EC_LIB_SOCKET, "Can't get %s receive buffer size: %s", nl->name, safe_strerror(errno)); return -1; @@ -179,7 +179,7 @@ static int netlink_recvbuf(struct nlsock *nl, uint32_t newsize) ret = setsockopt(nl->sock, SOL_SOCKET, SO_RCVBUF, &nl_rcvbufsize, sizeof(nl_rcvbufsize)); if (ret < 0) { - flog_err_sys(LIB_ERR_SOCKET, + flog_err_sys(EC_LIB_SOCKET, "Can't set %s receive buffer size: %s", nl->name, safe_strerror(errno)); return -1; @@ -187,7 +187,7 @@ static int netlink_recvbuf(struct nlsock *nl, uint32_t newsize) ret = getsockopt(nl->sock, SOL_SOCKET, SO_RCVBUF, &newsize, &newlen); if (ret < 0) { - flog_err_sys(LIB_ERR_SOCKET, + flog_err_sys(EC_LIB_SOCKET, "Can't get %s receive buffer size: %s", nl->name, safe_strerror(errno)); return -1; @@ -234,7 +234,7 @@ static int netlink_socket(struct nlsock *nl, unsigned long groups, namelen = sizeof snl; ret = getsockname(sock, (struct sockaddr *)&snl, (socklen_t *)&namelen); if (ret < 0 || namelen != sizeof snl) { - flog_err_sys(LIB_ERR_SOCKET, "Can't get %s socket name: %s", + flog_err_sys(EC_LIB_SOCKET, "Can't get %s socket name: %s", nl->name, safe_strerror(errno)); close(sock); return -1; @@ -453,7 +453,7 @@ static void netlink_install_filter(int sock, __u32 pid) if (setsockopt(sock, SOL_SOCKET, SO_ATTACH_FILTER, &prog, sizeof(prog)) < 0) - flog_err_sys(LIB_ERR_SOCKET, + flog_err_sys(EC_LIB_SOCKET, "Can't install socket filter: %s\n", safe_strerror(errno)); } @@ -723,7 +723,7 @@ int netlink_parse_info(int (*filter)(struct nlmsghdr *, ns_id_t, int), } if (status == 0) { - flog_err_sys(LIB_ERR_SOCKET, "%s EOF", nl->name); + flog_err_sys(EC_LIB_SOCKET, "%s EOF", nl->name); return -1; } @@ -972,7 +972,7 @@ int netlink_talk(int (*filter)(struct nlmsghdr *, ns_id_t, int startup), } if (status < 0) { - flog_err_sys(LIB_ERR_SOCKET, "netlink_talk sendmsg() error: %s", + flog_err_sys(EC_LIB_SOCKET, "netlink_talk sendmsg() error: %s", safe_strerror(save_errno)); return -1; } @@ -995,7 +995,7 @@ int netlink_request(struct nlsock *nl, struct nlmsghdr *n) /* Check netlink socket. */ if (nl->sock < 0) { - flog_err_sys(LIB_ERR_SOCKET, "%s socket isn't active.", + flog_err_sys(EC_LIB_SOCKET, "%s socket isn't active.", nl->name); return -1; } @@ -1090,7 +1090,7 @@ void kernel_init(struct zebra_ns *zns) /* Register kernel socket. */ if (fcntl(zns->netlink.sock, F_SETFL, O_NONBLOCK) < 0) - flog_err_sys(LIB_ERR_SOCKET, "Can't set %s socket flags: %s", + flog_err_sys(EC_LIB_SOCKET, "Can't set %s socket flags: %s", zns->netlink.name, safe_strerror(errno)); if (fcntl(zns->netlink_cmd.sock, F_SETFL, O_NONBLOCK) < 0) diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c index 380b0ade1..a0624413e 100644 --- a/zebra/kernel_socket.c +++ b/zebra/kernel_socket.c @@ -1252,7 +1252,7 @@ int rtm_write(int message, union sockunion *dest, union sockunion *mask, if (errno == ESRCH) return ZEBRA_ERR_RTNOEXIST; - flog_err_sys(LIB_ERR_SOCKET, "%s: write : %s (%d)", __func__, + flog_err_sys(EC_LIB_SOCKET, "%s: write : %s (%d)", __func__, safe_strerror(errno), errno); return ZEBRA_ERR_KERNEL; } @@ -1335,7 +1335,7 @@ static int kernel_read(struct thread *thread) if (nbytes <= 0) { if (nbytes < 0 && errno != EWOULDBLOCK && errno != EAGAIN) - flog_err_sys(LIB_ERR_SOCKET, "routing socket error: %s", + flog_err_sys(EC_LIB_SOCKET, "routing socket error: %s", safe_strerror(errno)); return 0; } @@ -1392,7 +1392,7 @@ static void routing_socket(struct zebra_ns *zns) } if (routing_sock < 0) { - flog_err_sys(LIB_ERR_SOCKET, + flog_err_sys(EC_LIB_SOCKET, "Can't init kernel routing socket"); return; } diff --git a/zebra/rt_socket.c b/zebra/rt_socket.c index 18328d380..a6de84d56 100644 --- a/zebra/rt_socket.c +++ b/zebra/rt_socket.c @@ -214,7 +214,7 @@ static int kernel_rtm_ipv4(int cmd, const struct prefix *p, case ZEBRA_ERR_RTEXIST: if (cmd != RTM_ADD) flog_err( - LIB_ERR_SYSTEM_CALL, + EC_LIB_SYSTEM_CALL, "%s: rtm_write() returned %d for command %d", __func__, error, cmd); continue; @@ -228,7 +228,7 @@ static int kernel_rtm_ipv4(int cmd, const struct prefix *p, case ZEBRA_ERR_RTUNREACH: default: flog_err( - LIB_ERR_SYSTEM_CALL, + EC_LIB_SYSTEM_CALL, "%s: %s: rtm_write() unexpectedly returned %d for command %s", __func__, prefix2str(p, prefix_buf, diff --git a/zebra/rtadv.c b/zebra/rtadv.c index 08770176e..f9bd5ad1b 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -375,7 +375,7 @@ static void rtadv_send_packet(int sock, struct interface *ifp) ret = sendmsg(sock, &msg, 0); if (ret < 0) { - flog_err_sys(LIB_ERR_SOCKET, + flog_err_sys(EC_LIB_SOCKET, "%s(%u): Tx RA failed, socket %u error %d (%s)", ifp->name, ifp->ifindex, sock, errno, safe_strerror(errno)); @@ -621,7 +621,7 @@ static int rtadv_read(struct thread *thread) &hoplimit); if (len < 0) { - flog_err_sys(LIB_ERR_SOCKET, + flog_err_sys(EC_LIB_SOCKET, "RA/RS recv failed, socket %u error %s", sock, safe_strerror(errno)); return len; @@ -1767,7 +1767,7 @@ static int if_join_all_router(int sock, struct interface *ifp) ret = setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP, (char *)&mreq, sizeof mreq); if (ret < 0) - flog_err_sys(LIB_ERR_SOCKET, + flog_err_sys(EC_LIB_SOCKET, "%s(%u): Failed to join group, socket %u error %s", ifp->name, ifp->ifindex, sock, safe_strerror(errno)); @@ -1794,7 +1794,7 @@ static int if_leave_all_router(int sock, struct interface *ifp) sizeof mreq); if (ret < 0) flog_err_sys( - LIB_ERR_SOCKET, + EC_LIB_SOCKET, "%s(%u): Failed to leave group, socket %u error %s", ifp->name, ifp->ifindex, sock, safe_strerror(errno)); diff --git a/zebra/rtread_getmsg.c b/zebra/rtread_getmsg.c index 40982639c..c1bd68f9d 100644 --- a/zebra/rtread_getmsg.c +++ b/zebra/rtread_getmsg.c @@ -121,7 +121,7 @@ void route_read(struct zebra_ns *zns) int flags, dev, retval, process; if ((dev = open(_PATH_GETMSG_ROUTE, O_RDWR)) == -1) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, "can't open %s: %s", + flog_err_sys(EC_LIB_SYSTEM_CALL, "can't open %s: %s", _PATH_GETMSG_ROUTE, safe_strerror(errno)); return; } @@ -143,7 +143,7 @@ void route_read(struct zebra_ns *zns) flags = 0; if (putmsg(dev, &msgdata, NULL, flags) == -1) { - flog_err_sys(LIB_ERR_SOCKET, "putmsg failed: %s", + flog_err_sys(EC_LIB_SOCKET, "putmsg failed: %s", safe_strerror(errno)); goto exit; } @@ -156,7 +156,7 @@ void route_read(struct zebra_ns *zns) retval = getmsg(dev, &msgdata, NULL, &flags); if (retval == -1) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, + flog_err_sys(EC_LIB_SYSTEM_CALL, "getmsg(ctl) failed: %s", safe_strerror(errno)); goto exit; @@ -215,7 +215,7 @@ void route_read(struct zebra_ns *zns) retval = getmsg(dev, NULL, &msgdata, &flags); if (retval == -1) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, + flog_err_sys(EC_LIB_SYSTEM_CALL, "getmsg(data) failed: %s", safe_strerror(errno)); goto exit; diff --git a/zebra/rule_socket.c b/zebra/rule_socket.c index 8faca1bbc..42fb6346e 100644 --- a/zebra/rule_socket.c +++ b/zebra/rule_socket.c @@ -45,14 +45,14 @@ enum dp_req_result kernel_add_pbr_rule(struct zebra_pbr_rule *rule) { - flog_err(LIB_ERR_UNAVAILABLE, "%s not Implemented for this platform", + flog_err(EC_LIB_UNAVAILABLE, "%s not Implemented for this platform", __PRETTY_FUNCTION__); return DP_REQUEST_FAILURE; } enum dp_req_result kernel_del_pbr_rule(struct zebra_pbr_rule *rule) { - flog_err(LIB_ERR_UNAVAILABLE, "%s not Implemented for this platform", + flog_err(EC_LIB_UNAVAILABLE, "%s not Implemented for this platform", __PRETTY_FUNCTION__); return DP_REQUEST_FAILURE; } diff --git a/zebra/zebra_mpls_openbsd.c b/zebra/zebra_mpls_openbsd.c index e11e8a373..71679f26d 100644 --- a/zebra/zebra_mpls_openbsd.c +++ b/zebra/zebra_mpls_openbsd.c @@ -123,7 +123,7 @@ static int kernel_send_rtmsg_v4(int action, mpls_label_t in_label, } if (ret == -1) - flog_err_sys(LIB_ERR_SOCKET, "%s: %s", __func__, + flog_err_sys(EC_LIB_SOCKET, "%s: %s", __func__, safe_strerror(errno)); return ret; @@ -230,7 +230,7 @@ static int kernel_send_rtmsg_v6(int action, mpls_label_t in_label, } if (ret == -1) - flog_err_sys(LIB_ERR_SOCKET, "%s: %s", __func__, + flog_err_sys(EC_LIB_SOCKET, "%s: %s", __func__, safe_strerror(errno)); return ret; @@ -398,7 +398,7 @@ static int kmpw_install(struct zebra_pw *pw) strlcpy(ifr.ifr_name, pw->ifname, sizeof(ifr.ifr_name)); ifr.ifr_data = (caddr_t)&imr; if (ioctl(kr_state.ioctl_fd, SIOCSETMPWCFG, &ifr) == -1) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, "ioctl SIOCSETMPWCFG: %s", + flog_err_sys(EC_LIB_SYSTEM_CALL, "ioctl SIOCSETMPWCFG: %s", safe_strerror(errno)); return -1; } @@ -416,7 +416,7 @@ static int kmpw_uninstall(struct zebra_pw *pw) strlcpy(ifr.ifr_name, pw->ifname, sizeof(ifr.ifr_name)); ifr.ifr_data = (caddr_t)&imr; if (ioctl(kr_state.ioctl_fd, SIOCSETMPWCFG, &ifr) == -1) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, "ioctl SIOCSETMPWCFG: %s", + flog_err_sys(EC_LIB_SYSTEM_CALL, "ioctl SIOCSETMPWCFG: %s", safe_strerror(errno)); return -1; } @@ -431,13 +431,13 @@ int mpls_kernel_init(void) socklen_t optlen; if ((kr_state.fd = socket(AF_ROUTE, SOCK_RAW, 0)) == -1) { - flog_err_sys(LIB_ERR_SOCKET, "%s: socket", __func__); + flog_err_sys(EC_LIB_SOCKET, "%s: socket", __func__); return -1; } if ((kr_state.ioctl_fd = socket(AF_INET, SOCK_DGRAM | SOCK_NONBLOCK, 0)) == -1) { - flog_err_sys(LIB_ERR_SOCKET, "%s: ioctl socket", __func__); + flog_err_sys(EC_LIB_SOCKET, "%s: ioctl socket", __func__); return -1; } @@ -446,7 +446,7 @@ int mpls_kernel_init(void) if (getsockopt(kr_state.fd, SOL_SOCKET, SO_RCVBUF, &default_rcvbuf, &optlen) == -1) - flog_err_sys(LIB_ERR_SOCKET, + flog_err_sys(EC_LIB_SOCKET, "kr_init getsockopt SOL_SOCKET SO_RCVBUF"); else for (rcvbuf = MAX_RTSOCK_BUF; diff --git a/zebra/zebra_netns_id.c b/zebra/zebra_netns_id.c index 14848f61a..b8ed0e558 100644 --- a/zebra/zebra_netns_id.c +++ b/zebra/zebra_netns_id.c @@ -88,7 +88,7 @@ static int send_receive(int sock, struct nlmsghdr *nlh, unsigned int seq, ret = sendto(sock, (const void *)nlh, (size_t)nlh->nlmsg_len, 0, (struct sockaddr *)&snl, (socklen_t)sizeof(snl)); if (ret < 0) { - flog_err_sys(LIB_ERR_SOCKET, "netlink( %u) sendmsg() error: %s", + flog_err_sys(EC_LIB_SOCKET, "netlink( %u) sendmsg() error: %s", sock, safe_strerror(errno)); return -1; } @@ -109,7 +109,7 @@ static int send_receive(int sock, struct nlmsghdr *nlh, unsigned int seq, }; ret = recvmsg(sock, &msg, 0); if (ret < 0) { - flog_err_sys(LIB_ERR_SOCKET, + flog_err_sys(EC_LIB_SOCKET, "netlink recvmsg: error %d (errno %u)", ret, errno); return -1; @@ -176,7 +176,7 @@ ns_id_t zebra_ns_id_get(const char *netnspath) /* netlink socket */ sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sock < 0) { - flog_err_sys(LIB_ERR_SOCKET, "netlink( %u) socket() error: %s", + flog_err_sys(EC_LIB_SOCKET, "netlink( %u) socket() error: %s", sock, safe_strerror(errno)); close(fd); return NS_UNKNOWN; @@ -187,7 +187,7 @@ ns_id_t zebra_ns_id_get(const char *netnspath) snl.nl_pid = 0; /* AUTO PID */ ret = bind(sock, (struct sockaddr *)&snl, sizeof(snl)); if (ret < 0) { - flog_err_sys(LIB_ERR_SOCKET, + flog_err_sys(EC_LIB_SOCKET, "netlink( %u) socket() bind error: %s", sock, safe_strerror(errno)); close(sock); @@ -263,7 +263,7 @@ ns_id_t zebra_ns_id_get(const char *netnspath) if (ret <= 0) { if (errno != EEXIST && ret != 0) { flog_err( - LIB_ERR_SOCKET, + EC_LIB_SOCKET, "netlink( %u) recvfrom() error 2 when reading: %s", fd, safe_strerror(errno)); close(sock); diff --git a/zebra/zebra_netns_notify.c b/zebra/zebra_netns_notify.c index 29defa715..2608ffd7a 100644 --- a/zebra/zebra_netns_notify.c +++ b/zebra/zebra_netns_notify.c @@ -288,7 +288,7 @@ void zebra_ns_notify_parse(void) DIR *srcdir = opendir(NS_RUN_DIR); if (srcdir == NULL) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, + flog_err_sys(EC_LIB_SYSTEM_CALL, "NS parsing init: failed to parse %s", NS_RUN_DIR); return; } @@ -300,7 +300,7 @@ void zebra_ns_notify_parse(void) continue; if (fstatat(dirfd(srcdir), dent->d_name, &st, 0) < 0) { flog_err_sys( - LIB_ERR_SYSTEM_CALL, + EC_LIB_SYSTEM_CALL, "NS parsing init: failed to parse entry %s", dent->d_name); continue; @@ -330,13 +330,13 @@ void zebra_ns_notify_init(void) fd_monitor = inotify_init(); if (fd_monitor < 0) { flog_err_sys( - LIB_ERR_SYSTEM_CALL, + EC_LIB_SYSTEM_CALL, "NS notify init: failed to initialize inotify (%s)", safe_strerror(errno)); } if (inotify_add_watch(fd_monitor, NS_RUN_DIR, IN_CREATE | IN_DELETE) < 0) { - flog_err_sys(LIB_ERR_SYSTEM_CALL, + flog_err_sys(EC_LIB_SYSTEM_CALL, "NS notify watch: failed to add watch (%s)", safe_strerror(errno)); } diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c index f1fa8cc67..1d7a59e06 100644 --- a/zebra/zebra_ptm.c +++ b/zebra/zebra_ptm.c @@ -181,7 +181,7 @@ static int zebra_ptm_flush_messages(struct thread *thread) switch (buffer_flush_available(ptm_cb.wb, ptm_cb.ptm_sock)) { case BUFFER_ERROR: - flog_err_sys(LIB_ERR_SOCKET, "%s ptm socket error: %s", + flog_err_sys(EC_LIB_SOCKET, "%s ptm socket error: %s", __func__, safe_strerror(errno)); close(ptm_cb.ptm_sock); ptm_cb.ptm_sock = -1; @@ -207,7 +207,7 @@ static int zebra_ptm_send_message(char *data, int size) errno = 0; switch (buffer_write(ptm_cb.wb, ptm_cb.ptm_sock, data, size)) { case BUFFER_ERROR: - flog_err_sys(LIB_ERR_SOCKET, "%s ptm socket error: %s", + flog_err_sys(EC_LIB_SOCKET, "%s ptm socket error: %s", __func__, safe_strerror(errno)); close(ptm_cb.ptm_sock); ptm_cb.ptm_sock = -1; @@ -649,7 +649,7 @@ int zebra_ptm_sock_read(struct thread *thread) if (((rc == 0) && !errno) || (errno && (errno != EWOULDBLOCK) && (errno != EAGAIN))) { - flog_err_sys(LIB_ERR_SOCKET, + flog_err_sys(EC_LIB_SOCKET, "%s routing socket error: %s(%d) bytes %d", __func__, safe_strerror(errno), errno, rc); diff --git a/zebra/zserv.c b/zebra/zserv.c index a013d8dd5..97fc43f8a 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -744,7 +744,7 @@ static int zserv_accept(struct thread *thread) client_sock = accept(accept_sock, (struct sockaddr *)&client, &len); if (client_sock < 0) { - flog_err_sys(LIB_ERR_SOCKET, "Can't accept zebra socket: %s", + flog_err_sys(EC_LIB_SOCKET, "Can't accept zebra socket: %s", safe_strerror(errno)); return -1; } @@ -775,7 +775,7 @@ void zserv_start(char *path) /* Make UNIX domain socket. */ zebrad.sock = socket(sa.ss_family, SOCK_STREAM, 0); if (zebrad.sock < 0) { - flog_err_sys(LIB_ERR_SOCKET, "Can't create zserv socket: %s", + flog_err_sys(EC_LIB_SOCKET, "Can't create zserv socket: %s", safe_strerror(errno)); return; } @@ -798,7 +798,7 @@ void zserv_start(char *path) ret = bind(zebrad.sock, (struct sockaddr *)&sa, sa_len); } if (ret < 0) { - flog_err_sys(LIB_ERR_SOCKET, + flog_err_sys(EC_LIB_SOCKET, "Can't bind zserv socket on %s: %s", path, safe_strerror(errno)); close(zebrad.sock); @@ -808,7 +808,7 @@ void zserv_start(char *path) ret = listen(zebrad.sock, 5); if (ret < 0) { - flog_err_sys(LIB_ERR_SOCKET, + flog_err_sys(EC_LIB_SOCKET, "Can't listen to zserv socket %s: %s", path, safe_strerror(errno)); close(zebrad.sock); |