Hello community, here is the log from the commit of package iproute2 for openSUSE:Factory checked in at 2014-08-13 08:48:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/iproute2 (Old) and /work/SRC/openSUSE:Factory/.iproute2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "iproute2" Changes: -------- --- /work/SRC/openSUSE:Factory/iproute2/iproute2-doc.changes 2014-07-18 06:40:32.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.iproute2.new/iproute2-doc.changes 2014-08-13 08:48:18.000000000 +0200 @@ -1,0 +2,9 @@ +Sun Aug 10 16:02:36 UTC 2014 - [email protected] + +- Update to new upstream release 3.16 +* bridge: Add master device name to bridge fdb show +* ip: check for missing dev arg when doing VF rate +* Add support to configure SR-IOV VF minimum and maximum Tx rate + through ip tool + +------------------------------------------------------------------- iproute2.changes: same change Old: ---- iproute2-3.15.0.tar.sign iproute2-3.15.0.tar.xz New: ---- iproute2-3.16.0.tar.sign iproute2-3.16.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ iproute2-doc.spec ++++++ --- /var/tmp/diff_new_pack.9dK41h/_old 2014-08-13 08:48:19.000000000 +0200 +++ /var/tmp/diff_new_pack.9dK41h/_new 2014-08-13 08:48:19.000000000 +0200 @@ -17,9 +17,9 @@ Name: iproute2-doc -Version: 3.15 +Version: 3.16 Release: 0 -%define rversion 3.15.0 +%define rversion 3.16.0 Summary: Documentation to iproute2 License: GPL-2.0+ Group: Documentation/Other ++++++ iproute2.spec ++++++ --- /var/tmp/diff_new_pack.9dK41h/_old 2014-08-13 08:48:19.000000000 +0200 +++ /var/tmp/diff_new_pack.9dK41h/_new 2014-08-13 08:48:19.000000000 +0200 @@ -17,9 +17,9 @@ Name: iproute2 -Version: 3.15 +Version: 3.16 Release: 0 -%define rversion 3.15.0 +%define rversion 3.16.0 Summary: Linux network configuration utilities License: GPL-2.0 Group: Productivity/Networking/Routing ++++++ iproute2-3.15.0.tar.xz -> iproute2-3.16.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/bridge/fdb.c new/iproute2-3.16.0/bridge/fdb.c --- old/iproute2-3.15.0/bridge/fdb.c 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/bridge/fdb.c 2014-08-04 21:43:46.000000000 +0200 @@ -34,7 +34,7 @@ fprintf(stderr, "Usage: bridge fdb { add | append | del | replace } ADDR dev DEV {self|master} [ temp ]\n" " [router] [ dst IPADDR] [ vlan VID ]\n" " [ port PORT] [ vni VNI ] [via DEV]\n"); - fprintf(stderr, " bridge fdb {show} [ dev DEV ]\n"); + fprintf(stderr, " bridge fdb {show} [ br BRDEV ] [ brport DEV ]\n"); exit(-1); } @@ -147,7 +147,10 @@ } if (r->ndm_flags & NTF_SELF) fprintf(fp, "self "); - if (r->ndm_flags & NTF_MASTER) + if (tb[NDA_MASTER]) + fprintf(fp, "master %s ", + ll_index_to_name(rta_getattr_u32(tb[NDA_MASTER]))); + else if (r->ndm_flags & NTF_MASTER) fprintf(fp, "master "); if (r->ndm_flags & NTF_ROUTER) fprintf(fp, "router "); @@ -158,18 +161,45 @@ static int fdb_show(int argc, char **argv) { + struct { + struct nlmsghdr n; + struct ifinfomsg ifm; + char buf[256]; + } req; + char *filter_dev = NULL; + char *br = NULL; + int msg_size = sizeof(struct ifinfomsg); + + memset(&req, 0, sizeof(req)); + req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); + req.ifm.ifi_family = PF_BRIDGE; while (argc > 0) { - if (strcmp(*argv, "dev") == 0) { + if ((strcmp(*argv, "brport") == 0) || strcmp(*argv, "dev") == 0) { NEXT_ARG(); - if (filter_dev) - duparg("dev", *argv); filter_dev = *argv; + } else if (strcmp(*argv, "br") == 0) { + NEXT_ARG(); + br = *argv; + } else { + if (matches(*argv, "help") == 0) + usage(); } argc--; argv++; } + if (br) { + int br_ifindex = ll_name_to_index(br); + if (br_ifindex == 0) { + fprintf(stderr, "Cannot find bridge device \"%s\"\n", br); + return -1; + } + addattr32(&req.n, sizeof(req), IFLA_MASTER, br_ifindex); + msg_size += RTA_LENGTH(4); + } + + /*we'll keep around filter_dev for older kernels */ if (filter_dev) { filter_index = if_nametoindex(filter_dev); if (filter_index == 0) { @@ -177,9 +207,10 @@ filter_dev); return -1; } + req.ifm.ifi_index = filter_index; } - if (rtnl_wilddump_request(&rth, PF_BRIDGE, RTM_GETNEIGH) < 0) { + if (rtnl_dump_request(&rth, RTM_GETNEIGH, &req.ifm, msg_size) < 0) { perror("Cannot send dump request"); exit(1); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/include/SNAPSHOT.h new/iproute2-3.16.0/include/SNAPSHOT.h --- old/iproute2-3.15.0/include/SNAPSHOT.h 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/include/SNAPSHOT.h 2014-08-04 21:43:46.000000000 +0200 @@ -1 +1 @@ -static const char SNAPSHOT[] = "140610"; +static const char SNAPSHOT[] = "140804"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/include/linux/can/netlink.h new/iproute2-3.16.0/include/linux/can/netlink.h --- old/iproute2-3.15.0/include/linux/can/netlink.h 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/include/linux/can/netlink.h 2014-08-04 21:43:46.000000000 +0200 @@ -15,8 +15,8 @@ * GNU General Public License for more details. */ -#ifndef CAN_NETLINK_H -#define CAN_NETLINK_H +#ifndef _CAN_NETLINK_H +#define _CAN_NETLINK_H #include <linux/types.h> @@ -130,4 +130,4 @@ #define IFLA_CAN_MAX (__IFLA_CAN_MAX - 1) -#endif /* CAN_NETLINK_H */ +#endif /* !_UAPI_CAN_NETLINK_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/include/linux/can.h new/iproute2-3.16.0/include/linux/can.h --- old/iproute2-3.15.0/include/linux/can.h 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/include/linux/can.h 2014-08-04 21:43:46.000000000 +0200 @@ -42,8 +42,8 @@ * DAMAGE. */ -#ifndef CAN_H -#define CAN_H +#ifndef _CAN_H +#define _CAN_H #include <linux/types.h> #include <linux/socket.h> @@ -191,4 +191,4 @@ #define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */ -#endif /* CAN_H */ +#endif /* !_UAPI_CAN_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/include/linux/filter.h new/iproute2-3.16.0/include/linux/filter.h --- old/iproute2-3.15.0/include/linux/filter.h 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/include/linux/filter.h 2014-08-04 21:43:46.000000000 +0200 @@ -130,7 +130,8 @@ #define SKF_AD_VLAN_TAG 44 #define SKF_AD_VLAN_TAG_PRESENT 48 #define SKF_AD_PAY_OFFSET 52 -#define SKF_AD_MAX 56 +#define SKF_AD_RANDOM 56 +#define SKF_AD_MAX 60 #define SKF_NET_OFF (-0x100000) #define SKF_LL_OFF (-0x200000) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/include/linux/if_link.h new/iproute2-3.16.0/include/linux/if_link.h --- old/iproute2-3.15.0/include/linux/if_link.h 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/include/linux/if_link.h 2014-08-04 21:43:46.000000000 +0200 @@ -317,6 +317,9 @@ IFLA_VXLAN_PORT, /* destination port */ IFLA_VXLAN_GROUP6, IFLA_VXLAN_LOCAL6, + IFLA_VXLAN_UDP_CSUM, + IFLA_VXLAN_UDP_ZERO_CSUM6_TX, + IFLA_VXLAN_UDP_ZERO_CSUM6_RX, __IFLA_VXLAN_MAX }; #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) @@ -397,9 +400,10 @@ IFLA_VF_UNSPEC, IFLA_VF_MAC, /* Hardware queue specific attributes */ IFLA_VF_VLAN, - IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */ + IFLA_VF_TX_RATE, /* Max TX Bandwidth Allocation */ IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */ IFLA_VF_LINK_STATE, /* link state enable/disable/auto switch */ + IFLA_VF_RATE, /* Min and Max TX Bandwidth Allocation */ __IFLA_VF_MAX, }; @@ -421,6 +425,12 @@ __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */ }; +struct ifla_vf_rate { + __u32 vf; + __u32 min_tx_rate; /* Min Bandwidth in Mbps */ + __u32 max_tx_rate; /* Max Bandwidth in Mbps */ +}; + struct ifla_vf_spoofchk { __u32 vf; __u32 setting; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/include/linux/if_tunnel.h new/iproute2-3.16.0/include/linux/if_tunnel.h --- old/iproute2-3.15.0/include/linux/if_tunnel.h 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/include/linux/if_tunnel.h 2014-08-04 21:43:46.000000000 +0200 @@ -100,7 +100,7 @@ #define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1) /* VTI-mode i_flags */ -#define VTI_ISVTI 0x0001 +#define VTI_ISVTI ((__be16)0x0001) enum { IFLA_VTI_UNSPEC, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/include/linux/l2tp.h new/iproute2-3.16.0/include/linux/l2tp.h --- old/iproute2-3.15.0/include/linux/l2tp.h 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/include/linux/l2tp.h 2014-08-04 21:43:46.000000000 +0200 @@ -122,6 +122,8 @@ L2TP_ATTR_STATS, /* nested */ L2TP_ATTR_IP6_SADDR, /* struct in6_addr */ L2TP_ATTR_IP6_DADDR, /* struct in6_addr */ + L2TP_ATTR_UDP_ZERO_CSUM6_TX, /* u8 */ + L2TP_ATTR_UDP_ZERO_CSUM6_RX, /* u8 */ __L2TP_ATTR_MAX, }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/include/linux/neighbour.h new/iproute2-3.16.0/include/linux/neighbour.h --- old/iproute2-3.15.0/include/linux/neighbour.h 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/include/linux/neighbour.h 2014-08-04 21:43:46.000000000 +0200 @@ -24,6 +24,7 @@ NDA_PORT, NDA_VNI, NDA_IFINDEX, + NDA_MASTER, __NDA_MAX }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/include/ll_map.h new/iproute2-3.16.0/include/ll_map.h --- old/iproute2-3.15.0/include/ll_map.h 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/include/ll_map.h 2014-08-04 21:43:46.000000000 +0200 @@ -9,6 +9,6 @@ extern const char *ll_index_to_name(unsigned idx); extern const char *ll_idx_n2a(unsigned idx, char *buf); extern int ll_index_to_type(unsigned idx); -extern unsigned ll_index_to_flags(unsigned idx); +extern int ll_index_to_flags(unsigned idx); #endif /* __LL_MAP_H__ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/include/utils.h new/iproute2-3.16.0/include/utils.h --- old/iproute2-3.15.0/include/utils.h 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/include/utils.h 2014-08-04 21:43:46.000000000 +0200 @@ -98,7 +98,7 @@ extern const char *format_host(int af, int len, const void *addr, char *buf, int buflen); -extern const char *rt_addr_n2a(int af, int len, const void *addr, +extern const char *rt_addr_n2a(int af, const void *addr, char *buf, int buflen); void missarg(const char *) __attribute__((noreturn)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/ip/ip.c new/iproute2-3.16.0/ip/ip.c --- old/iproute2-3.15.0/ip/ip.c 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/ip/ip.c 2014-08-04 21:43:46.000000000 +0200 @@ -45,7 +45,7 @@ " ip [ -force ] -batch filename\n" "where OBJECT := { link | addr | addrlabel | route | rule | neigh | ntable |\n" " tunnel | tuntap | maddr | mroute | mrule | monitor | xfrm |\n" -" netns | l2tp | tcp_metrics | token }\n" +" netns | l2tp | tcp_metrics | token | netconf }\n" " OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n" " -f[amily] { inet | inet6 | ipx | dnet | bridge | link } |\n" " -4 | -6 | -I | -D | -B | -0 |\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/ip/ip_common.h new/iproute2-3.16.0/ip/ip_common.h --- old/iproute2-3.15.0/ip/ip_common.h 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/ip/ip_common.h 2014-08-04 21:43:46.000000000 +0200 @@ -17,6 +17,7 @@ extern void iplink_usage(void) __attribute__((noreturn)); extern void iproute_reset_filter(void); extern void ipmroute_reset_filter(void); +void ipaddr_get_vf_rate(int, int *, int *, int); extern void ipaddr_reset_filter(int); extern void ipneigh_reset_filter(void); extern void ipntable_reset_filter(void); @@ -50,6 +51,7 @@ extern int do_tcp_metrics(int argc, char **argv); extern int do_ipnetconf(int argc, char **argv); extern int do_iptoken(int argc, char **argv); +extern int iplink_get(unsigned int flags, char *name, __u32 filt_mask); static inline int rtm_get_table(struct rtmsg *r, struct rtattr **tb) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/ip/ipaddress.c new/iproute2-3.16.0/ip/ipaddress.c --- old/iproute2-3.15.0/ip/ipaddress.c 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/ip/ipaddress.c 2014-08-04 21:43:46.000000000 +0200 @@ -245,6 +245,7 @@ { struct ifla_vf_mac *vf_mac; struct ifla_vf_vlan *vf_vlan; + struct ifla_vf_rate *vf_rate; struct ifla_vf_tx_rate *vf_tx_rate; struct ifla_vf_spoofchk *vf_spoofchk; struct ifla_vf_link_state *vf_linkstate; @@ -262,6 +263,7 @@ vf_mac = RTA_DATA(vf[IFLA_VF_MAC]); vf_vlan = RTA_DATA(vf[IFLA_VF_VLAN]); vf_tx_rate = RTA_DATA(vf[IFLA_VF_TX_RATE]); + vf_rate = RTA_DATA(vf[IFLA_VF_RATE]); /* Check if the spoof checking vf info type is supported by * this kernel. @@ -297,6 +299,10 @@ fprintf(fp, ", qos %d", vf_vlan->qos); if (vf_tx_rate->rate) fprintf(fp, ", tx rate %d (Mbps)", vf_tx_rate->rate); + if (vf_rate->max_tx_rate) + fprintf(fp, ", max_tx_rate %dMbps", vf_rate->max_tx_rate); + if (vf_rate->min_tx_rate) + fprintf(fp, ", min_tx_rate %dMbps", vf_rate->min_tx_rate); if (vf_spoofchk && vf_spoofchk->setting != -1) { if (vf_spoofchk->setting) fprintf(fp, ", spoof checking on"); @@ -1235,6 +1241,19 @@ exit(0); } + /* + * If only filter_dev present and none of the other + * link filters are present, use RTM_GETLINK to get + * the link device + */ + if (filter_dev && filter.group == -1 && do_link == 1) { + if (iplink_get(0, filter_dev, RTEXT_FILTER_VF) < 0) { + perror("Cannot send link get request"); + exit(1); + } + exit(0); + } + if (rtnl_wilddump_request(&rth, preferred_family, RTM_GETLINK) < 0) { perror("Cannot send dump request"); exit(1); @@ -1278,6 +1297,63 @@ return 0; } +static void +ipaddr_loop_each_vf(struct rtattr *tb[], int vfnum, int *min, int *max) +{ + struct rtattr *vflist = tb[IFLA_VFINFO_LIST]; + struct rtattr *i, *vf[IFLA_VF_MAX+1]; + struct ifla_vf_rate *vf_rate; + int rem; + + rem = RTA_PAYLOAD(vflist); + + for (i = RTA_DATA(vflist); RTA_OK(i, rem); i = RTA_NEXT(i, rem)) { + parse_rtattr_nested(vf, IFLA_VF_MAX, i); + vf_rate = RTA_DATA(vf[IFLA_VF_RATE]); + if (vf_rate->vf == vfnum) { + *min = vf_rate->min_tx_rate; + *max = vf_rate->max_tx_rate; + return; + } + } + fprintf(stderr, "Cannot find VF %d\n", vfnum); + exit(1); +} + +void ipaddr_get_vf_rate(int vfnum, int *min, int *max, int idx) +{ + struct nlmsg_chain linfo = { NULL, NULL}; + struct rtattr *tb[IFLA_MAX+1]; + struct ifinfomsg *ifi; + struct nlmsg_list *l; + struct nlmsghdr *n; + int len; + + if (rtnl_wilddump_request(&rth, AF_UNSPEC, RTM_GETLINK) < 0) { + perror("Cannot send dump request"); + exit(1); + } + if (rtnl_dump_filter(&rth, store_nlmsg, &linfo) < 0) { + fprintf(stderr, "Dump terminated\n"); + exit(1); + } + for (l = linfo.head; l; l = l->next) { + n = &l->h; + ifi = NLMSG_DATA(n); + + len = n->nlmsg_len - NLMSG_LENGTH(sizeof(*ifi)); + if (len < 0 || (idx && idx != ifi->ifi_index)) + continue; + + parse_rtattr(tb, IFLA_MAX, IFLA_RTA(ifi), len); + + if ((tb[IFLA_VFINFO_LIST] && tb[IFLA_NUM_VF])) { + ipaddr_loop_each_vf(tb, vfnum, min, max); + return; + } + } +} + int ipaddr_list_link(int argc, char **argv) { preferred_family = AF_PACKET; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/ip/iplink.c new/iproute2-3.16.0/ip/iplink.c --- old/iproute2-3.15.0/ip/iplink.c 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/ip/iplink.c 2014-08-04 21:43:46.000000000 +0200 @@ -87,7 +87,7 @@ fprintf(stderr, "\n"); fprintf(stderr, "TYPE := { vlan | veth | vcan | dummy | ifb | macvlan | macvtap |\n"); fprintf(stderr, " bridge | bond | ipoib | ip6tnl | ipip | sit | vxlan |\n"); - fprintf(stderr, " gre | gretap | ip6gre | ip6gretap | vti }\n"); + fprintf(stderr, " gre | gretap | ip6gre | ip6gretap | vti | nlmon }\n"); } exit(-1); } @@ -215,16 +215,40 @@ }; static int iplink_parse_vf(int vf, int *argcp, char ***argvp, - struct iplink_req *req) + struct iplink_req *req, int dev_index) { + char new_rate_api = 0, count = 0, override_legacy_rate = 0; + struct ifla_vf_rate tivt; int len, argc = *argcp; char **argv = *argvp; struct rtattr *vfinfo; + tivt.min_tx_rate = -1; + tivt.max_tx_rate = -1; + vfinfo = addattr_nest(&req->n, sizeof(*req), IFLA_VF_INFO); while (NEXT_ARG_OK()) { NEXT_ARG(); + count++; + if (!matches(*argv, "max_tx_rate")) { + /* new API in use */ + new_rate_api = 1; + /* override legacy rate */ + override_legacy_rate = 1; + } else if (!matches(*argv, "min_tx_rate")) { + /* new API in use */ + new_rate_api = 1; + } + } + + while (count--) { + /* rewind arg */ + PREV_ARG(); + } + + while (NEXT_ARG_OK()) { + NEXT_ARG(); if (matches(*argv, "mac") == 0) { struct ifla_vf_mac ivm; NEXT_ARG(); @@ -261,7 +285,25 @@ invarg("Invalid \"rate\" value\n", *argv); } ivt.vf = vf; - addattr_l(&req->n, sizeof(*req), IFLA_VF_TX_RATE, &ivt, sizeof(ivt)); + if (!new_rate_api) + addattr_l(&req->n, sizeof(*req), + IFLA_VF_TX_RATE, &ivt, sizeof(ivt)); + else if (!override_legacy_rate) + tivt.max_tx_rate = ivt.rate; + + } else if (matches(*argv, "max_tx_rate") == 0) { + NEXT_ARG(); + if (get_unsigned(&tivt.max_tx_rate, *argv, 0)) + invarg("Invalid \"max tx rate\" value\n", + *argv); + tivt.vf = vf; + + } else if (matches(*argv, "min_tx_rate") == 0) { + NEXT_ARG(); + if (get_unsigned(&tivt.min_tx_rate, *argv, 0)) + invarg("Invalid \"min tx rate\" value\n", + *argv); + tivt.vf = vf; } else if (matches(*argv, "spoofchk") == 0) { struct ifla_vf_spoofchk ivs; @@ -295,6 +337,20 @@ } } + if (new_rate_api) { + int tmin, tmax; + + if (tivt.min_tx_rate == -1 || tivt.max_tx_rate == -1) { + ipaddr_get_vf_rate(tivt.vf, &tmin, &tmax, dev_index); + if (tivt.min_tx_rate == -1) + tivt.min_tx_rate = tmin; + if (tivt.max_tx_rate == -1) + tivt.max_tx_rate = tmax; + } + addattr_l(&req->n, sizeof(*req), IFLA_VF_RATE, &tivt, + sizeof(tivt)); + } + if (argc == *argcp) incomplete_command(); @@ -316,6 +372,7 @@ int vf = -1; int numtxqueues = -1; int numrxqueues = -1; + int dev_index = 0; *group = -1; ret = argc; @@ -428,7 +485,10 @@ } vflist = addattr_nest(&req->n, sizeof(*req), IFLA_VFINFO_LIST); - len = iplink_parse_vf(vf, &argc, &argv, req); + if (dev_index == 0) + missarg("dev"); + + len = iplink_parse_vf(vf, &argc, &argv, req, dev_index); if (len < 0) return -1; addattr_nest_end(&req->n, vflist); @@ -510,6 +570,9 @@ if (*dev) duparg2("dev", *argv); *dev = *argv; + dev_index = ll_name_to_index(*dev); + if (dev_index == 0) + invarg("Unknown device", *argv); } argc--; argv++; } @@ -645,6 +708,38 @@ return 0; } + +int iplink_get(unsigned int flags, char *name, __u32 filt_mask) +{ + int len; + struct iplink_req req; + char answer[16384]; + + memset(&req, 0, sizeof(req)); + + req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)); + req.n.nlmsg_flags = NLM_F_REQUEST|flags; + req.n.nlmsg_type = RTM_GETLINK; + req.i.ifi_family = preferred_family; + + if (name) { + len = strlen(name) + 1; + if (len == 1) + invarg("\"\" is not a valid device identifier\n", + "name"); + if (len > IFNAMSIZ) + invarg("\"name\" too long\n", name); + addattr_l(&req.n, sizeof(req), IFLA_IFNAME, name, len); + } + addattr32(&req.n, sizeof(req), IFLA_EXT_MASK, filt_mask); + + if (rtnl_talk(&rth, &req.n, 0, 0, (struct nlmsghdr *)answer) < 0) + return -2; + + print_linkinfo(NULL, (struct nlmsghdr *)answer, stdout); + + return 0; +} #if IPLINK_IOCTL_COMPAT static int get_ctl_fd(void) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/ip/iplink_bond.c new/iproute2-3.16.0/ip/iplink_bond.c --- old/iproute2-3.15.0/ip/iplink_bond.c 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/ip/iplink_bond.c 2014-08-04 21:43:46.000000000 +0200 @@ -407,7 +407,6 @@ if (iptb[i]) fprintf(f, "%s", rt_addr_n2a(AF_INET, - RTA_PAYLOAD(iptb[i]), RTA_DATA(iptb[i]), buf, INET_ADDRSTRLEN)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/ip/ipmroute.c new/iproute2-3.16.0/ip/ipmroute.c --- old/iproute2-3.15.0/ip/ipmroute.c 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/ip/ipmroute.c 2014-08-04 21:43:46.000000000 +0200 @@ -116,14 +116,13 @@ if (tb[RTA_SRC]) len = snprintf(obuf, sizeof(obuf), "(%s, ", rt_addr_n2a(family, - RTA_PAYLOAD(tb[RTA_SRC]), RTA_DATA(tb[RTA_SRC]), abuf, sizeof(abuf))); else len = sprintf(obuf, "(unknown, "); if (tb[RTA_DST]) snprintf(obuf + len, sizeof(obuf) - len, - "%s)", rt_addr_n2a(family, RTA_PAYLOAD(tb[RTA_DST]), + "%s)", rt_addr_n2a(family, RTA_DATA(tb[RTA_DST]), abuf, sizeof(abuf))); else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/ip/ipnetns.c new/iproute2-3.16.0/ip/ipnetns.c --- old/iproute2-3.15.0/ip/ipnetns.c 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/ip/ipnetns.c 2014-08-04 21:43:46.000000000 +0200 @@ -158,7 +158,7 @@ } if (setns(netns, CLONE_NEWNET) < 0) { - fprintf(stderr, "seting the network namespace \"%s\" failed: %s\n", + fprintf(stderr, "setting the network namespace \"%s\" failed: %s\n", name, strerror(errno)); return -1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/ip/ipprefix.c new/iproute2-3.16.0/ip/ipprefix.c --- old/iproute2-3.15.0/ip/ipprefix.c 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/ip/ipprefix.c 2014-08-04 21:43:46.000000000 +0200 @@ -80,7 +80,7 @@ pfx = (struct in6_addr *)RTA_DATA(tb[PREFIX_ADDRESS]); memset(abuf, '\0', sizeof(abuf)); - fprintf(fp, "%s", rt_addr_n2a(family, sizeof(*pfx), pfx, + fprintf(fp, "%s", rt_addr_n2a(family, pfx, abuf, sizeof(abuf))); } fprintf(fp, "/%u ", prefix->prefix_len); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/ip/iproute.c new/iproute2-3.16.0/ip/iproute.c --- old/iproute2-3.15.0/ip/iproute.c 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/ip/iproute.c 2014-08-04 21:43:46.000000000 +0200 @@ -338,7 +338,6 @@ if (tb[RTA_DST]) { if (r->rtm_dst_len != host_len) { fprintf(fp, "%s/%u ", rt_addr_n2a(r->rtm_family, - RTA_PAYLOAD(tb[RTA_DST]), RTA_DATA(tb[RTA_DST]), abuf, sizeof(abuf)), r->rtm_dst_len @@ -358,7 +357,6 @@ if (tb[RTA_SRC]) { if (r->rtm_src_len != host_len) { fprintf(fp, "from %s/%u ", rt_addr_n2a(r->rtm_family, - RTA_PAYLOAD(tb[RTA_SRC]), RTA_DATA(tb[RTA_SRC]), abuf, sizeof(abuf)), r->rtm_src_len @@ -402,7 +400,6 @@ */ fprintf(fp, " src %s ", rt_addr_n2a(r->rtm_family, - RTA_PAYLOAD(tb[RTA_PREFSRC]), RTA_DATA(tb[RTA_PREFSRC]), abuf, sizeof(abuf))); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/ip/iprule.c new/iproute2-3.16.0/ip/iprule.c --- old/iproute2-3.15.0/ip/iprule.c 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/ip/iprule.c 2014-08-04 21:43:46.000000000 +0200 @@ -89,7 +89,6 @@ if (tb[FRA_SRC]) { if (r->rtm_src_len != host_len) { fprintf(fp, "from %s/%u ", rt_addr_n2a(r->rtm_family, - RTA_PAYLOAD(tb[FRA_SRC]), RTA_DATA(tb[FRA_SRC]), abuf, sizeof(abuf)), r->rtm_src_len @@ -110,7 +109,6 @@ if (tb[FRA_DST]) { if (r->rtm_dst_len != host_len) { fprintf(fp, "to %s/%u ", rt_addr_n2a(r->rtm_family, - RTA_PAYLOAD(tb[FRA_DST]), RTA_DATA(tb[FRA_DST]), abuf, sizeof(abuf)), r->rtm_dst_len diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/ip/iptunnel.c new/iproute2-3.16.0/ip/iptunnel.c --- old/iproute2-3.15.0/ip/iptunnel.c 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/ip/iptunnel.c 2014-08-04 21:43:46.000000000 +0200 @@ -290,10 +290,10 @@ switch (p.iph.protocol) { case IPPROTO_IPIP: - if (p.i_flags != VTI_ISVTI) - return tnl_add_ioctl(cmd, "tunl0", p.name, &p); - else + if (p.i_flags & VTI_ISVTI) return tnl_add_ioctl(cmd, "ip_vti0", p.name, &p); + else + return tnl_add_ioctl(cmd, "tunl0", p.name, &p); case IPPROTO_GRE: return tnl_add_ioctl(cmd, "gre0", p.name, &p); case IPPROTO_IPV6: @@ -314,10 +314,10 @@ switch (p.iph.protocol) { case IPPROTO_IPIP: - if (p.i_flags != VTI_ISVTI) - return tnl_del_ioctl("tunl0", p.name, &p); - else + if (p.i_flags & VTI_ISVTI) return tnl_del_ioctl("ip_vti0", p.name, &p); + else + return tnl_del_ioctl("tunl0", p.name, &p); case IPPROTO_GRE: return tnl_del_ioctl("gre0", p.name, &p); case IPPROTO_IPV6: @@ -343,7 +343,7 @@ p->name, tnl_strproto(p->iph.protocol), p->iph.daddr ? format_host(AF_INET, 4, &p->iph.daddr, s1, sizeof(s1)) : "any", - p->iph.saddr ? rt_addr_n2a(AF_INET, 4, &p->iph.saddr, s2, sizeof(s2)) : "any"); + p->iph.saddr ? rt_addr_n2a(AF_INET, &p->iph.saddr, s2, sizeof(s2)) : "any"); if (p->iph.protocol == IPPROTO_IPV6 && (p->i_flags & SIT_ISATAP)) { struct ip_tunnel_prl prl[16]; @@ -506,10 +506,10 @@ switch (p.iph.protocol) { case IPPROTO_IPIP: - if (p.i_flags != VTI_ISVTI) - err = tnl_get_ioctl(p.name[0] ? p.name : "tunl0", &p); - else + if (p.i_flags & VTI_ISVTI) err = tnl_get_ioctl(p.name[0] ? p.name : "ip_vti0", &p); + else + err = tnl_get_ioctl(p.name[0] ? p.name : "tunl0", &p); break; case IPPROTO_GRE: err = tnl_get_ioctl(p.name[0] ? p.name : "gre0", &p); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/ip/ipxfrm.c new/iproute2-3.16.0/ip/ipxfrm.c --- old/iproute2-3.15.0/ip/ipxfrm.c 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/ip/ipxfrm.c 2014-08-04 21:43:46.000000000 +0200 @@ -288,10 +288,10 @@ fputs(title, fp); memset(abuf, '\0', sizeof(abuf)); - fprintf(fp, "src %s ", rt_addr_n2a(family, sizeof(*saddr), + fprintf(fp, "src %s ", rt_addr_n2a(family, saddr, abuf, sizeof(abuf))); memset(abuf, '\0', sizeof(abuf)); - fprintf(fp, "dst %s", rt_addr_n2a(family, sizeof(id->daddr), + fprintf(fp, "dst %s", rt_addr_n2a(family, &id->daddr, abuf, sizeof(abuf))); fprintf(fp, "%s", _SL_); @@ -455,13 +455,11 @@ fputs(prefix, fp); memset(abuf, '\0', sizeof(abuf)); - fprintf(fp, "src %s/%u ", rt_addr_n2a(f, sizeof(sel->saddr), - &sel->saddr, abuf, sizeof(abuf)), + fprintf(fp, "src %s/%u ", rt_addr_n2a(f, &sel->saddr, abuf, sizeof(abuf)), sel->prefixlen_s); memset(abuf, '\0', sizeof(abuf)); - fprintf(fp, "dst %s/%u ", rt_addr_n2a(f, sizeof(sel->daddr), - &sel->daddr, abuf, sizeof(abuf)), + fprintf(fp, "dst %s/%u ", rt_addr_n2a(f, &sel->daddr, abuf, sizeof(abuf)), sel->prefixlen_d); if (sel->proto) @@ -588,7 +586,7 @@ } static void xfrm_tmpl_print(struct xfrm_user_tmpl *tmpls, int len, - __u16 family, FILE *fp, const char *prefix) + FILE *fp, const char *prefix) { int ntmpls = len / sizeof(struct xfrm_user_tmpl); int i; @@ -756,15 +754,14 @@ memset(abuf, '\0', sizeof(abuf)); fprintf(fp, "addr %s", - rt_addr_n2a(family, sizeof(e->encap_oa), - &e->encap_oa, abuf, sizeof(abuf))); + rt_addr_n2a(family, &e->encap_oa, abuf, sizeof(abuf))); fprintf(fp, "%s", _SL_); } if (tb[XFRMA_TMPL]) { struct rtattr *rta = tb[XFRMA_TMPL]; xfrm_tmpl_print((struct xfrm_user_tmpl *) RTA_DATA(rta), - RTA_PAYLOAD(rta), family, fp, prefix); + RTA_PAYLOAD(rta), fp, prefix); } if (tb[XFRMA_COADDR]) { @@ -785,7 +782,7 @@ memset(abuf, '\0', sizeof(abuf)); fprintf(fp, "%s", - rt_addr_n2a(family, sizeof(*coa), coa, + rt_addr_n2a(family, coa, abuf, sizeof(abuf))); fprintf(fp, "%s", _SL_); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/ip/link_ip6tnl.c new/iproute2-3.16.0/ip/link_ip6tnl.c --- old/iproute2-3.15.0/ip/link_ip6tnl.c 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/ip/link_ip6tnl.c 2014-08-04 21:43:46.000000000 +0200 @@ -280,7 +280,6 @@ if (tb[IFLA_IPTUN_REMOTE]) { fprintf(f, "remote %s ", rt_addr_n2a(AF_INET6, - RTA_PAYLOAD(tb[IFLA_IPTUN_REMOTE]), RTA_DATA(tb[IFLA_IPTUN_REMOTE]), s1, sizeof(s1))); } @@ -288,7 +287,6 @@ if (tb[IFLA_IPTUN_LOCAL]) { fprintf(f, "local %s ", rt_addr_n2a(AF_INET6, - RTA_PAYLOAD(tb[IFLA_IPTUN_LOCAL]), RTA_DATA(tb[IFLA_IPTUN_LOCAL]), s1, sizeof(s1))); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/ip/xfrm_monitor.c new/iproute2-3.16.0/ip/xfrm_monitor.c --- old/iproute2-3.15.0/ip/xfrm_monitor.c 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/ip/xfrm_monitor.c 2014-08-04 21:43:46.000000000 +0200 @@ -225,8 +225,8 @@ char buf[256]; buf[0] = 0; - fprintf(fp, "dst %s ", rt_addr_n2a(sa_id->family, - sizeof(sa_id->daddr), &sa_id->daddr, buf, sizeof(buf))); + fprintf(fp, "dst %s ", + rt_addr_n2a(sa_id->family, &sa_id->daddr, buf, sizeof(buf))); fprintf(fp, " reqid 0x%x", reqid); @@ -245,9 +245,8 @@ xfrm_ae_flags_print(id->flags, arg); fprintf(fp,"\n\t"); memset(abuf, '\0', sizeof(abuf)); - fprintf(fp, "src %s ", rt_addr_n2a(id->sa_id.family, - sizeof(id->saddr), &id->saddr, - abuf, sizeof(abuf))); + fprintf(fp, "src %s ", rt_addr_n2a(id->sa_id.family, &id->saddr, + abuf, sizeof(abuf))); xfrm_usersa_print(&id->sa_id, id->reqid, fp); @@ -257,12 +256,12 @@ return 0; } -static void xfrm_print_addr(FILE *fp, int family, xfrm_address_t *a, size_t s) +static void xfrm_print_addr(FILE *fp, int family, xfrm_address_t *a) { char buf[256]; buf[0] = 0; - fprintf(fp, "%s", rt_addr_n2a(family, s, a, buf, sizeof(buf))); + fprintf(fp, "%s", rt_addr_n2a(family, a, buf, sizeof(buf))); } static int xfrm_mapping_print(const struct sockaddr_nl *who, @@ -272,12 +271,10 @@ struct xfrm_user_mapping *map = NLMSG_DATA(n); fprintf(fp, "Mapping change "); - xfrm_print_addr(fp, map->id.family, &map->old_saddr, - sizeof(map->old_saddr)); + xfrm_print_addr(fp, map->id.family, &map->old_saddr); fprintf(fp, ":%d -> ", ntohs(map->old_sport)); - xfrm_print_addr(fp, map->id.family, &map->new_saddr, - sizeof(map->new_saddr)); + xfrm_print_addr(fp, map->id.family, &map->new_saddr); fprintf(fp, ":%d\n\t", ntohs(map->new_sport)); xfrm_usersa_print(&map->id, map->reqid, fp); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/lib/ll_map.c new/iproute2-3.16.0/lib/ll_map.c --- old/iproute2-3.15.0/lib/ll_map.c 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/lib/ll_map.c 2014-08-04 21:43:46.000000000 +0200 @@ -28,7 +28,7 @@ struct hlist_node idx_hash; struct hlist_node name_hash; unsigned flags; - int index; + unsigned index; unsigned short type; char name[IFNAMSIZ]; }; @@ -173,7 +173,7 @@ return im ? im->type : -1; } -unsigned ll_index_to_flags(unsigned idx) +int ll_index_to_flags(unsigned idx) { const struct ll_cache *im; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/lib/utils.c new/iproute2-3.16.0/lib/utils.c --- old/iproute2-3.15.0/lib/utils.c 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/lib/utils.c 2014-08-04 21:43:46.000000000 +0200 @@ -454,19 +454,19 @@ err = get_addr_1(dst, arg, family); if (err == 0) { switch(dst->family) { - case AF_INET6: - dst->bitlen = 128; - break; - case AF_DECnet: - dst->bitlen = 16; - break; - default: - case AF_INET: - dst->bitlen = 32; + case AF_INET6: + dst->bitlen = 128; + break; + case AF_DECnet: + dst->bitlen = 16; + break; + default: + case AF_INET: + dst->bitlen = 32; } if (slash) { if (get_netmask(&plen, slash+1, 0) - || plen > dst->bitlen) { + || plen > dst->bitlen) { err = -1; goto done; } @@ -621,7 +621,7 @@ return sysconf(_SC_CLK_TCK); } -const char *rt_addr_n2a(int af, int len, const void *addr, char *buf, int buflen) +const char *rt_addr_n2a(int af, const void *addr, char *buf, int buflen) { switch (af) { case AF_INET: @@ -728,7 +728,7 @@ return n; } #endif - return rt_addr_n2a(af, len, addr, buf, buflen); + return rt_addr_n2a(af, addr, buf, buflen); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/man/man8/ip-link.8.in new/iproute2-3.16.0/man/man8/ip-link.8.in --- old/iproute2-3.15.0/man/man8/ip-link.8.in 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/man/man8/ip-link.8.in 2014-08-04 21:43:46.000000000 +0200 @@ -60,6 +60,7 @@ .BR ifb " | " .BR ipoib " |" .BR macvlan " | " +.BR macvtap " | " .BR vcan " | " .BR veth " | " .BR vlan " | " @@ -124,6 +125,10 @@ .IR VLAN-QOS " ] ] [" .B rate .IR TXRATE " ] [" +.B max_tx_rate +.IR TXRATE " ] [" +.B min_tx_rate +.IR TXRATE " ] [" .B spoofchk { on | off } ] [ .B state { auto | enable | disable} ] | @@ -175,6 +180,9 @@ .B macvlan - Virtual interface base on link layer address (MAC) .sp +.B macvtap +- Virtual interface based on link layer address (MAC) and TAP. +.sp .B vcan - Virtual Controller Area Network interface .sp @@ -566,8 +574,24 @@ .sp .BI rate " TXRATE" -- change the allowed transmit bandwidth, in Mbps, for the specified VF. -Setting this parameter to 0 disables rate limiting. The +-- change the allowed transmit bandwidth, in Mbps, for the specified VF. +Setting this parameter to 0 disables rate limiting. +.B vf +parameter must be specified. +Please use new API +.B "max_tx_rate" +option instead. + +.sp +.BI max_tx_rate " TXRATE" +- change the allowed maximum transmit bandwidth, in Mbps, for the specified VF. +.B vf +parameter must be specified. + +.sp +.BI min_tx_rate " TXRATE" +- change the allowed minimum transmit bandwidth, in Mbps, for the specified VF. +Minimum TXRATE should be always <= Maximum TXRATE. .B vf parameter must be specified. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/man/man8/ip-token.8 new/iproute2-3.16.0/man/man8/ip-token.8 --- old/iproute2-3.15.0/man/man8/ip-token.8 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/man/man8/ip-token.8 2014-08-04 21:43:46.000000000 +0200 @@ -1,6 +1,6 @@ .TH IP\-TOKEN 8 "28 Mar 2013" "iproute2" "Linux" .SH "NAME" -ip-token \- tokenized interface identifer support +ip-token \- tokenized interface identifier support .SH "SYNOPSIS" .sp .ad l @@ -26,7 +26,7 @@ .BR "ip token" " { " list " }" .SH "DESCRIPTION" -IPv6 tokenized interface identifer support is used for assigning well-known +IPv6 tokenized interface identifier support is used for assigning well-known host-part addresses to nodes whilst still obtaining a global network prefix from Router advertisements. The primary target for tokenized identifiers are server platforms where addresses are usually manually configured, rather than @@ -41,13 +41,13 @@ removed from the interface, only overwritten. .TP .I TOKEN -the interface identifer token address. +the interface identifier token address. .TP .BI dev " DEV" the networking interface. .SS ip token get - get the interface token from the kernel -show a tokenized interface identifer of a particular networking device. +show a tokenized interface identifier of a particular networking device. .B Arguments: coincide with the arguments of .B ip token set @@ -55,7 +55,7 @@ .I TOKEN must be left out. .SS ip token list - list all interface tokens -list all tokenized interface identifers for the networking interfaces from +list all tokenized interface identifiers for the networking interfaces from the kernel. .SH SEE ALSO diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iproute2-3.15.0/tc/q_netem.c new/iproute2-3.16.0/tc/q_netem.c --- old/iproute2-3.15.0/tc/q_netem.c 2014-06-10 18:39:14.000000000 +0200 +++ new/iproute2-3.16.0/tc/q_netem.c 2014-08-04 21:43:46.000000000 +0200 @@ -307,7 +307,7 @@ /* set defaults */ set_percent(&gemodel.r, 1.); set_percent(&gemodel.h, 0); - set_percent(&gemodel.k1, 1.); + set_percent(&gemodel.k1, 0); loss_type = NETEM_LOSS_GE; if (!NEXT_IS_NUMBER()) @@ -325,6 +325,10 @@ explain1("loss gemodel h"); return -1; } + /* netem option is "1-h" but kernel + * expects "h". + */ + gemodel.h = max_percent_value - gemodel.h; if (!NEXT_IS_NUMBER()) continue; @@ -625,10 +629,11 @@ } if (gemodel) { - fprintf(f, "loss gemodel p %s", + fprintf(f, " loss gemodel p %s", sprint_percent(gemodel->p, b1)); fprintf(f, " r %s", sprint_percent(gemodel->r, b1)); - fprintf(f, " 1-h %s", sprint_percent(gemodel->h, b1)); + fprintf(f, " 1-h %s", sprint_percent(max_percent_value - + gemodel->h, b1)); fprintf(f, " 1-k %s", sprint_percent(gemodel->k1, b1)); } -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
