summaryrefslogtreecommitdiff
path: root/networking/libiproute
diff options
context:
space:
mode:
Diffstat (limited to 'networking/libiproute')
-rw-r--r--networking/libiproute/ip_common.h3
-rw-r--r--networking/libiproute/ip_parse_common_args.c2
-rw-r--r--networking/libiproute/iplink.c2
-rw-r--r--networking/libiproute/iproute.c16
-rw-r--r--networking/libiproute/utils.h3
5 files changed, 11 insertions, 15 deletions
diff --git a/networking/libiproute/ip_common.h b/networking/libiproute/ip_common.h
index 1529178..05a6a95 100644
--- a/networking/libiproute/ip_common.h
+++ b/networking/libiproute/ip_common.h
@@ -14,7 +14,8 @@
#endif
extern int preferred_family;
-extern char * _SL_;
+//FIXME! Appears in two .h files!
+extern const char * _SL_;
extern void ip_parse_common_args(int *argcp, char ***argvp);
extern int print_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
diff --git a/networking/libiproute/ip_parse_common_args.c b/networking/libiproute/ip_parse_common_args.c
index 64386c9..00a8912 100644
--- a/networking/libiproute/ip_parse_common_args.c
+++ b/networking/libiproute/ip_parse_common_args.c
@@ -24,7 +24,7 @@
int preferred_family = AF_UNSPEC;
int oneline = 0;
-char * _SL_ = NULL;
+const char * _SL_ = NULL;
void ip_parse_common_args(int *argcp, char ***argvp)
{
diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c
index ae41ab3..cb6ee96 100644
--- a/networking/libiproute/iplink.c
+++ b/networking/libiproute/iplink.c
@@ -25,7 +25,7 @@
/* take from linux/sockios.h */
#define SIOCSIFNAME 0x8923 /* set interface name */
-static int on_off(char *msg)
+static int on_off(const char *msg)
{
bb_error_msg("error: argument of \"%s\" must be \"on\" or \"off\"", msg);
return -1;
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index c8a58c1..27d37ac 100644
--- a/networking/libiproute/iproute.c
+++ b/networking/libiproute/iproute.c
@@ -469,21 +469,15 @@ static int rtnl_rtcache_request(struct rtnl_handle *rth, int family)
static int iproute_flush_cache(void)
{
-#define ROUTE_FLUSH_PATH "/proc/sys/net/ipv4/route/flush"
-
- int len;
- int flush_fd = open (ROUTE_FLUSH_PATH, O_WRONLY);
- char *buffer = "-1";
-
+ static const char fn[] = "/proc/sys/net/ipv4/route/flush";
+ int flush_fd = open(fn, O_WRONLY);
if (flush_fd < 0) {
- fprintf(stderr, "Cannot open \"%s\"\n", ROUTE_FLUSH_PATH);
+ bb_perror_msg("cannot open '%s'", fn);
return -1;
}
- len = strlen (buffer);
-
- if ((write (flush_fd, (void *)buffer, len)) < len) {
- fprintf(stderr, "Cannot flush routing cache\n");
+ if (write(flush_fd, "-1", 2) < 2) {
+ bb_perror_msg("cannot flush routing cache");
return -1;
}
close(flush_fd);
diff --git a/networking/libiproute/utils.h b/networking/libiproute/utils.h
index ebf2af1..556541f 100644
--- a/networking/libiproute/utils.h
+++ b/networking/libiproute/utils.h
@@ -14,7 +14,8 @@ extern int show_details;
extern int show_raw;
extern int resolve_hosts;
extern int oneline;
-extern char * _SL_;
+//FIXME! Appears in two .h files!
+extern const char * _SL_;
#ifndef IPPROTO_ESP
#define IPPROTO_ESP 50