mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2025-10-04 21:03:26 +00:00
Merge branch 'master' into net-next
This commit is contained in:
commit
4999c57733
24
configure
vendored
24
configure
vendored
@ -326,6 +326,27 @@ EOF
|
||||
rm -f $TMPDIR/dbtest.c $TMPDIR/dbtest
|
||||
}
|
||||
|
||||
check_strlcpy()
|
||||
{
|
||||
cat >$TMPDIR/strtest.c <<EOF
|
||||
#include <string.h>
|
||||
int main(int argc, char **argv) {
|
||||
char dst[10];
|
||||
strlcpy(dst, "test", sizeof(dst));
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
$CC -I$INCLUDE -o $TMPDIR/strtest $TMPDIR/strtest.c >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "no"
|
||||
else
|
||||
echo 'CFLAGS += -DNEED_STRLCPY' >>$CONFIG
|
||||
echo "yes"
|
||||
fi
|
||||
rm -f $TMPDIR/strtest.c $TMPDIR/strtest
|
||||
}
|
||||
|
||||
quiet_config()
|
||||
{
|
||||
cat <<EOF
|
||||
@ -397,6 +418,9 @@ check_mnl
|
||||
echo -n "Berkeley DB: "
|
||||
check_berkeley_db
|
||||
|
||||
echo -n "need for strlcpy: "
|
||||
check_strlcpy
|
||||
|
||||
echo
|
||||
echo -n "docs:"
|
||||
check_docs
|
||||
|
@ -195,6 +195,8 @@ static inline void __jiffies_to_tv(struct timeval *tv, unsigned long jiffies)
|
||||
tv->tv_usec = tvusec - 1000000 * tv->tv_sec;
|
||||
}
|
||||
|
||||
void print_escape_buf(const __u8 *buf, size_t len, const char *escape);
|
||||
|
||||
int print_timestamp(FILE *fp);
|
||||
void print_nlmsg_timestamp(FILE *fp, const struct nlmsghdr *n);
|
||||
|
||||
|
17
lib/utils.c
17
lib/utils.c
@ -31,6 +31,7 @@
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "rt_names.h"
|
||||
#include "utils.h"
|
||||
@ -1047,6 +1048,20 @@ int addr64_n2a(__u64 addr, char *buff, size_t len)
|
||||
return written;
|
||||
}
|
||||
|
||||
/* Print buffer and escape bytes that are !isprint or among 'escape' */
|
||||
void print_escape_buf(const __u8 *buf, size_t len, const char *escape)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < len; ++i) {
|
||||
if (isprint(buf[i]) && buf[i] != '\\' &&
|
||||
!strchr(escape, buf[i]))
|
||||
printf("%c", buf[i]);
|
||||
else
|
||||
printf("\\%03o", buf[i]);
|
||||
}
|
||||
}
|
||||
|
||||
int print_timestamp(FILE *fp)
|
||||
{
|
||||
struct timeval tv;
|
||||
@ -1260,6 +1275,7 @@ int get_real_family(int rtm_type, int rtm_family)
|
||||
return rtm_family;
|
||||
}
|
||||
|
||||
#ifdef NEED_STRLCPY
|
||||
size_t strlcpy(char *dst, const char *src, size_t size)
|
||||
{
|
||||
size_t srclen = strlen(src);
|
||||
@ -1282,3 +1298,4 @@ size_t strlcat(char *dst, const char *src, size_t size)
|
||||
|
||||
return dlen + strlcpy(dst + dlen, src, size - dlen);
|
||||
}
|
||||
#endif
|
||||
|
21
misc/ss.c
21
misc/ss.c
@ -2230,6 +2230,16 @@ static void print_skmeminfo(struct rtattr *tb[], int attrtype)
|
||||
printf(")");
|
||||
}
|
||||
|
||||
static void print_md5sig(struct tcp_diag_md5sig *sig)
|
||||
{
|
||||
printf("%s/%d=",
|
||||
format_host(sig->tcpm_family,
|
||||
sig->tcpm_family == AF_INET6 ? 16 : 4,
|
||||
&sig->tcpm_addr),
|
||||
sig->tcpm_prefixlen);
|
||||
print_escape_buf(sig->tcpm_key, sig->tcpm_keylen, " ,");
|
||||
}
|
||||
|
||||
#define TCPI_HAS_OPT(info, opt) !!(info->tcpi_options & (opt))
|
||||
|
||||
static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
|
||||
@ -2366,6 +2376,17 @@ static void tcp_show_info(const struct nlmsghdr *nlh, struct inet_diag_msg *r,
|
||||
free(s.dctcp);
|
||||
free(s.bbr_info);
|
||||
}
|
||||
if (tb[INET_DIAG_MD5SIG]) {
|
||||
struct tcp_diag_md5sig *sig = RTA_DATA(tb[INET_DIAG_MD5SIG]);
|
||||
int len = RTA_PAYLOAD(tb[INET_DIAG_MD5SIG]);
|
||||
|
||||
printf(" md5keys:");
|
||||
print_md5sig(sig++);
|
||||
for (len -= sizeof(*sig); len > 0; len -= sizeof(*sig)) {
|
||||
printf(",");
|
||||
print_md5sig(sig++);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const char *format_host_sa(struct sockaddr_storage *sa)
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
source lib/generic.sh
|
||||
. lib/generic.sh
|
||||
|
||||
ts_log "[Testing add/del virtual links]"
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
source lib/generic.sh
|
||||
. lib/generic.sh
|
||||
|
||||
NL_FILE="tests/ip/link/dev_wo_vf_rate.nl"
|
||||
ts_ip "$0" "Show VF devices w/o VF rate info" -d monitor file $NL_FILE
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
source lib/generic.sh
|
||||
. lib/generic.sh
|
||||
|
||||
ts_log "[Testing netns nsid]"
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
source lib/generic.sh
|
||||
. lib/generic.sh
|
||||
|
||||
ts_log "[Testing netns nsid in batch mode]"
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
source lib/generic.sh
|
||||
. lib/generic.sh
|
||||
|
||||
ts_log "[Testing add default route]"
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
source lib/generic.sh
|
||||
. lib/generic.sh
|
||||
|
||||
TUNNEL_NAME="tunnel_test_ip"
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
# vim: ft=sh
|
||||
|
||||
source lib/generic.sh
|
||||
. lib/generic.sh
|
||||
|
||||
QDISCS="cbq htb dsmark"
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
# vim: ft=sh
|
||||
|
||||
source lib/generic.sh
|
||||
. lib/generic.sh
|
||||
|
||||
ts_qdisc_available "dsmark"
|
||||
if [ $? -eq 0 ]; then
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
source lib/generic.sh
|
||||
. lib/generic.sh
|
||||
|
||||
DEV="$(rand_dev)"
|
||||
ts_ip "$0" "Add $DEV dummy interface" link add dev $DEV type dummy
|
||||
|
Loading…
Reference in New Issue
Block a user