[BusyBox-cvs] busybox/networking/libiproute ip_parse_common_args.c,1.3,1.4 ipaddress.c,1.9,1.10 iplink.c,1.6,1.7 iproute.c,1.9,1.10 iptunnel.c,1.5,1.6 libnetlink.c,1.3,1.4 ll_addr.c,1.5,1.6 utils.c,1.5,1.6
Manuel Novoa III
mjn3 at busybox.net
Wed Mar 19 09:13:24 UTC 2003
Update of /var/cvs/busybox/networking/libiproute
In directory winder:/home/mjn3/work/busybox/networking/libiproute
Modified Files:
ip_parse_common_args.c ipaddress.c iplink.c iproute.c
iptunnel.c libnetlink.c ll_addr.c utils.c
Log Message:
Major coreutils update.
Index: ip_parse_common_args.c
===================================================================
RCS file: /var/cvs/busybox/networking/libiproute/ip_parse_common_args.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ip_parse_common_args.c 27 Jan 2003 17:41:18 -0000 1.3
+++ ip_parse_common_args.c 19 Mar 2003 09:12:42 -0000 1.4
@@ -48,7 +48,7 @@
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 @@
} else if (matches(opt, "-oneline") == 0) {
++oneline;
} else {
- show_usage();
+ bb_show_usage();
}
argc--; argv++;
}
Index: ipaddress.c
===================================================================
RCS file: /var/cvs/busybox/networking/libiproute/ipaddress.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- ipaddress.c 27 Jan 2003 17:41:18 -0000 1.9
+++ ipaddress.c 19 Mar 2003 09:12:42 -0000 1.10
@@ -125,7 +125,7 @@
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 @@
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 @@
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 @@
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 @@
}
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 @@
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 @@
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 @@
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);
}
Index: iplink.c
===================================================================
RCS file: /var/cvs/busybox/networking/libiproute/iplink.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- iplink.c 14 Jan 2003 08:54:08 -0000 1.6
+++ iplink.c 19 Mar 2003 09:12:42 -0000 1.7
@@ -42,7 +42,7 @@
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 @@
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 @@
}
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 @@
} 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);
}
Index: iproute.c
===================================================================
RCS file: /var/cvs/busybox/networking/libiproute/iproute.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- iproute.c 15 Feb 2003 11:50:32 -0000 1.9
+++ iproute.c 19 Mar 2003 09:12:42 -0000 1.10
@@ -85,7 +85,7 @@
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 @@
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 @@
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 @@
}
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 @@
}
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 @@
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 @@
}
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 @@
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 @@
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 @@
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 @@
}
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 @@
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);
Index: iptunnel.c
===================================================================
RCS file: /var/cvs/busybox/networking/libiproute/iptunnel.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- iptunnel.c 14 Jan 2003 08:54:08 -0000 1.5
+++ iptunnel.c 19 Mar 2003 09:12:42 -0000 1.6
@@ -47,7 +47,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
} 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);
}
Index: libnetlink.c
===================================================================
RCS file: /var/cvs/busybox/networking/libiproute/libnetlink.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- libnetlink.c 16 Dec 2002 07:37:21 -0000 1.3
+++ libnetlink.c 19 Mar 2003 09:12:42 -0000 1.4
@@ -34,7 +34,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
}
return 0;
}
- perror_msg("RTNETLINK answers");
+ bb_perror_msg("RTNETLINK answers");
}
return -1;
}
@@ -300,17 +300,17 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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;
}
Index: ll_addr.c
===================================================================
RCS file: /var/cvs/busybox/networking/libiproute/ll_addr.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ll_addr.c 14 Jan 2003 08:54:08 -0000 1.5
+++ ll_addr.c 19 Mar 2003 09:12:42 -0000 1.6
@@ -44,7 +44,7 @@
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 @@
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;
Index: utils.c
===================================================================
RCS file: /var/cvs/busybox/networking/libiproute/utils.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- utils.c 12 Feb 2003 10:56:53 -0000 1.5
+++ utils.c 19 Mar 2003 09:12:42 -0000 1.6
@@ -209,10 +209,10 @@
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_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 @@
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);
}
More information about the busybox-cvs
mailing list