Commit afd5dad9 authored by Stephen Hemminger's avatar Stephen Hemminger
parents f63bb3e4 6420b62e
DESTDIR=
SBINDIR=/usr/sbin
DESTDIR=/usr/
SBINDIR=/sbin
CONFDIR=/etc/iproute2
DOCDIR=/usr/share/doc/iproute2
MANDIR=/usr/share/man
DOCDIR=/share/doc/iproute2
MANDIR=/share/man
# Path to db_185.h include
DBM_INCLUDE:=/usr/include
DEFINES= -DRESOLVE_HOSTNAMES
DEFINES= -DRESOLVE_HOSTNAMES -DDESTDIR=\"$(DESTDIR)\"
#options if you have a bind>=4.9.4 libresolv (or, maybe, glibc)
LDLIBS=-lresolv
......
static const char SNAPSHOT[] = "080417";
static const char SNAPSHOT[] = "080725";
......@@ -15,6 +15,7 @@
#ifndef _IPTABLES_H
#define _IPTABLES_H
#include <linux/types.h>
#include <linux/netfilter_ipv4.h>
#include <linux/netfilter/x_tables.h>
......
......@@ -339,6 +339,7 @@ struct xfrm_usersa_info {
#define XFRM_STATE_NOPMTUDISC 4
#define XFRM_STATE_WILDRECV 8
#define XFRM_STATE_ICMP 16
#define XFRM_STATE_AF_UNSPEC 32
};
struct xfrm_usersa_id {
......
......@@ -139,6 +139,8 @@ static int ipaddrlabel_modify(int cmd, int argc, char **argv)
inet_prefix prefix;
uint32_t label = 0xffffffffUL;
char *p = NULL;
char *l = NULL;
memset(&req, 0, sizeof(req));
memset(&prefix, 0, sizeof(prefix));
......@@ -157,6 +159,7 @@ static int ipaddrlabel_modify(int cmd, int argc, char **argv)
while (argc > 0) {
if (strcmp(*argv, "prefix") == 0) {
NEXT_ARG();
p = *argv;
get_prefix(&prefix, *argv, preferred_family);
} else if (strcmp(*argv, "dev") == 0) {
NEXT_ARG();
......@@ -164,13 +167,21 @@ static int ipaddrlabel_modify(int cmd, int argc, char **argv)
invarg("dev is invalid\n", *argv);
} else if (strcmp(*argv, "label") == 0) {
NEXT_ARG();
l = *argv;
if (get_u32(&label, *argv, 0) || label == 0xffffffffUL)
invarg("label is invalid\n", *argv);
}
argc--;
argv++;
}
if (p == NULL) {
fprintf(stderr, "Not enough information: \"prefix\" argument is required.\n");
return -1;
}
if (l == NULL) {
fprintf(stderr, "Not enough information: \"label\" argument is required.\n");
return -1;
}
addattr32(&req.n, sizeof(req), IFAL_LABEL, label);
addattr_l(&req.n, sizeof(req), IFAL_ADDRESS, &prefix.data, prefix.bytelen);
req.ifal.ifal_prefixlen = prefix.bitlen;
......
......@@ -33,6 +33,9 @@
#include "ip_common.h"
#define IPLINK_IOCTL_COMPAT 1
#ifndef DESTDIR
#define DESTDIR "/usr/"
#endif
static void usage(void) __attribute__((noreturn));
......@@ -78,7 +81,7 @@ struct link_util *get_link_kind(const char *id)
if (strcmp(l->id, id) == 0)
return l;
snprintf(buf, sizeof(buf), "/usr/lib/ip/link_%s.so", id);
snprintf(buf, sizeof(buf), DESTDIR "/lib/ip/link_%s.so", id);
dlh = dlopen(buf, RTLD_LAZY);
if (dlh == NULL) {
/* look in current binary, only open once */
......
......@@ -20,9 +20,9 @@ stats: stats.c
$(HOSTCC) $(CCOPTS) -I../include -o $@ $@.c -lm
install: all
mkdir -p $(DESTDIR)/usr/lib/tc
mkdir -p $(DESTDIR)/lib/tc
for i in $(DISTDATA); \
do install -m 755 $$i $(DESTDIR)/usr/lib/tc; \
do install -m 755 $$i $(DESTDIR)/lib/tc; \
done
clean:
......
......@@ -72,10 +72,10 @@ libtc.a: $(TCLIB)
$(AR) rcs $@ $(TCLIB)
install: all
mkdir -p $(DESTDIR)/usr/lib/tc
mkdir -p $(DESTDIR)/lib/tc
install -m 0755 tc $(DESTDIR)$(SBINDIR)
for i in $(TCSO); \
do install -m 755 $$i $(DESTDIR)/usr/lib/tc; \
do install -m 755 $$i $(DESTDIR)/lib/tc; \
done
clean:
......
......@@ -24,13 +24,17 @@
#include "utils.h"
#include "tc_util.h"
#ifndef DESTDIR
#define DESTDIR "/usr/"
#endif
const char *get_tc_lib(void)
{
const char *lib_dir;
lib_dir = getenv("TC_LIB_DIR");
if (!lib_dir)
lib_dir = "/usr/lib/tc";
lib_dir = DESTDIR "/lib/tc";
return lib_dir;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment