]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/log
lisovros/iproute2_canprio.git
13 years agoUse standard routines for interface name to index etc
Stephen Hemminger [Sun, 28 Nov 2010 18:35:28 +0000 (10:35 -0800)]
Use standard routines for interface name to index etc

Use the available libraries for mapping from interface index to name
or type. This should speed up display with lots of interfaces

13 years agoWorkaround for repeated distclean
Stephen Hemminger [Thu, 18 Nov 2010 23:25:38 +0000 (15:25 -0800)]
Workaround for repeated distclean

The subdirectory makefiles need Config file to exist.
Therefore create it, then run make clean, then remove it.

13 years agoUpdate to 2.6.36 headers
Stephen Hemminger [Thu, 21 Oct 2010 00:38:04 +0000 (17:38 -0700)]
Update to 2.6.36 headers

Use santized headers from 2.6.36 release

13 years agoiproute2: display xfrm socket policy direction
Ulrich Weber [Mon, 13 Sep 2010 15:23:01 +0000 (08:23 -0700)]
iproute2: display xfrm socket policy direction

display socket policy direction

Signed-off-by: Ulrich Weber <uweber@astaro.com>
13 years agoFix GRED options clearing
Stephen Hemminger [Wed, 25 Aug 2010 16:04:55 +0000 (09:04 -0700)]
Fix GRED options clearing

Bug reported where priorities of GRED DP's are ignored.
The option parsing sets opt then memset was clearing these
values.

13 years agoiproute2: add 64bit support to ifstat
Eric Dumazet [Mon, 23 Aug 2010 19:44:56 +0000 (21:44 +0200)]
iproute2: add 64bit support to ifstat

Le lundi 23 août 2010 à 10:33 -0700, Stephen Hemminger a écrit :

> I think this breaks the wraparound detection code in this command.
>
>

OK lets fix the bug only, before adding 64bit counters capabilities.

Thanks

[PATCH] iproute2: add 64bit arches support to ifstat

ifstat assumes IFLA_STATS fields are "unsigned long", but they are
__u32. This fix is needed to let ifstat run on 64bit arches.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
13 years agoUse correct rt_link_statistics
Stephen Hemminger [Mon, 23 Aug 2010 16:13:05 +0000 (09:13 -0700)]
Use correct rt_link_statistics

In recent kernels, net_device_stats is not exposed and the code
shoulf have used rt_link_statistics.  Also, fix use of sprintf
with user supplied value.

13 years agoip: add RTA_MARK support
Eric Dumazet [Wed, 21 Jul 2010 09:42:50 +0000 (11:42 +0200)]
ip: add RTA_MARK support

Adds support for RTA_MARK rt attribute added in linux-2.6.36

$ ip route get ADDR mark 4
192.168.20.110 dev eth1  src 192.168.20.108  mark 4
    cache  mtu 1500 advmss 1460 hoplimit 64

$ ip route get 192.168.20.108 from ADDR iif STRING mark 256
local 192.168.20.108 from 192.168.20.110 dev lo  src 192.168.20.108  mark 0x100
    cache <local,src-direct>  iif eth1

$ ip route list cache [ADDR] mark NUMBER

Hexadecimal output if mark >= 16
null marks are not displayed.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
13 years agoUpdate kernel headers to 2.6.36-rc2
Stephen Hemminger [Mon, 23 Aug 2010 15:35:08 +0000 (08:35 -0700)]
Update kernel headers to 2.6.36-rc2

13 years agoSnapshot for 2.6.35.1
Stephen Hemminger [Mon, 23 Aug 2010 15:14:38 +0000 (08:14 -0700)]
Snapshot for 2.6.35.1

13 years agoiproute2: dont filter cached routes on iproute_get
Ulrich Weber [Thu, 12 Aug 2010 09:05:19 +0000 (11:05 +0200)]
iproute2: dont filter cached routes on iproute_get

iproute_get will return cloned routes for IPv4
and cloned as well non-cloned routes for IPv6.

Therefore RTM_F_CLONED flag should not be checked
for iproute_get routes. Check in print_route will
always fail because valid values are 0 and 1.

Signed-off-by: Ulrich Weber <uweber@astaro.com>
13 years agoiproute2: Fix filtering related to flushing IP addresses.
Ben Greear [Mon, 16 Aug 2010 17:00:08 +0000 (10:00 -0700)]
iproute2: Fix filtering related to flushing IP addresses.

The old 'ip addr flush' logic had several flaws:

* It reversed logic for primary v/s secondary flags
  (though, it sort of worked right anyway)

* The code tried to remove secondaries and then primaries,
  but in practice, it always removed one primary per loop,
  which not at all efficient.

* The filter logic in the core would run only the first
  filter in most cases.

* If you used '-s -s', the ifa_flags member would be
  modified, which could make future filters fail
  to function fine.

This patch attempts to fix all of these issues.

Tested-by: Brian Haley <brian.haley@hp.com>
Signed-off-by: Ben Greear <greearb@candelatech.com>
13 years agosnapshot 100804
Stephen Hemminger [Wed, 4 Aug 2010 17:45:59 +0000 (10:45 -0700)]
snapshot 100804

13 years agoFix byte order of ether address match for u32
Stephen Hemminger [Mon, 2 Aug 2010 18:55:30 +0000 (11:55 -0700)]
Fix byte order of ether address match for u32

The u32 key match was incorrect byte order when using ether source
or destination address matching.

13 years agotc: make symbols loaded from tc action modules global.
Andreas Henriksson [Mon, 2 Aug 2010 07:30:33 +0000 (09:30 +0200)]
tc: make symbols loaded from tc action modules global.

Fixes problems with xtables based MARK target ("ipt" module).
When tc loads the "ipt" (xt) module it kept the symbols local,
this made loading of libxtables not find the required struct.

currently ipt/xt is the only tc action module.
iproute2 never seem to do dlclose.
hopefully the modules doesn't export more symbols then needed.

In this situation hopefully the RTLD_GLOBAL flag won't hurt us.

I've been using this patch in the Debian package of iproute for
the last 3 weeks and noone has complained.
( This fixes http://bugs.debian.org/584898 )

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
13 years agoss -p is much too slow
Steve Fink [Wed, 9 Jun 2010 18:42:38 +0000 (11:42 -0700)]
ss -p is much too slow

> On closer inspection, it appears that ss -p does a quadratic scan. It
> rescans every entry in /proc/*/fd/* repeatedly (once per listening
> port? per process? I don't remember what I figured out.)
>
> I humbly suggest that this is not a good idea.

Yep, this is junk.  Please give this patch a try:

ss: Avoid quadradic complexity with '-p'

Scan the process list of open sockets once, and store in a hash
table to be used by subsequent find_user() calls.

Reported-by: Steve Fink <sphink@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetem: fix installs of dist files
Mike Frysinger [Wed, 9 Jun 2010 14:52:09 +0000 (14:52 +0000)]
netem: fix installs of dist files

The tc program searches LIBDIR by default for the .dist files, and that
defaults to /usr/lib.  But the netem subdir has /lib/ hardcoded which
means the default build+install results in the files not being found.

Further, these are plain text files which are read at runtime, so it
doesn't make sense to give them executable bits.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agoFix NULL pointer reference when using basic match
Stephen Hemminger [Fri, 30 Jul 2010 01:03:35 +0000 (18:03 -0700)]
Fix NULL pointer reference when using basic match

If basic match has no tree of matches underneath
then print_ematch would core dump.

13 years agoUpdate ARP header type table
Stephen Hemminger [Fri, 23 Jul 2010 20:12:12 +0000 (13:12 -0700)]
Update ARP header type table

Add all current values. Since if_arp.h is included, get rid
of ifdefs'. Make table constant.

13 years agodnet: fix strict aliasing warnings
Mike Frysinger [Wed, 9 Jun 2010 14:52:41 +0000 (14:52 +0000)]
dnet: fix strict aliasing warnings

Recent gcc doesn't like it when you cast char pointers to uint16_t
pointers and then dereference it.  So use memcpy() instead and let
gcc take care of optimizing things away (when appropriate).  This
should also fix alignment issues on arches where gcc packs the char
pointer tighter than 16bits.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agoiproute: fix tc generating ipv6 priority filter
Petr Lautrbach [Mon, 14 Jun 2010 03:36:28 +0000 (03:36 +0000)]
iproute: fix tc generating ipv6 priority filter

This patch adds ipv6 filter priority/traffic class function
static int parse_ip6_class(int *argc_p, char ***argv_p, struct tc_u32_sel *sel)
shifting filter value to 5th bit and ignoring "at" as header position
is exactly given.

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
13 years agotc: revert "echo" in install target
Mike Frysinger [Wed, 9 Jun 2010 14:52:03 +0000 (14:52 +0000)]
tc: revert "echo" in install target

The recent commit "iproute2: add option to build m_xt as a tc module"
(ab814d635529787) looks like it wrongly included debug changes in the
install target.  So drop the `echo` so the tc binary actually gets
installed again.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agoiproute2: Add dsfield as alias for tos for ip rules
Arnd Hannemann [Fri, 21 May 2010 04:10:09 +0000 (04:10 +0000)]
iproute2: Add dsfield as alias for tos for ip rules

Get ip rule parsing of "dsfield" in sync with ip route parsing and manual page.

Signed-off-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
13 years agoiproute2: Fix batch-mode for mrules.
Ben Greear [Thu, 15 Jul 2010 22:48:10 +0000 (15:48 -0700)]
iproute2: Fix batch-mode for mrules.

The do_multirule logic was broken in batch mode because
it expected the preferred_family to be AF_INET or AF_INET6,
but it then assigned it to RTNL_FAMILY_IPMR or RTNL_FAMILY_IP6MR.
So, the next iteration of the batch processing, it failed
the check for AF_INET or AF_INET6.

Signed-off-by: Ben Greear <greearb@candelatech.com>
13 years agoiproute2: use int instead of long for RTAX_HOPLIMIT compare
Ulrich Weber [Fri, 23 Jul 2010 13:39:10 +0000 (15:39 +0200)]
iproute2: use int instead of long for RTAX_HOPLIMIT compare

otherwise "if ((int)val == -1)" will never match on 64 bit systems

Signed-off-by: Ulrich Weber <uweber@astaro.com>
13 years agoiproute2: use get_user_hz() for IPv6 print_route
Ulrich Weber [Fri, 23 Jul 2010 13:37:31 +0000 (15:37 +0200)]
iproute2: use get_user_hz() for IPv6 print_route

as already done in IPv4 and metrics code part

Signed-off-by: Ulrich Weber <uweber@astaro.com>
13 years agoiproute2: filter routing entries based on clone flag
Ulrich Weber [Fri, 23 Jul 2010 13:36:08 +0000 (15:36 +0200)]
iproute2: filter routing entries based on clone flag

Before IPv6 routing cache entries were always displayed
if additional tables beside MAIN and LOCAL are installed.

Signed-off-by: Ulrich Weber <uweber@astaro.com>
13 years agoip: add support for multicast rules
Patrick McHardy [Wed, 9 Jun 2010 15:41:10 +0000 (17:41 +0200)]
ip: add support for multicast rules

commit 44a5293c1c47b8c32d9bb0756660ea5d4802acf2
Author: Patrick McHardy <kaber@trash.net>
Date:   Tue Apr 13 17:03:47 2010 +0200

    ip: add support for multicast rules

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoAdd IFLA_STATS64 support
Jan Engelhardt [Thu, 11 Mar 2010 10:00:34 +0000 (10:00 +0000)]
Add IFLA_STATS64 support

`ip -s link` shows interface counters truncated to 32 bit. This is
because interface statistics are transported only in 32-bit quantity
to userspace. This commit adds recognition for the new IFLA_STATS64
attribute that exports them in full 64 bit.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agoUpdate kernel derived headers
Stephen Hemminger [Wed, 19 May 2010 15:58:13 +0000 (08:58 -0700)]
Update kernel derived headers

Version for 2.6.35 version on -next

14 years agov2.6.34
Stephen Hemminger [Wed, 19 May 2010 15:32:43 +0000 (08:32 -0700)]
v2.6.34

14 years agoip: add documentation for initrwnd
Stephen Hemminger [Wed, 19 May 2010 15:30:09 +0000 (08:30 -0700)]
ip: add documentation for initrwnd

Cloned from ip-cref.tex

14 years agoip: document initcwnd
Brian Bloniarz [Thu, 6 May 2010 01:37:40 +0000 (21:37 -0400)]
ip: document initcwnd

Mention initcwnd in ip(8). Text taken from doc/ip-cref.tex.

Signed-off-by: Brian Bloniarz <bmb@athenacr.com>
14 years agoiproute2: rework SR-IOV VF support
Chris Wright [Tue, 18 May 2010 07:57:00 +0000 (00:57 -0700)]
iproute2: rework SR-IOV VF support

The kernel interface changed just before 2.6.34 was released.  This brings
iproute2 in line with the current changes.  The VF portion of setlink is
comprised of a set of nested attributes.

  IFLA_VFINFO_LIST (NESTED)
    IFLA_VF_INFO (NESTED)
      IFLA_VF_MAC
      IFLA_VF_VLAN
      IFLA_VF_TX_RATE

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
14 years agoAdd documentation for ip link add/delete sub-commands
Stephen Hemminger [Mon, 17 May 2010 16:50:17 +0000 (09:50 -0700)]
Add documentation for ip link add/delete sub-commands

Add some missing pieces. Still need to add doucmentation for rest
of vlan arguments.

14 years agoUpdate kernel headers to 2.6.34 final version
Stephen Hemminger [Mon, 17 May 2010 15:57:24 +0000 (08:57 -0700)]
Update kernel headers to 2.6.34 final version

Last minute IOV format change.

14 years agoiproute2: fix addrlabel interface names handling
Florian Westphal [Fri, 7 May 2010 11:31:02 +0000 (11:31 +0000)]
iproute2: fix addrlabel interface names handling

ip addrlabel outputs if%d names due to missing init call:
$ ip addrlabel s
prefix a::42/128 dev if4 label 1000

Also, ip did not accept "if%d" interfaces on input.

Signed-off-by: Florian Westphal <fw@strlen.de>
14 years agofix build issues with flex ver 2.5
Bart Trojanowski [Mon, 19 Apr 2010 13:12:57 +0000 (09:12 -0400)]
fix build issues with flex ver 2.5

When building on an old environment, the flex generated
tc/emp_ematch.lex.c file would not compile.  The error given was:

emp_ematch.lex.c:1686: error: expected â\80\98\80\99, â\80\98\80\99 or â\80\98\80\99 before numeric constant

The emp_ematch.l uses 'str' as a start symbol name, and  flex would create
a '#define str 1' statement.  This particular version of flex,
unfortunately, used 'str' as names of string variables in the generated
parser functions.  This is line 1686 in the generated file:

YY_BUFFER_STATE ematch__scan_string (yyconst char * str )

This patch just substitutes 'str' for 'lexstr' in emp_ematch.l to avoid
the collision.

14 years agoUpdate ip.8 man page to describe route table id values
Stephen Hemminger [Thu, 22 Apr 2010 22:24:37 +0000 (15:24 -0700)]
Update ip.8 man page to describe route table id values

2.6 kernel allows 2^32 route tables, but documentation stated only
255 values were possible.

14 years agoDetect 6rd kernel missing support / 6rd tunnel scope
Alexandre Cassen [Sun, 4 Apr 2010 20:40:14 +0000 (22:40 +0200)]
Detect 6rd kernel missing support / 6rd tunnel scope

This patch fix two issues:

* If kernel is not supporting 6rd then ioctl() call
  will return EINVAL, if so just skip perror call.

* 6rd scope is ipv6/ip tunnels. Dont try to fetch
  6rd tunnel parms if tunnel protocol != IPPROTO_IPV6.

Signed-off-by: Alexandre Cassen <acassen@freebox.fr>
14 years agoiproute2: add option to build m_xt as a tc module (v3)
Andreas Henriksson [Mon, 12 Apr 2010 18:24:23 +0000 (20:24 +0200)]
iproute2: add option to build m_xt as a tc module (v3)

This will build the xt module (action ipt) of tc as a
shared object that is linked at runtime by tc if used,
rather then built into tc.

This is similar to how the atm qdisc support
is handled (q_atm.so).

Signed-off-by: Andreas Henriksson <andreas@xxxxxxxx>
14 years agoWorkaround missing ALIGN() macro.
Stephen Hemminger [Tue, 30 Mar 2010 00:37:49 +0000 (17:37 -0700)]
Workaround missing ALIGN() macro.

14 years agoRemove mirred debug message
Stephen Hemminger [Tue, 30 Mar 2010 00:32:37 +0000 (17:32 -0700)]
Remove mirred debug message

Other commands are quiet if successful. mirred action had leftover
debug message.

14 years agoWorkaround missing ALIGN() macro
Stephen Hemminger [Mon, 29 Mar 2010 22:17:48 +0000 (15:17 -0700)]
Workaround missing ALIGN() macro

XT_ALIGN() calls ALIGN macro but ALIGN is in kernel source not userspace.

14 years agoUpdate to 2.6.34-rc2 headers
Stephen Hemminger [Mon, 29 Mar 2010 22:13:14 +0000 (15:13 -0700)]
Update to 2.6.34-rc2 headers

14 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/shemminger/iproute2
Stephen Hemminger [Mon, 29 Mar 2010 22:11:24 +0000 (15:11 -0700)]
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/shemminger/iproute2

14 years agoiproute2: detect iptables modules dir in configure.
Andreas Henriksson [Thu, 11 Mar 2010 10:54:31 +0000 (10:54 +0000)]
iproute2: detect iptables modules dir in configure.

Try to automatically detect iptables modules directory.

Make the configure script look for iptables modules.
This also makes it possible to specify it on the
command line while building via "make IPT_LIB_DIR=/foo/bar".

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
14 years agoip: correctly report tunnel link type
Jan Engelhardt [Thu, 11 Mar 2010 10:22:31 +0000 (10:22 +0000)]
ip: correctly report tunnel link type

Up until now, "tun" tunnels were displayed as link/[65534].

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
14 years agogaiconf: /etc/gai.conf configuration helper.
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 8 Mar 2010 17:12:53 +0000 (17:12 +0000)]
gaiconf: /etc/gai.conf configuration helper.

This tool reads /etc/gai.conf, configuration for getaddrinfo(3), and
set up kernel parameter.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
14 years agoContinue after errors in -batch
Michele Petrazzo - Unipex [Sat, 6 Mar 2010 08:56:53 +0000 (08:56 +0000)]
Continue after errors in -batch

Allow ip to process all the file passed with the -batch argument when
is passed also the -force switch

Signed-off-by: Michele Petrazzo <michele.petrazzo@unipex.it>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/shemminger...
Stephen Hemminger [Thu, 4 Mar 2010 16:31:13 +0000 (08:31 -0800)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2

14 years agoiproute2: netlink support for bus-error reporting and counters
Wolfgang Grandegger [Mon, 22 Feb 2010 22:24:55 +0000 (22:24 +0000)]
iproute2: netlink support for bus-error reporting and counters

This patch uses the new features of the kernel's netlink CAN interface
making the bus-error reporting configurable and allowing to retrieve
the CAN TX and RX bus error counters via netlink interface. Here is the
output of my test session showing how to use them:

# ip link set can0 up type can bitrate 500000 berr-reporting on
# ip -d -s link show can0
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
    link/can
    can <BERR-REPORTING> state ERROR-PASSIVE (berr-counter tx 128 rx 0) restart-ms 0
                              CAN bus error counter values ^^^^^^^^^^^
    bitrate 500000 sample-point 0.875
    tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
    sja1000: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1
    clock 8000000
    re-started bus-errors arbit-lost error-warn error-pass bus-off
    0          54101      0          1          1          0
    RX: bytes  packets  errors  dropped overrun mcast
    432808     54101    54101   0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    0          0        0       0       0       0

# ifconfig can0 down
# ip link set can0 up type can berr-reporting off
# candump -t d any,0:0,#FFFFFFFF
 (0.000000)  can0  20000004  [8] 00 08 00 00 00 00 60 00   ERRORFRAME
 (0.000474)  can0  20000004  [8] 00 20 00 00 00 00 80 00   ERRORFRAME
                                                   ^^ ^^
    \  \___ rxerr
     \_____ txerr

Furthermore, the missing support for one-shot mode has been added.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
14 years agoxfrm: add support for SA by mark
Jamal Hadi Salim [Tue, 23 Feb 2010 03:15:12 +0000 (03:15 +0000)]
xfrm: add support for SA by mark

Add support for SA manipulation by mark

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
14 years agoxfrm: Introduce xfrm by mark
Jamal Hadi Salim [Tue, 23 Feb 2010 03:15:10 +0000 (03:15 +0000)]
xfrm: Introduce xfrm by mark

This patch carries basic infrastructure.
You need to make sure that the proper include/linux/xfrm.h is included
for it to compile.

Example:

14 years agoxfrm: policy by mark
Jamal Hadi Salim [Tue, 23 Feb 2010 03:15:11 +0000 (03:15 +0000)]
xfrm: policy by mark

Add support for SP manipulation by mark

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
14 years agoskbedit: use get_u32 for parsing mark
jamal [Mon, 15 Feb 2010 01:51:01 +0000 (01:51 +0000)]
skbedit: use get_u32 for parsing mark

parsing a mark as a classid allows for acceptance of strange
informal input.

cheers,
jamal
commit aad0da6507ff8a95a63ed8e529c05f52be5b0e75
Author: Jamal Hadi Salim <hadi@cyberus.ca>
Date:   Mon Feb 15 06:45:29 2010 -0500

    skbedit: use get_u32 for parsing mark

    get_u32 is the more appropriate parser for a mark.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
14 years agolibnetlink: Modify the parser to track first duplicated attributes
Williams, Mitch A [Wed, 10 Feb 2010 01:46:47 +0000 (01:46 +0000)]
libnetlink: Modify the parser to track first duplicated attributes

Modify the parser to keep track of the first of any duplicated attributes,
instead of the last. This is required for VF configuration reporting, where
multiple attributes of the same type are added sequentially.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
14 years agoip: Add support for setting and showing SR-IOV virtual funtion link params
Williams, Mitch A [Wed, 10 Feb 2010 01:47:08 +0000 (01:47 +0000)]
ip: Add support for setting and showing SR-IOV virtual funtion link params

Add support to 'ip' for setting and showing SR-IOV virtual function
link parameters.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
14 years agoUpdate man page to indicate current options
Williams, Mitch A [Wed, 10 Feb 2010 01:47:29 +0000 (01:47 +0000)]
Update man page to indicate current options

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
14 years agoFix line numbering on batch commands
Stephen Hemminger [Thu, 4 Mar 2010 00:31:09 +0000 (16:31 -0800)]
Fix line numbering on batch commands

ip command should not keep track of lineno, that is done
in getcmdline().

14 years agoUpdate headers for 2.6.33-net-next
Stephen Hemminger [Thu, 4 Mar 2010 00:22:00 +0000 (16:22 -0800)]
Update headers for 2.6.33-net-next

Use santized headers from net-next tree.

14 years agoAdd initrwnd to iproute2
laurent chavey [Tue, 15 Dec 2009 13:05:15 +0000 (13:05 +0000)]
Add initrwnd to iproute2

Add initrwnd option parsing to iproute. This option uses the new
rtnetlink init_rcvwnd to set the TCP initial receive window size
advertised by passive and active TCP connections.

Signed-off-by: Laurent Chavey <chavey@google.com>
14 years agotc: add new queue discipline: head drop fifo
Hagen Paul Pfeifer [Sun, 24 Jan 2010 12:31:05 +0000 (12:31 +0000)]
tc: add new queue discipline: head drop fifo

This adds the required changes to gain access to
the head drop classfull queuing discipline named
pfifo_head_drop. In difference to pfifo or pfifo_fast
this queuing discipline will drop the first packet
in the case of queue congestion. As a result the queue
contain always the freshest packets.

To replace the current a root queueing discipline
for eth0:
$ tc qdisc replace dev eth0 root pfifo_head_drop

And show statistics:
$ tc -s qdisc show dev eth0

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
14 years agoiproute2-10224
Stephen Hemminger [Thu, 25 Feb 2010 03:56:50 +0000 (19:56 -0800)]
iproute2-10224

Final 2.6.33 version

14 years agoIPv6: 6rd iproute2 support
Alexandre Cassen [Wed, 16 Dec 2009 02:38:29 +0000 (02:38 +0000)]
IPv6: 6rd iproute2 support

This patch provides iproute2 facilities to configure 6rd tunnel. To
configure a 6rd tunnel, you need to configure a sit tunnel and set
6rd prefix as following :

  ip tunnel add sit1 mode sit local a.b.c.d ttl 64
  ip tunnel 6rd dev sit1 6rd-prefix xxxx:yyyy::/z

Optionally you can provide a relay prefix :

  ip tunnel 6rd dev sit1 6rd-relay_prefix e.f.g.h/i

Finally you can reset previous tunnel settings :

  ip tunnel 6rd dev sit1 6rd-reset

Signed-off-by: Alexandre Cassen <acassen@freebox.fr>
14 years agoip: print "temporary" for IPv6 temp addresses
Brian Haley [Mon, 14 Sep 2009 21:01:43 +0000 (17:01 -0400)]
ip: print "temporary" for IPv6 temp addresses

IPv6 addresses that have IFA_F_SECONDARY set are actually temporary addresses,
hence the IFA_F_TEMPORARY equivalent.  Change the output in this case and
allow filtering on the word "temporary".

Signed-off-by: Brian Haley <brian.haley@hp.com>
14 years agoiproute2: drop equalize support
Andreas Henriksson [Tue, 9 Feb 2010 18:58:51 +0000 (10:58 -0800)]
iproute2: drop equalize support

Currently you can configure "equalize" and it looks all fine and dandy.
The kernel has the interface defined, but apparently there's never actually
been any implementation for it (only a never merged patch in the 2.4 era).

I'm suggesting to drop the code to give any potential users of this feature
the benefit of receiving a proper error message. I see it unlikely that
this will be implemented in the near future, but if it ever happens
reviving the iproute2 side should be as easy as git revert this patch.

For more details see http://bugs.debian.org/149897

14 years agoiproute2-100205
Stephen Hemminger [Fri, 5 Feb 2010 20:02:38 +0000 (12:02 -0800)]
iproute2-100205

14 years agotc: man: add man page for drr scheduler
Florian Westphal [Mon, 18 Jan 2010 22:54:02 +0000 (23:54 +0100)]
tc: man: add man page for drr scheduler

With help from Patrick McHardy.

Signed-off-by: Florian Westphal <fw@strlen.de>
14 years agotc: remove stale code
Florian Westphal [Tue, 12 Jan 2010 20:45:01 +0000 (21:45 +0100)]
tc: remove stale code

remove unused #define and "ok" statements.

Signed-off-by: Florian Westphal <fwestphal@astaro.com>
14 years agotc: red, gred, tbf: more helpful error messages
Florian Westphal [Tue, 12 Jan 2010 20:44:29 +0000 (21:44 +0100)]
tc: red, gred, tbf: more helpful error messages

$ tc qdisc add dev eth1 root tbf
RTNETLINK answers: Invalid argument

$ tc qdisc add dev eth1 root red
RTNETLINK answers: Invalid argument

with patch:
$ tc qdisc add dev eth1 root red
Required parameter (min, max, burst, limit, avpkt) is missing

$ tc qdisc add dev eth1 root tbf
Usage: ... tbf limit BYTES burst BYTES[/BYTES] rate KBPS ...

Signed-off-by: Florian Westphal <fw@strlen.de>
14 years agotc: man: SO_PRIORITY is described in socket documentation, not tc one
Florian Westphal [Tue, 12 Jan 2010 20:43:19 +0000 (21:43 +0100)]
tc: man: SO_PRIORITY is described in socket documentation, not tc one

fix up reference: there is no tc(7) man page.

Signed-off-by: Florian Westphal <fw@strlen.de>
14 years agotc: man: add limit parameter to tc-sfq man page
Florian Westphal [Tue, 12 Jan 2010 20:39:12 +0000 (21:39 +0100)]
tc: man: add limit parameter to tc-sfq man page

Signed-off-by: Florian Westphal <fw@strlen.de>
14 years agoip xfrm policy: allow different tmpl family
Alex Badea [Mon, 11 Jan 2010 15:24:04 +0000 (17:24 +0200)]
ip xfrm policy: allow different tmpl family

Allow tmpl IP addresses to have a different family than
selector addresses.  This is useful in conjunction with
XFRM_STATE_AF_UNSPEC.

Signed-off-by: Alex Badea <abadea@ixiacom.com>
14 years agoip xfrm state: parse and print "icmp" and "af-unspec" flags
Alex Badea [Mon, 11 Jan 2010 15:23:41 +0000 (17:23 +0200)]
ip xfrm state: parse and print "icmp" and "af-unspec" flags

Convert to/from XFRM_STATE_ICMP and XFRM_STATE_AF_UNSPEC state flags.

Signed-off-by: Alex Badea <abadea@ixiacom.com>
14 years agoiproute2: avoid using bashisms in configure script.
Andreas Henriksson [Fri, 1 Jan 2010 22:20:30 +0000 (23:20 +0100)]
iproute2: avoid using bashisms in configure script.

"function foo" should be "foo()" to work when sh is not bash.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
14 years agotc: respect LDFLAGS for %.so targets
Mike Frysinger [Sat, 26 Dec 2009 19:52:36 +0000 (14:52 -0500)]
tc: respect LDFLAGS for %.so targets

Since there aren't any targets that currently use this pattern rule, this
is more of a proactive fix.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
14 years agoiproute2/iplink: add macvlan options for bridge mode
Arnd Bergmann [Sat, 26 Dec 2009 19:22:57 +0000 (11:22 -0800)]
iproute2/iplink: add macvlan options for bridge mode

Macvlan can now optionally support forwarding between its
ports, if they are in "bridge" mode. This adds support
for this option to "ip link add", "ip link set" and "ip
-d link show".

The default mode in the kernel is now "vepa" mode, meaning
"virtual ethernet port aggregator". This mode is used
together with the "hairpin" mode of an ethernet bridge
that the parent of the macvlan device is connected to.
All frames still get sent out to the external interface,
but the adjacent bridge is able to send them back on
the same wire in hairpin mode, so the macvlan ports
are able to see each other, which the bridge can be
configured to monitor and control traffic between
all macvlan instances. Multicast traffic coming in
from the external interface is checked for the source
MAC address and only delivered to ports that have not
yet seen it.

In bridge mode, macvlan will send all multicast traffic
to other interfaces that are also in bridge mode but
not to those in vepa mode, which get them on the way
back from the hairpin.

The third supported mode is "private", which prevents
communication between macvlans even if the adjacent
bridge is in hairpin mode. This behavior is closer to
the original implementation of macvlan but stricly
maintains isolation.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
14 years agoAdd dadfailed option to ip command
Brian Haley [Thu, 3 Dec 2009 10:39:36 +0000 (10:39 +0000)]
Add dadfailed option to ip command

Fix support for IFA_F_DADFAILED and update ip.8 man page.

Signed-off-by: Brian Haley <brian.haley@hp.com>
14 years agoiprule: add oif classification support
Patrick McHardy [Thu, 3 Dec 2009 20:07:14 +0000 (20:07 +0000)]
iprule: add oif classification support

David Miller wrote:
> From: Patrick McHardy <kaber@trash.net>
> Date: Mon, 30 Nov 2009 19:00:14 +0100
>
>> This patch contains iproute support for iprule oif classification
>> for the send-to-self RFC I just sent out.
>
> Patrick, you need to submit a new version of this patch with
> the FIB_RULE_* macro fixed, just like the kernel version got
> fixed.

Thanks for reminind me of this. New patch attached.

commit 0fe5164cbaa1d65dda341075710be71bf1f32d10
Author: Patrick McHardy <kaber@trash.net>
Date:   Fri Dec 4 07:06:18 2009 +0100

    iprule: add oif classification support

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoskbedit: Add support to mark packets
Jamal Hadi Salim [Sat, 26 Dec 2009 19:12:43 +0000 (11:12 -0800)]
skbedit: Add support to mark packets

This adds support for setting the skb mark.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
14 years agoiplink_vlan: add support for VLAN loose binding flag
Patrick McHardy [Tue, 1 Dec 2009 01:21:39 +0000 (01:21 +0000)]
iplink_vlan: add support for VLAN loose binding flag

This patch adds support for the VLAN loose binding flag that is
supported in net-next to iplink_vlan.

commit 870970deb6cbea7a5d4881bdd717304d5284d315
Author: Patrick McHardy <kaber@trash.net>
Date:   Tue Dec 1 12:21:15 2009 +0100

    iplink_vlan: add support for VLAN loose binding flag

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoUpdate exported kernel headers
Stephen Hemminger [Sat, 26 Dec 2009 19:02:25 +0000 (11:02 -0800)]
Update exported kernel headers

These corespond with 2.6.33-rc2

14 years agoiproute2-091226
Stephen Hemminger [Sat, 26 Dec 2009 18:26:44 +0000 (10:26 -0800)]
iproute2-091226

14 years agoSlightly improve the configure script.
Andreas Henriksson [Wed, 2 Dec 2009 05:12:30 +0000 (05:12 +0000)]
Slightly improve the configure script.

Split up in functions. Make XT checks bail if previous XT check
was successful.

This result improves the output of the configure script to not indicate
using iptables only because the last test failed (when previous ones could
have already succeded).

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
14 years agoFix warning about sprintf() and NSTAT_HIST
Stephen Hemminger [Sat, 26 Dec 2009 18:21:13 +0000 (10:21 -0800)]
Fix warning about sprintf() and NSTAT_HIST

The environment variable could contain format characters, causing
problems. Better to just use it directly.

14 years agoFix warning about strtod() return value
Stephen Hemminger [Sat, 26 Dec 2009 18:20:50 +0000 (10:20 -0800)]
Fix warning about strtod() return value

14 years agoflush secondary addresses before primary ones
Simon Horman [Thu, 3 Dec 2009 01:08:27 +0000 (12:08 +1100)]
flush secondary addresses before primary ones

Unless promote_secondaries has been active deleting the primary address of
an interface will automatically delete all the secondary addresses.

In the case where ip flush requests the primary then secondary addresses to
be removed - which is the order the addresses are returned by the kernel -
this will cause an error as by the time the request to remove a secondary
address is made it will be missing as it will have been deleted in the
course of deleting the primary address.

This approach to solving this problem orders requests for the
deletion of secondary addresses before primary ones providing
rtnl_dump_filter_l(), a version of rtnl_dump_filter() that
iterates over a list of filters. And by providing two specialised
filters print_addrinfo_secondary() and print_addrinfo_primary().

rtnl_dump_filter_l() first iterates over all addresses using
print_addrinfo_secondary(), which appends secondary addresses to the
request buffer.  Then again using print_addrinfo_primary() which appends
primary addresses.

This approach should work regardless of it promote_secondaries is
active or not. And regardless of if any primary of secondary addresses
are present or not.

Signed-off-by: Simon Horman <horms@verge.net.au>
14 years agoAdd new (iptables 1.4.5 compatible) tc/ipt/xt module.
Andreas Henriksson [Wed, 2 Dec 2009 15:11:50 +0000 (16:11 +0100)]
Add new (iptables 1.4.5 compatible) tc/ipt/xt module.

Add a new cleaned up m_xt.c based on m_xt_old.c
The new m_xt.c has been updated to use the new names and new api
that xtables exposes in iptables 1.4.5.
All the old internal api cruft has also been dropped.

Additionally, a configure script test is added to check for
the new xtables api and set the TC_CONFIG_XT flag in Config.
(tc/Makefile already handles this flag in previous commit.)

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
14 years agoKeep the old tc/ipt/xt module for compatibility.
Andreas Henriksson [Wed, 2 Dec 2009 15:11:21 +0000 (16:11 +0100)]
Keep the old tc/ipt/xt module for compatibility.

Move the file and rename the configure flags.
The file is being kept around for iptables < 1.4.5 compatibility.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
14 years agoiproute: make ss --help output to stdout
Andreas Henriksson [Mon, 7 Dec 2009 12:12:36 +0000 (13:12 +0100)]
iproute: make ss --help output to stdout

Peter Palfrader said in http://bugs.debian.org/545008 that
"--help output, if explicitly requested, should go to stdout, not stderr."
which this patch fixes.

Additionally, the exit code was adjusted to success if help was
explicitly requested.

(Syntax error still outputs to stderr and has the same exit code.)

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
14 years agof_fw: fix compat mode
Patrick McHardy [Mon, 23 Nov 2009 11:03:41 +0000 (12:03 +0100)]
f_fw: fix compat mode

The kernel takes a lack of options as indication that the fw classifier
should operate in compatibility mode, where marks are mapped directly to
classids.

Commit e22b42a (tc mask patch) broke this by adding an empty TCA_OPTIONS
attribute even if no handle is specified. Restore the old behaviour.

Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoiproute2: use -fPIC in lib/
Andreas Henriksson [Mon, 23 Nov 2009 10:03:52 +0000 (11:03 +0100)]
iproute2: use -fPIC in lib/

The static libnetlink.a library is exposed to other users in Debian via the
"iproute-dev" package. Apparently people are interested in using it in their
shared libraries and would like to see the code be position independent.

Patch below makes the code under lib/ build with -fPIC.

See http://bugs.debian.org/547602

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
14 years agoiproute: "ip mroute show" doesn't show all output interfaces
Mark Borst [Wed, 2 Dec 2009 00:15:15 +0000 (16:15 -0800)]
iproute: "ip mroute show" doesn't show all output interfaces

The command "ip mroute show" will only show the first Oif.

mark@flappie:~$ ip mroute show
(192.168.1.1, 224.0.0.123)       Iif: _rename    Oifs: eth1

mark@flappie:~$ cat /proc/net/ip_mr_cache
Group    Origin   Iif     Pkts    Bytes    Wrong Oifs
7B0000E0 0101A8C0 2          0        0        0  0:1    1:1

This shows 2 Oifs here. However, ipmroute.c, function read_mroute_list(), uses sscanf() with a %s mask for oiflist, which stops after the first whitespace (i.e. after Oif 0:1). The patch below fixes this to read until the newline (though I'm not sure whether this is the proper way to fix it).

After this patch:
mark@flappie:~/iproute-20090324/ip$ ./ip mroute show
(192.168.1.1, 224.0.0.123)       Iif: _rename    Oifs: eth1 eth0

This patch originally submitted as http://bugs.debian.org/550097

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
14 years agoipv6: Add IFA_F_DADFAILED flag
Brian Haley [Tue, 1 Dec 2009 23:58:44 +0000 (15:58 -0800)]
ipv6: Add IFA_F_DADFAILED flag

Add IFA_F_DADFAILED flag to denote an IPv6 address that has
failed Duplicate Address Detection, that way tools like
/sbin/ip can be more informative.

3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 2001:db8::1/64 scope global tentative dadfailed
       valid_lft forever preferred_lft forever

Signed-off-by: Brian Haley <brian.haley@hp.com>
14 years agoiproute2: Add ll_index_to_addr function
David Ward [Thu, 15 Oct 2009 18:53:13 +0000 (14:53 -0400)]
iproute2: Add ll_index_to_addr function

After calling ll_init_map, all of the information stored in the link-layer map
can be retrieved by function calls (ll_index_to_*), except for the link-layer
address. This patch fills the gap by adding a ll_index_to_addr function.
Changes welcome.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
14 years agoiproute2 add hoplimit parsing and update usage and documentation
Gilad Ben-Yossef [Tue, 6 Oct 2009 13:40:34 +0000 (15:40 +0200)]
iproute2 add hoplimit parsing and update usage and documentation

- Parse and handle the hoplimit ip route option and add it to the usage
  line and documentation.

- Add the missing reordering ip route option to the usage line.

- Add documentation for initcwnd ip route option.

Tested by setting hoplimit and retreiving it via "show".

Signed-off-by: Gilad Ben-Yossef <gilad@codefidence.com>
[ported to HEAD, fixed a bug with hoplimit lock handling, added documentation]
Signed-off-by: Ori Finkelman <ori@comsleep.com>
Signed-off-by: Yony Amit <yony@comsleep.com>
14 years agoRemove Changes: comments
Stephen Hemminger [Tue, 1 Dec 2009 23:49:48 +0000 (15:49 -0800)]
Remove Changes: comments

Discourage developers from putting change log in comments
now that software has been under change control for 5 years.

14 years agoiproute2: Support 20-byte link layer address in idxmap
David Ward [Thu, 15 Oct 2009 18:53:21 +0000 (14:53 -0400)]
iproute2: Support 20-byte link layer address in idxmap

Extend the link-layer address field from 8 to 20 bytes to support InfiniBand.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
14 years agoiproute2-091117
Stephen Hemminger [Tue, 17 Nov 2009 18:04:57 +0000 (10:04 -0800)]
iproute2-091117