aboutsummaryrefslogtreecommitdiff
path: root/networking/libiproute
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2003-03-19 09:13:01 +0000
committerManuel Novoa III <mjn3@codepoet.org>2003-03-19 09:13:01 +0000
commitcad5364599eb5062d59e0c397ed638ddd61a8d5d (patch)
treea318d0f03aa076c74b576ea45dc543a5669e8e91 /networking/libiproute
parente01f9662a5bd5d91be4f6b3941b57fff73cd5af1 (diff)
downloadbusybox-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.gz
Major coreutils update.
Diffstat (limited to 'networking/libiproute')
-rw-r--r--networking/libiproute/ip_parse_common_args.c4
-rw-r--r--networking/libiproute/ipaddress.c24
-rw-r--r--networking/libiproute/iplink.c8
-rw-r--r--networking/libiproute/iproute.c34
-rw-r--r--networking/libiproute/iptunnel.c40
-rw-r--r--networking/libiproute/libnetlink.c70
-rw-r--r--networking/libiproute/ll_addr.c6
-rw-r--r--networking/libiproute/utils.c18
8 files changed, 102 insertions, 102 deletions
diff --git a/networking/libiproute/ip_parse_common_args.c b/networking/libiproute/ip_parse_common_args.c
index 4b4355ac1..21e9f74ba 100644
--- a/networking/libiproute/ip_parse_common_args.c
+++ b/networking/libiproute/ip_parse_common_args.c
@@ -48,7 +48,7 @@ void ip_parse_common_args(int *argcp, char ***argvp)
argc--;
argv++;
if (! argv[1])
- show_usage();
+ bb_show_usage();
if (strcmp(argv[1], "inet") == 0)
preferred_family = AF_INET;
else if (strcmp(argv[1], "inet6") == 0)
@@ -66,7 +66,7 @@ void ip_parse_common_args(int *argcp, char ***argvp)
} else if (matches(opt, "-oneline") == 0) {
++oneline;
} else {
- show_usage();
+ bb_show_usage();
}
argc--; argv++;
}
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c
index 8eba90c77..44e871ee5 100644
--- a/networking/libiproute/ipaddress.c
+++ b/networking/libiproute/ipaddress.c
@@ -125,7 +125,7 @@ static int print_linkinfo(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg
memset(tb, 0, sizeof(tb));
parse_rtattr(tb, IFLA_MAX, IFLA_RTA(ifi), len);
if (tb[IFLA_IFNAME] == NULL) {
- error_msg("nil ifname");
+ bb_error_msg("nil ifname");
return -1;
}
if (filter.label &&
@@ -217,7 +217,7 @@ static int print_addrinfo(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg
return 0;
len -= NLMSG_LENGTH(sizeof(*ifa));
if (len < 0) {
- error_msg("wrong nlmsg len %d", len);
+ bb_error_msg("wrong nlmsg len %d", len);
return -1;
}
@@ -489,17 +489,17 @@ extern int ipaddr_list_or_flush(int argc, char **argv, int flush)
exit(1);
if (rtnl_wilddump_request(&rth, preferred_family, RTM_GETLINK) < 0) {
- perror_msg_and_die("Cannot send dump request");
+ bb_perror_msg_and_die("Cannot send dump request");
}
if (rtnl_dump_filter(&rth, store_nlmsg, &linfo, NULL, NULL) < 0) {
- error_msg_and_die("Dump terminated");
+ bb_error_msg_and_die("Dump terminated");
}
if (filter_dev) {
filter.ifindex = ll_name_to_index(filter_dev);
if (filter.ifindex <= 0) {
- error_msg("Device \"%s\" does not exist.", filter_dev);
+ bb_error_msg("Device \"%s\" does not exist.", filter_dev);
return -1;
}
}
@@ -539,11 +539,11 @@ extern int ipaddr_list_or_flush(int argc, char **argv, int flush)
if (filter.family != AF_PACKET) {
if (rtnl_wilddump_request(&rth, filter.family, RTM_GETADDR) < 0) {
- perror_msg_and_die("Cannot send dump request");
+ bb_perror_msg_and_die("Cannot send dump request");
}
if (rtnl_dump_filter(&rth, store_nlmsg, &ainfo, NULL, NULL) < 0) {
- error_msg_and_die("Dump terminated");
+ bb_error_msg_and_die("Dump terminated");
}
}
@@ -749,11 +749,11 @@ static int ipaddr_modify(int cmd, int argc, char **argv)
}
if (d == NULL) {
- error_msg("Not enough information: \"dev\" argument is required.");
+ bb_error_msg("Not enough information: \"dev\" argument is required.");
return -1;
}
if (l && matches(d, l) != 0) {
- error_msg_and_die("\"dev\" (%s) must match \"label\" (%s).", d, l);
+ bb_error_msg_and_die("\"dev\" (%s) must match \"label\" (%s).", d, l);
}
if (peer_len == 0 && local_len && cmd != RTM_DELADDR) {
@@ -767,7 +767,7 @@ static int ipaddr_modify(int cmd, int argc, char **argv)
inet_prefix brd;
int i;
if (req.ifa.ifa_family != AF_INET) {
- error_msg("Broadcast can be set only for IPv4 addresses");
+ bb_error_msg("Broadcast can be set only for IPv4 addresses");
return -1;
}
brd = peer;
@@ -791,7 +791,7 @@ static int ipaddr_modify(int cmd, int argc, char **argv)
ll_init_map(&rth);
if ((req.ifa.ifa_index = ll_name_to_index(d)) == 0) {
- error_msg("Cannot find device \"%s\"", d);
+ bb_error_msg("Cannot find device \"%s\"", d);
return -1;
}
@@ -821,5 +821,5 @@ extern int do_ipaddr(int argc, char **argv)
case 5: /* flush */
return ipaddr_list_or_flush(argc-1, argv+1, 1);
}
- error_msg_and_die("Unknown command %s", *argv);
+ bb_error_msg_and_die("Unknown command %s", *argv);
}
diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c
index 1cfaf6d6a..f826ba081 100644
--- a/networking/libiproute/iplink.c
+++ b/networking/libiproute/iplink.c
@@ -42,7 +42,7 @@ static int do_link;
static int on_off(char *msg)
{
- error_msg("Error: argument of \"%s\" must be \"on\" or \"off\"", msg);
+ bb_error_msg("Error: argument of \"%s\" must be \"on\" or \"off\"", msg);
return -1;
}
@@ -211,7 +211,7 @@ static int parse_address(char *dev, int hatype, int halen, char *lla, struct ifr
if (alen < 0)
return -1;
if (alen != halen) {
- error_msg("Wrong address (%s) length: expected %d bytes", lla, halen);
+ bb_error_msg("Wrong address (%s) length: expected %d bytes", lla, halen);
return -1;
}
return 0;
@@ -293,7 +293,7 @@ static int do_set(int argc, char **argv)
}
if (!dev) {
- error_msg("Not enough of information: \"dev\" argument is required.");
+ bb_error_msg("Not enough of information: \"dev\" argument is required.");
exit(-1);
}
@@ -358,6 +358,6 @@ int do_iplink(int argc, char **argv)
} else
return ipaddr_list_link(0, NULL);
- error_msg("Command \"%s\" is unknown, try \"ip link help\".", *argv);
+ bb_error_msg("Command \"%s\" is unknown, try \"ip link help\".", *argv);
exit(-1);
}
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index be4435f66..3dcafdb6f 100644
--- a/networking/libiproute/iproute.c
+++ b/networking/libiproute/iproute.c
@@ -85,7 +85,7 @@ static int print_route(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
return 0;
len -= NLMSG_LENGTH(sizeof(*r));
if (len < 0) {
- error_msg("wrong nlmsg len %d", len);
+ bb_error_msg("wrong nlmsg len %d", len);
return -1;
}
@@ -385,7 +385,7 @@ static int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
if (d) {
if ((idx = ll_name_to_index(d)) == 0) {
- error_msg("Cannot find device \"%s\"", d);
+ bb_error_msg("Cannot find device \"%s\"", d);
return -1;
}
addattr32(&req.n, sizeof(req), RTA_OIF, idx);
@@ -549,7 +549,7 @@ static int iproute_list_or_flush(int argc, char **argv, int flush)
if (id) {
if ((idx = ll_name_to_index(id)) == 0) {
- error_msg("Cannot find device \"%s\"", id);
+ bb_error_msg("Cannot find device \"%s\"", id);
return -1;
}
filter.iif = idx;
@@ -557,7 +557,7 @@ static int iproute_list_or_flush(int argc, char **argv, int flush)
}
if (od) {
if ((idx = ll_name_to_index(od)) == 0) {
- error_msg("Cannot find device \"%s\"", od);
+ bb_error_msg("Cannot find device \"%s\"", od);
}
filter.oif = idx;
filter.oifmask = -1;
@@ -587,7 +587,7 @@ static int iproute_list_or_flush(int argc, char **argv, int flush)
}
filter.flushed = 0;
if (rtnl_dump_filter(&rth, print_route, stdout, NULL, NULL) < 0) {
- error_msg("Flush terminated\n");
+ bb_error_msg("Flush terminated\n");
return -1;
}
if (filter.flushed == 0) {
@@ -606,16 +606,16 @@ static int iproute_list_or_flush(int argc, char **argv, int flush)
if (filter.tb != -1) {
if (rtnl_wilddump_request(&rth, do_ipv6, RTM_GETROUTE) < 0) {
- perror_msg_and_die("Cannot send dump request");
+ bb_perror_msg_and_die("Cannot send dump request");
}
} else {
if (rtnl_rtcache_request(&rth, do_ipv6) < 0) {
- perror_msg_and_die("Cannot send dump request");
+ bb_perror_msg_and_die("Cannot send dump request");
}
}
if (rtnl_dump_filter(&rth, print_route, stdout, NULL, NULL) < 0) {
- error_msg_and_die("Dump terminated");
+ bb_error_msg_and_die("Dump terminated");
}
exit(0);
@@ -703,7 +703,7 @@ static int iproute_get(int argc, char **argv)
}
if (req.r.rtm_dst_len == 0) {
- error_msg_and_die("need at least destination address");
+ bb_error_msg_and_die("need at least destination address");
}
if (rtnl_open(&rth, 0) < 0)
@@ -716,14 +716,14 @@ static int iproute_get(int argc, char **argv)
if (idev) {
if ((idx = ll_name_to_index(idev)) == 0) {
- error_msg("Cannot find device \"%s\"", idev);
+ bb_error_msg("Cannot find device \"%s\"", idev);
return -1;
}
addattr32(&req.n, sizeof(req), RTA_IIF, idx);
}
if (odev) {
if ((idx = ll_name_to_index(odev)) == 0) {
- error_msg("Cannot find device \"%s\"", odev);
+ bb_error_msg("Cannot find device \"%s\"", odev);
return -1;
}
addattr32(&req.n, sizeof(req), RTA_OIF, idx);
@@ -744,16 +744,16 @@ static int iproute_get(int argc, char **argv)
struct rtattr * tb[RTA_MAX+1];
if (print_route(NULL, &req.n, (void*)stdout) < 0) {
- error_msg_and_die("An error :-)");
+ bb_error_msg_and_die("An error :-)");
}
if (req.n.nlmsg_type != RTM_NEWROUTE) {
- error_msg("Not a route?");
+ bb_error_msg("Not a route?");
return -1;
}
len -= NLMSG_LENGTH(sizeof(*r));
if (len < 0) {
- error_msg("Wrong len %d", len);
+ bb_error_msg("Wrong len %d", len);
return -1;
}
@@ -764,7 +764,7 @@ static int iproute_get(int argc, char **argv)
tb[RTA_PREFSRC]->rta_type = RTA_SRC;
r->rtm_src_len = 8*RTA_PAYLOAD(tb[RTA_PREFSRC]);
} else if (!tb[RTA_SRC]) {
- error_msg("Failed to connect the route");
+ bb_error_msg("Failed to connect the route");
return -1;
}
if (!odev && tb[RTA_OIF]) {
@@ -785,7 +785,7 @@ static int iproute_get(int argc, char **argv)
}
if (print_route(NULL, &req.n, (void*)stdout) < 0) {
- error_msg_and_die("An error :-)");
+ bb_error_msg_and_die("An error :-)");
}
exit(0);
@@ -830,7 +830,7 @@ int do_iproute(int argc, char **argv)
case 11: /* flush */
return iproute_list_or_flush(argc-1, argv+1, 1);
default:
- error_msg_and_die("Unknown command %s", *argv);
+ bb_error_msg_and_die("Unknown command %s", *argv);
}
return iproute_modify(cmd, flags, argc-1, argv+1);
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c
index 1eb17799c..eae5bb091 100644
--- a/networking/libiproute/iptunnel.c
+++ b/networking/libiproute/iptunnel.c
@@ -47,7 +47,7 @@ static int do_ioctl_get_ifindex(char *dev)
strcpy(ifr.ifr_name, dev);
fd = socket(AF_INET, SOCK_DGRAM, 0);
if (ioctl(fd, SIOCGIFINDEX, &ifr)) {
- perror_msg("ioctl");
+ bb_perror_msg("ioctl");
return 0;
}
close(fd);
@@ -62,7 +62,7 @@ static int do_ioctl_get_iftype(char *dev)
strcpy(ifr.ifr_name, dev);
fd = socket(AF_INET, SOCK_DGRAM, 0);
if (ioctl(fd, SIOCGIFHWADDR, &ifr)) {
- perror_msg("ioctl");
+ bb_perror_msg("ioctl");
return -1;
}
close(fd);
@@ -78,7 +78,7 @@ static char *do_ioctl_get_ifname(int idx)
ifr.ifr_ifindex = idx;
fd = socket(AF_INET, SOCK_DGRAM, 0);
if (ioctl(fd, SIOCGIFNAME, &ifr)) {
- perror_msg("ioctl");
+ bb_perror_msg("ioctl");
return NULL;
}
close(fd);
@@ -98,7 +98,7 @@ static int do_get_ioctl(char *basedev, struct ip_tunnel_parm *p)
fd = socket(AF_INET, SOCK_DGRAM, 0);
err = ioctl(fd, SIOCGETTUNNEL, &ifr);
if (err) {
- perror_msg("ioctl");
+ bb_perror_msg("ioctl");
}
close(fd);
return err;
@@ -119,7 +119,7 @@ static int do_add_ioctl(int cmd, char *basedev, struct ip_tunnel_parm *p)
fd = socket(AF_INET, SOCK_DGRAM, 0);
err = ioctl(fd, cmd, &ifr);
if (err) {
- perror_msg("ioctl");
+ bb_perror_msg("ioctl");
}
close(fd);
return err;
@@ -140,7 +140,7 @@ static int do_del_ioctl(char *basedev, struct ip_tunnel_parm *p)
fd = socket(AF_INET, SOCK_DGRAM, 0);
err = ioctl(fd, SIOCDELTUNNEL, &ifr);
if (err) {
- perror_msg("ioctl");
+ bb_perror_msg("ioctl");
}
close(fd);
return err;
@@ -166,26 +166,26 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
if (strcmp(*argv, "ipip") == 0 ||
strcmp(*argv, "ip/ip") == 0) {
if (p->iph.protocol && p->iph.protocol != IPPROTO_IPIP) {
- error_msg("You managed to ask for more than one tunnel mode.");
+ bb_error_msg("You managed to ask for more than one tunnel mode.");
exit(-1);
}
p->iph.protocol = IPPROTO_IPIP;
} else if (strcmp(*argv, "gre") == 0 ||
strcmp(*argv, "gre/ip") == 0) {
if (p->iph.protocol && p->iph.protocol != IPPROTO_GRE) {
- error_msg("You managed to ask for more than one tunnel mode.");
+ bb_error_msg("You managed to ask for more than one tunnel mode.");
exit(-1);
}
p->iph.protocol = IPPROTO_GRE;
} else if (strcmp(*argv, "sit") == 0 ||
strcmp(*argv, "ipv6/ip") == 0) {
if (p->iph.protocol && p->iph.protocol != IPPROTO_IPV6) {
- error_msg("You managed to ask for more than one tunnel mode.");
+ bb_error_msg("You managed to ask for more than one tunnel mode.");
exit(-1);
}
p->iph.protocol = IPPROTO_IPV6;
} else {
- error_msg("Cannot guess tunnel mode.");
+ bb_error_msg("Cannot guess tunnel mode.");
exit(-1);
}
} else if (strcmp(*argv, "key") == 0) {
@@ -197,7 +197,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
p->i_key = p->o_key = get_addr32(*argv);
else {
if (get_unsigned(&uval, *argv, 0)<0) {
- error_msg("invalid value of \"key\"");
+ bb_error_msg("invalid value of \"key\"");
exit(-1);
}
p->i_key = p->o_key = htonl(uval);
@@ -210,7 +210,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
p->o_key = get_addr32(*argv);
else {
if (get_unsigned(&uval, *argv, 0)<0) {
- error_msg("invalid value of \"ikey\"");
+ bb_error_msg("invalid value of \"ikey\"");
exit(-1);
}
p->i_key = htonl(uval);
@@ -223,7 +223,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
p->o_key = get_addr32(*argv);
else {
if (get_unsigned(&uval, *argv, 0)<0) {
- error_msg("invalid value of \"okey\"");
+ bb_error_msg("invalid value of \"okey\"");
exit(-1);
}
p->o_key = htonl(uval);
@@ -308,7 +308,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
if (p->iph.protocol == IPPROTO_IPIP || p->iph.protocol == IPPROTO_IPV6) {
if ((p->i_flags & GRE_KEY) || (p->o_flags & GRE_KEY)) {
- error_msg("Keys are not allowed with ipip and sit.");
+ bb_error_msg("Keys are not allowed with ipip and sit.");
return -1;
}
}
@@ -328,7 +328,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p)
p->o_flags |= GRE_KEY;
}
if (IN_MULTICAST(ntohl(p->iph.daddr)) && !p->iph.saddr) {
- error_msg("Broadcast tunnel requires a source address.");
+ bb_error_msg("Broadcast tunnel requires a source address.");
return -1;
}
return 0;
@@ -343,7 +343,7 @@ static int do_add(int cmd, int argc, char **argv)
return -1;
if (p.iph.ttl && p.iph.frag_off == 0) {
- error_msg("ttl != 0 and noptmudisc are incompatible");
+ bb_error_msg("ttl != 0 and noptmudisc are incompatible");
return -1;
}
@@ -355,7 +355,7 @@ static int do_add(int cmd, int argc, char **argv)
case IPPROTO_IPV6:
return do_add_ioctl(cmd, "sit0", &p);
default:
- error_msg("cannot determine tunnel mode (ipip, gre or sit)");
+ bb_error_msg("cannot determine tunnel mode (ipip, gre or sit)");
return -1;
}
return -1;
@@ -464,7 +464,7 @@ static int do_tunnels_list(struct ip_tunnel_parm *p)
buf[sizeof(buf) - 1] = 0;
if ((ptr = strchr(buf, ':')) == NULL ||
(*ptr++ = 0, sscanf(buf, "%s", name) != 1)) {
- error_msg("Wrong format of /proc/net/dev. Sorry.");
+ bb_error_msg("Wrong format of /proc/net/dev. Sorry.");
return -1;
}
if (sscanf(ptr, "%ld%ld%ld%ld%ld%ld%ld%*d%ld%ld%ld%ld%ld%ld%ld",
@@ -477,7 +477,7 @@ static int do_tunnels_list(struct ip_tunnel_parm *p)
continue;
type = do_ioctl_get_iftype(name);
if (type == -1) {
- error_msg("Failed to get type of [%s]", name);
+ bb_error_msg("Failed to get type of [%s]", name);
continue;
}
if (type != ARPHRD_TUNNEL && type != ARPHRD_IPGRE && type != ARPHRD_SIT)
@@ -543,6 +543,6 @@ int do_iptunnel(int argc, char **argv)
} else
return do_show(0, NULL);
- error_msg("Command \"%s\" is unknown, try \"ip tunnel help\".", *argv);
+ bb_error_msg("Command \"%s\" is unknown, try \"ip tunnel help\".", *argv);
exit(-1);
}
diff --git a/networking/libiproute/libnetlink.c b/networking/libiproute/libnetlink.c
index fbc555dfe..04411931d 100644
--- a/networking/libiproute/libnetlink.c
+++ b/networking/libiproute/libnetlink.c
@@ -34,7 +34,7 @@ int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions)
rth->fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
if (rth->fd < 0) {
- perror_msg("Cannot open netlink socket");
+ bb_perror_msg("Cannot open netlink socket");
return -1;
}
@@ -43,20 +43,20 @@ int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions)
rth->local.nl_groups = subscriptions;
if (bind(rth->fd, (struct sockaddr*)&rth->local, sizeof(rth->local)) < 0) {
- perror_msg("Cannot bind netlink socket");
+ bb_perror_msg("Cannot bind netlink socket");
return -1;
}
addr_len = sizeof(rth->local);
if (getsockname(rth->fd, (struct sockaddr*)&rth->local, &addr_len) < 0) {
- perror_msg("Cannot getsockname");
+ bb_perror_msg("Cannot getsockname");
return -1;
}
if (addr_len != sizeof(rth->local)) {
- error_msg("Wrong address length %d", addr_len);
+ bb_error_msg("Wrong address length %d", addr_len);
return -1;
}
if (rth->local.nl_family != AF_NETLINK) {
- error_msg("Wrong address family %d", rth->local.nl_family);
+ bb_error_msg("Wrong address family %d", rth->local.nl_family);
return -1;
}
rth->seq = time(NULL);
@@ -144,15 +144,15 @@ int rtnl_dump_filter(struct rtnl_handle *rth,
if (status < 0) {
if (errno == EINTR)
continue;
- perror_msg("OVERRUN");
+ bb_perror_msg("OVERRUN");
continue;
}
if (status == 0) {
- error_msg("EOF on netlink");
+ bb_error_msg("EOF on netlink");
return -1;
}
if (msg.msg_namelen != sizeof(nladdr)) {
- error_msg_and_die("sender address length == %d", msg.msg_namelen);
+ bb_error_msg_and_die("sender address length == %d", msg.msg_namelen);
}
h = (struct nlmsghdr*)buf;
@@ -176,10 +176,10 @@ int rtnl_dump_filter(struct rtnl_handle *rth,
if (h->nlmsg_type == NLMSG_ERROR) {
struct nlmsgerr *l_err = (struct nlmsgerr*)NLMSG_DATA(h);
if (h->nlmsg_len < NLMSG_LENGTH(sizeof(struct nlmsgerr))) {
- error_msg("ERROR truncated");
+ bb_error_msg("ERROR truncated");
} else {
errno = -l_err->error;
- perror_msg("RTNETLINK answers");
+ bb_perror_msg("RTNETLINK answers");
}
return -1;
}
@@ -192,11 +192,11 @@ skip_it:
h = NLMSG_NEXT(h, status);
}
if (msg.msg_flags & MSG_TRUNC) {
- error_msg("Message truncated");
+ bb_error_msg("Message truncated");
continue;
}
if (status) {
- error_msg_and_die("!!!Remnant of size %d", status);
+ bb_error_msg_and_die("!!!Remnant of size %d", status);
}
}
}
@@ -231,7 +231,7 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
status = sendmsg(rtnl->fd, &msg, 0);
if (status < 0) {
- perror_msg("Cannot talk to rtnetlink");
+ bb_perror_msg("Cannot talk to rtnetlink");
return -1;
}
@@ -245,15 +245,15 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
if (errno == EINTR) {
continue;
}
- perror_msg("OVERRUN");
+ bb_perror_msg("OVERRUN");
continue;
}
if (status == 0) {
- error_msg("EOF on netlink");
+ bb_error_msg("EOF on netlink");
return -1;
}
if (msg.msg_namelen != sizeof(nladdr)) {
- error_msg_and_die("sender address length == %d", msg.msg_namelen);
+ bb_error_msg_and_die("sender address length == %d", msg.msg_namelen);
}
for (h = (struct nlmsghdr*)buf; status >= sizeof(*h); ) {
int l_err;
@@ -262,10 +262,10 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
if (l<0 || len>status) {
if (msg.msg_flags & MSG_TRUNC) {
- error_msg("Truncated message");
+ bb_error_msg("Truncated message");
return -1;
}
- error_msg_and_die("!!!malformed message: len=%d", len);
+ bb_error_msg_and_die("!!!malformed message: len=%d", len);
}
if (h->nlmsg_pid != rtnl->local.nl_pid ||
@@ -282,7 +282,7 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
if (h->nlmsg_type == NLMSG_ERROR) {
struct nlmsgerr *err = (struct nlmsgerr*)NLMSG_DATA(h);
if (l < sizeof(struct nlmsgerr)) {
- error_msg("ERROR truncated");
+ bb_error_msg("ERROR truncated");
} else {
errno = -err->error;
if (errno == 0) {
@@ -291,7 +291,7 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
}
return 0;
}
- perror_msg("RTNETLINK answers");
+ bb_perror_msg("RTNETLINK answers");
}
return -1;
}
@@ -300,17 +300,17 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
return 0;
}
- error_msg("Unexpected reply!!!");
+ bb_error_msg("Unexpected reply!!!");
status -= NLMSG_ALIGN(len);
h = (struct nlmsghdr*)((char*)h + NLMSG_ALIGN(len));
}
if (msg.msg_flags & MSG_TRUNC) {
- error_msg("Message truncated");
+ bb_error_msg("Message truncated");
continue;
}
if (status) {
- error_msg_and_die("!!!Remnant of size %d", status);
+ bb_error_msg_and_die("!!!Remnant of size %d", status);
}
}
}
@@ -346,15 +346,15 @@ int rtnl_listen(struct rtnl_handle *rtnl,
if (status < 0) {
if (errno == EINTR)
continue;
- perror_msg("OVERRUN");
+ bb_perror_msg("OVERRUN");
continue;
}
if (status == 0) {
- error_msg("EOF on netlink");
+ bb_error_msg("EOF on netlink");
return -1;
}
if (msg.msg_namelen != sizeof(nladdr)) {
- error_msg_and_die("Sender address length == %d", msg.msg_namelen);
+ bb_error_msg_and_die("Sender address length == %d", msg.msg_namelen);
}
for (h = (struct nlmsghdr*)buf; status >= sizeof(*h); ) {
int err;
@@ -363,10 +363,10 @@ int rtnl_listen(struct rtnl_handle *rtnl,
if (l<0 || len>status) {
if (msg.msg_flags & MSG_TRUNC) {
- error_msg("Truncated message");
+ bb_error_msg("Truncated message");
return -1;
}
- error_msg_and_die("!!!malformed message: len=%d", len);
+ bb_error_msg_and_die("!!!malformed message: len=%d", len);
}
err = handler(&nladdr, h, jarg);
@@ -378,11 +378,11 @@ int rtnl_listen(struct rtnl_handle *rtnl,
h = (struct nlmsghdr*)((char*)h + NLMSG_ALIGN(len));
}
if (msg.msg_flags & MSG_TRUNC) {
- error_msg("Message truncated");
+ bb_error_msg("Message truncated");
continue;
}
if (status) {
- error_msg_and_die("!!!Remnant of size %d", status);
+ bb_error_msg_and_die("!!!Remnant of size %d", status);
}
}
}
@@ -410,7 +410,7 @@ int rtnl_from_file(FILE *rtnl,
if (status < 0) {
if (errno == EINTR)
continue;
- perror_msg("rtnl_from_file: fread");
+ bb_perror_msg("rtnl_from_file: fread");
return -1;
}
if (status == 0)
@@ -421,7 +421,7 @@ int rtnl_from_file(FILE *rtnl,
l = len - sizeof(*h);
if (l<0 || len>sizeof(buf)) {
- error_msg("!!!malformed message: len=%d @%lu",
+ bb_error_msg("!!!malformed message: len=%d @%lu",
len, ftell(rtnl));
return -1;
}
@@ -429,11 +429,11 @@ int rtnl_from_file(FILE *rtnl,
status = fread(NLMSG_DATA(h), 1, NLMSG_ALIGN(l), rtnl);
if (status < 0) {
- perror_msg("rtnl_from_file: fread");
+ bb_perror_msg("rtnl_from_file: fread");
return -1;
}
if (status < l) {
- error_msg("rtnl-from_file: truncated message");
+ bb_error_msg("rtnl-from_file: truncated message");
return -1;
}
@@ -514,7 +514,7 @@ int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len)
rta = RTA_NEXT(rta,len);
}
if (len) {
- error_msg("!!!Deficit %d, rta_len=%d", len, rta->rta_len);
+ bb_error_msg("!!!Deficit %d, rta_len=%d", len, rta->rta_len);
}
return 0;
}
diff --git a/networking/libiproute/ll_addr.c b/networking/libiproute/ll_addr.c
index 39e561fe5..ada685f4e 100644
--- a/networking/libiproute/ll_addr.c
+++ b/networking/libiproute/ll_addr.c
@@ -44,7 +44,7 @@ int ll_addr_a2n(unsigned char *lladdr, int len, char *arg)
if (strchr(arg, '.')) {
inet_prefix pfx;
if (get_addr_1(&pfx, arg, AF_INET)) {
- error_msg("\"%s\" is invalid lladdr.", arg);
+ bb_error_msg("\"%s\" is invalid lladdr.", arg);
return -1;
}
if (len < 4) {
@@ -63,11 +63,11 @@ int ll_addr_a2n(unsigned char *lladdr, int len, char *arg)
cp++;
}
if (sscanf(arg, "%x", &temp) != 1) {
- error_msg("\"%s\" is invalid lladdr.", arg);
+ bb_error_msg("\"%s\" is invalid lladdr.", arg);
return -1;
}
if (temp < 0 || temp > 255) {
- error_msg("\"%s\" is invalid lladdr.", arg);
+ bb_error_msg("\"%s\" is invalid lladdr.", arg);
return -1;
}
lladdr[i] = temp;
diff --git a/networking/libiproute/utils.c b/networking/libiproute/utils.c
index 2c23cd294..fa1548609 100644
--- a/networking/libiproute/utils.c
+++ b/networking/libiproute/utils.c
@@ -209,10 +209,10 @@ int get_prefix_1(inet_prefix * dst, char *arg, int family)
int get_addr(inet_prefix * dst, char *arg, int family)
{
if (family == AF_PACKET) {
- error_msg_and_die("\"%s\" may be inet address, but it is not allowed in this context.", arg);
+ bb_error_msg_and_die("\"%s\" may be inet address, but it is not allowed in this context.", arg);
}
if (get_addr_1(dst, arg, family)) {
- error_msg_and_die("an inet address is expected rather than \"%s\".", arg);
+ bb_error_msg_and_die("an inet address is expected rather than \"%s\".", arg);
}
return 0;
}
@@ -220,10 +220,10 @@ int get_addr(inet_prefix * dst, char *arg, int family)
int get_prefix(inet_prefix * dst, char *arg, int family)
{
if (family == AF_PACKET) {
- error_msg_and_die("\"%s\" may be inet address, but it is not allowed in this context.", arg);
+ bb_error_msg_and_die("\"%s\" may be inet address, but it is not allowed in this context.", arg);
}
if (get_prefix_1(dst, arg, family)) {
- error_msg_and_die("an inet address is expected rather than \"%s\".", arg);
+ bb_error_msg_and_die("an inet address is expected rather than \"%s\".", arg);
}
return 0;
}
@@ -233,32 +233,32 @@ __u32 get_addr32(char *name)
inet_prefix addr;
if (get_addr_1(&addr, name, AF_INET)) {
- error_msg_and_die("an IP address is expected rather than \"%s\"", name);
+ bb_error_msg_and_die("an IP address is expected rather than \"%s\"", name);
}
return addr.data[0];
}
void incomplete_command()
{
- error_msg("Command line is not complete. Try option \"help\"");
+ bb_error_msg("Command line is not complete. Try option \"help\"");
exit(-1);
}
void invarg(char *msg, char *arg)
{
- error_msg("argument \"%s\" is wrong: %s", arg, msg);
+ bb_error_msg("argument \"%s\" is wrong: %s", arg, msg);
exit(-1);
}
void duparg(char *key, char *arg)
{
- error_msg("duplicate \"%s\": \"%s\" is the second value.", key, arg);
+ bb_error_msg("duplicate \"%s\": \"%s\" is the second value.", key, arg);
exit(-1);
}
void duparg2(char *key, char *arg)
{
- error_msg("either \"%s\" is duplicate, or \"%s\" is a garbage.", key, arg);
+ bb_error_msg("either \"%s\" is duplicate, or \"%s\" is a garbage.", key, arg);
exit(-1);
}