]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/log
lisovros/iproute2_canprio.git
12 years agoss: check result of readlink
Stephen Hemminger [Wed, 29 Jun 2011 22:58:37 +0000 (15:58 -0700)]
ss: check result of readlink

Don't ignore readlink failure.

12 years agoFix set-never-used warning in ifstat
Stephen Hemminger [Wed, 29 Jun 2011 22:58:12 +0000 (15:58 -0700)]
Fix set-never-used warning in ifstat

12 years agolibnetlink: fix set never used warning
Stephen Hemminger [Mon, 20 Jun 2011 21:34:46 +0000 (14:34 -0700)]
libnetlink: fix set never used warning

12 years agotc: fix set never used warning in red
Stephen Hemminger [Mon, 20 Jun 2011 21:34:30 +0000 (14:34 -0700)]
tc: fix set never used warning in red

12 years agoip: iproute fix set never used warning
Stephen Hemminger [Mon, 20 Jun 2011 21:34:11 +0000 (14:34 -0700)]
ip: iproute fix set never used warning

12 years agoip: addrlabel fix set never used warning
Stephen Hemminger [Mon, 20 Jun 2011 21:33:55 +0000 (14:33 -0700)]
ip: addrlabel fix set never used warning

12 years agoss: fix autobound filter
Eric Dumazet [Mon, 20 Jun 2011 21:31:51 +0000 (14:31 -0700)]
ss: fix autobound filter

Fixes following error. We currently provide garbage data to kernel, that
can abort the validation process or produce unexpected results.

$ ss -a autobound
State      Recv-Q Send-Q      Local Address:Port          Peer Address:Port
TCPDIAG answers: Invalid argument

After patch:

$ misc/ss -a autobound
State      Recv-Q Send-Q      Local Address:Port          Peer Address:Port
LISTEN     0      128                     *:44624                    *:*
ESTAB      0      0            192.168.1.21:47141        74.125.79.109:imaps

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
13 years agotc filter: fix dport/sport in pretty print output
Stephen Hemminger [Thu, 19 May 2011 16:19:17 +0000 (09:19 -0700)]
tc filter: fix dport/sport in pretty print output

Problem reported by Peter Lebbing on Debian.
The decode of source and destination port filters in pretty print
mode was backwards.

13 years agoip: Support IFLA_TXQLEN in ip link command
Eric Dumazet [Thu, 22 Oct 2009 18:13:21 +0000 (18:13 +0000)]
ip: Support IFLA_TXQLEN in ip link command

Eric Dumazet a écrit :
> We currently use an expensive ioctl() to get device txqueuelen, while
> rtnetlink gave it to us for free. This patch speeds up ip link operation
> when many devices are registered.
>

Here is a 2nd version od this patch, not displaying "qlen 0" useless info

[PATCH iproute2] ip: Support IFLA_TXQLEN in ip link show command

We currently use an expensive ioctl() to get device txqueuelen, while
rtnetlink gave it to us for free. This patch speeds up ip link operation
when many devices are registered.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
13 years agoiproute2: improve mqprio inputs for queue offsets and counts
John Fastabend [Tue, 26 Apr 2011 19:44:42 +0000 (12:44 -0700)]
iproute2: improve mqprio inputs for queue offsets and counts

This changes mqprio input format to be more user friendly.

Old usage,

 # ./tc/tc qdisc add dev eth3 root mqprio help
Usage: ... mqprio [num_tc NUMBER] [map P0 P1...]
                  [offset txq0 txq1 ...] [count cnt0 cnt1 ...] [hw 1|0]

New usage,

 # ./tc/tc qdisc add dev eth3 root mqprio help
Usage: ... mqprio [num_tc NUMBER] [map P0 P1 ...]
                  [queues count1@offset1 count2@offset2 ...] [hw 1|0]

Suggested-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
13 years agoMerge branch 'for-2.6.39' of /home/shemminger/iproute2-net-next
Stephen Hemminger [Tue, 12 Apr 2011 21:42:20 +0000 (14:42 -0700)]
Merge branch 'for-2.6.39' of /home/shemminger/iproute2-net-next

Conflicts:
include/linux/xfrm.h
ip/iplink.c

13 years agoUse INIT_NETDEV_GROUP
Stephen Hemminger [Tue, 12 Apr 2011 21:40:14 +0000 (14:40 -0700)]
Use INIT_NETDEV_GROUP

Now that headers are sanitized, use the define.

13 years agoiproute2: parse flag XFRM_POLICY_ICMP
Ulrich Weber [Thu, 7 Apr 2011 07:37:05 +0000 (09:37 +0200)]
iproute2: parse flag XFRM_POLICY_ICMP

parse flag XFRM_POLICY_ICMP

Signed-off-by: Ulrich Weber <uweber@astaro.com>
13 years agoUpdate README information
Stephen Hemminger [Wed, 23 Mar 2011 19:29:17 +0000 (12:29 -0700)]
Update README information

Change url's and describe current kernel header values.

13 years agoiproute2: tc add mqprio qdisc support
John Fastabend [Tue, 12 Apr 2011 15:57:27 +0000 (08:57 -0700)]
iproute2: tc add mqprio qdisc support

Add mqprio qdisc support. Output matches the following,

qdisc mq 0: dev eth1 root
qdisc mq 0: dev eth2 root
qdisc mqprio 8001: dev eth3 root  tc 8 map 0 1 2 3 4 5 6 7 1 1 1 1 1 1 1 1
             queues:(0:7) (8:15) (16:23) (24:31) (32:39) (40:47) (48:55) (56:63)

And usage is,

Usage: ... mclass [num_tc NUMBER] [map P0 P1...]
                  [offset txq0 txq1 ...] [count cnt0 cnt1 ...] [hw 1|0]

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
13 years agodoc: add pdf targets
Brandon Philips [Fri, 25 Mar 2011 21:43:44 +0000 (14:43 -0700)]
doc: add pdf targets

Hello Stephen-

Here is one more patch that SUSE has been carrying.

Cheers, Brandon

13 years agotc : SFB flow scheduler
Juliusz Chroboczek [Thu, 24 Mar 2011 17:44:09 +0000 (18:44 +0100)]
tc : SFB flow scheduler

Supports SFB qdisc (included in linux-2.6.39)

1) Setup phase : accept non default parameters

2) dump information

qdisc sfb 11: parent 1:11 limit 1 max 25 target 20
  increment 0.00050 decrement 0.00005 penalty rate 10 burst 20 (600000ms 60000ms)
 Sent 47991616 bytes 521648 pkt (dropped 549245, overlimits 549245 requeues 0)
 rate 7193Kbit 9774pps backlog 0b 0p requeues 0
  earlydrop 0 penaltydrop 0 bucketdrop 0 queuedrop 549245 childdrop 0 marked 0
  maxqlen 0 maxprob 0.00000 avgprob 0.00000

Signed-off-by: Juliusz Chroboczek <Juliusz.Chroboczek@pps.jussieu.fr>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
13 years agoAdd README.devel
Stephen Hemminger [Wed, 23 Mar 2011 19:34:21 +0000 (12:34 -0700)]
Add README.devel

13 years agoUpdate email address of netem
Stephen Hemminger [Wed, 23 Mar 2011 19:29:06 +0000 (12:29 -0700)]
Update email address of netem

13 years agoip: fix memory leak in ipmaddr.c
Brandon Philips [Wed, 23 Mar 2011 19:03:49 +0000 (12:03 -0700)]
ip: fix memory leak in ipmaddr.c

If the continue is taken, then there is a memory leak.

https://bugzilla.novell.com/show_bug.cgi?id=538996

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Brandon Philips <bphilips@suse.de>
13 years agoFix warning in u32 from assignment in conditional
Stephen Hemminger [Wed, 9 Mar 2011 18:42:35 +0000 (10:42 -0800)]
Fix warning in u32 from assignment in conditional

13 years agoFix snprintf with non format
Stephen Hemminger [Wed, 9 Mar 2011 18:41:44 +0000 (10:41 -0800)]
Fix snprintf with non format

snprintf was being called with environment variable.
If variable had format string (like %s) then program would crash.

13 years agoAdd checks for fgets() when reading proc
Stephen Hemminger [Wed, 9 Mar 2011 18:41:09 +0000 (10:41 -0800)]
Add checks for fgets() when reading proc

If expected proc headers are missing, catch and print error.

13 years agoAdd no-strict-aliasing to genl
Stephen Hemminger [Wed, 9 Mar 2011 18:39:17 +0000 (10:39 -0800)]
Add no-strict-aliasing to genl

The genl code uses constructs which violate the strict aliasing
constraints of gcc 4.4. Disable the optimization to avoid warnings
and potential breakage.

13 years agoupdate to 2.6.39-rc3 headers
Stephen Hemminger [Tue, 12 Apr 2011 21:20:01 +0000 (14:20 -0700)]
update to 2.6.39-rc3 headers

13 years agoiproute2: support listing devices by group
Vlad Dogaru [Wed, 2 Feb 2011 18:23:40 +0000 (20:23 +0200)]
iproute2: support listing devices by group

User can specify device group to list by using the group keyword:

ip link show group test

If no group is specified, 0 (default) is implied.

Signed-off-by: Vlad Dogaru <ddvlad@rosedu.org>
13 years agov2.6.38.1
Stephen Hemminger [Thu, 17 Mar 2011 17:05:47 +0000 (10:05 -0700)]
v2.6.38.1

13 years agoiproute2: allow to specify truncation bits on auth algo
Nicolas Dichtel [Tue, 11 Jan 2011 06:32:46 +0000 (06:32 +0000)]
iproute2: allow to specify truncation bits on auth algo

Hi,

here is a patch against iproute2 to allow user to set a state with a specific
auth length.

Example:
$ ip xfrm state add src 10.16.0.72 dst 10.16.0.121 proto ah spi 0x10000000
auth-trunc "sha256" "azertyuiopqsdfghjklmwxcvbn123456" 96 mode tunnel
$ ip xfrm state
src 10.16.0.72 dst 10.16.0.121
         proto ah spi 0x10000000 reqid 0 mode tunnel
         replay-window 0
         auth-trunc hmac(sha256)
0x617a6572747975696f707173646667686a6b6c6d77786376626e313233343536 96
         sel src 0.0.0.0/0 dst 0.0.0.0/0

Regards,
Nicolas

>From 522ed7348cdf3b6f501af2a5a5d989de1696565a Mon Sep 17 00:00:00 2001
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Thu, 23 Dec 2010 06:48:12 -0500
Subject: [PATCH] iproute2: allow to specify truncation bits on auth algo

Attribute XFRMA_ALG_AUTH_TRUNC can be used to specify
truncation bits, so we add a new algo type: auth-trunc.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
13 years agoiproute2: fix man page whitespace
Vlad Dogaru [Wed, 26 Jan 2011 07:35:27 +0000 (07:35 +0000)]
iproute2: fix man page whitespace

Signed-off-by: Vlad Dogaru <ddvlad@rosedu.org>
13 years agoiproute: rename 'get_jiffies' since it uses msecs
Gerrit Renker [Fri, 25 Feb 2011 20:54:37 +0000 (12:54 -0800)]
iproute: rename 'get_jiffies' since it uses msecs

The get_jiffies() function retrieves rtt-type values in units of
milliseconds. This patch updates the function name accordingly,
following the pattern given by dst_metric() <=> dst_metric_rtt().

13 years agoiproute: fix unit conversion of rtt/rttvar/rto_min
Gerrit Renker [Fri, 25 Feb 2011 20:51:48 +0000 (12:51 -0800)]
iproute: fix unit conversion of rtt/rttvar/rto_min

Since July 2008 (2.6.27, c1e20f7c8b9), the kernel stores the values for
RTAX_{RTT{,VAR},RTO_MIN} in milliseconds. When using a kernel > 2.6.27 with
the current iproute2, conversion of these values is broken in either way.

This patch
 * updates the code to pass and retrieve milliseconds;
 * since values < 1msec would be rounded up, also drops the usec/nsec variants;
 * since there is no way to query kernel HZ, also drops the jiffies variant.

Arguments such as
rtt 3.23sec
rto_min 0xff
rto_min 0.200s
rttvar 25ms
now all work as expected when reading back previously set values.

13 years agoutils: get_jiffies always uses base=0
Gerrit Renker [Tue, 21 Dec 2010 11:54:09 +0000 (12:54 +0100)]
utils: get_jiffies always uses base=0

get_jiffies() is in all places called in the same manner, with base=0;
simplify argument list by putting the constant value into the function.

13 years agoxfrm security context support
Joy Latten [Wed, 2 Feb 2011 23:32:59 +0000 (17:32 -0600)]
xfrm security context support

Adds security context support to ip xfrm state.

Signed-off-by: Joy Latten <latten@austin.ibm.com>
13 years agoxfrm security context support
Joy Latten [Wed, 2 Feb 2011 23:32:18 +0000 (17:32 -0600)]
xfrm security context support

Adds security context support to ip xfrm policy.

Signed-off-by: Joy Latten <latten@austin.ibm.com>
13 years agoxfrm security context support
Joy Latten [Wed, 2 Feb 2011 23:31:39 +0000 (17:31 -0600)]
xfrm security context support

In the Linux kernel, ipsec policy and SAs can include a
security context to support MAC networking. This feature
is often referred to as "labeled ipsec".

This patchset adds security context support into ip xfrm
such that a security context can be included when
add/delete/display SAs and policies with the ip command.
The user provides the security context when adding
SAs and policies. If a policy or SA contains a security
context, the changes allow the security context to be displayed.

For example,
ip xfrm state
src 10.1.1.6 dst 10.1.1.2
proto esp spi 0x00000301 reqid 0 mode transport
replay-window 0
auth hmac(digest_null) 0x3078
enc cbc(des3_ede) 0x6970763672656164796c6f676f33646573636263696e3031
security context root:system_r:unconfined_t:s0

Please  let me know if all is ok with the patchset.
Thanks!!

regards,
Joy

Signed-off-by: Joy Latten <latten@austin.ibm.com>
13 years agomacvlan/macvtap: support 'passthru' mode
Sridhar Samudrala [Thu, 17 Mar 2011 00:01:58 +0000 (17:01 -0700)]
macvlan/macvtap: support 'passthru' mode

Add support for 'passthru' mode when creating a macvlan/macvtap device
which allows takeover of the underlying device and passing it to a KVM
guest using virtio with macvtap backend.

Only one macvlan device is allowed in passthru mode and it inherits
the mac address from the underlying device and sets it in promiscuous
mode to receive and forward all the packets.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
13 years agov2.6.38
Stephen Hemminger [Wed, 16 Mar 2011 02:27:36 +0000 (19:27 -0700)]
v2.6.38

13 years agoRemove -L flags from link
Diego Elio Pettenò [Wed, 9 Mar 2011 18:18:03 +0000 (10:18 -0800)]
Remove -L flags from link

While the previous code was supposed to work nonetheless, it could be
messed up if further -L were used in LDFLAGS to list the path where glibc's
libutil was to be found.

References: https://bugs.gentoo.org/347489

Signed-off-by: Diego Elio Pettenò <flameeyes@gmail.com>
13 years agoiproute2: add support of flag XFRM_STATE_ALIGN4
Nicolas Dichtel [Tue, 1 Feb 2011 12:29:54 +0000 (07:29 -0500)]
iproute2: add support of flag XFRM_STATE_ALIGN4

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
13 years agoRemove #ifdef's
Stephen Hemminger [Sat, 26 Feb 2011 04:00:54 +0000 (20:00 -0800)]
Remove #ifdef's

The iproute package keeps its own headers so there is no need
of polluting code with #ifdef's

13 years agoiplink: implement setting of master devic
Jiri Pirko [Sat, 26 Feb 2011 03:55:19 +0000 (19:55 -0800)]
iplink: implement setting of master devic

13 years agoiproute2: allow to specify truncation bits on auth algo
Nicolas Dichtel [Tue, 11 Jan 2011 06:32:46 +0000 (06:32 +0000)]
iproute2: allow to specify truncation bits on auth algo

Hi,

here is a patch against iproute2 to allow user to set a state with a specific
auth length.

Example:
$ ip xfrm state add src 10.16.0.72 dst 10.16.0.121 proto ah spi 0x10000000
auth-trunc "sha256" "azertyuiopqsdfghjklmwxcvbn123456" 96 mode tunnel
$ ip xfrm state
src 10.16.0.72 dst 10.16.0.121
         proto ah spi 0x10000000 reqid 0 mode tunnel
         replay-window 0
         auth-trunc hmac(sha256)
0x617a6572747975696f707173646667686a6b6c6d77786376626e313233343536 96
         sel src 0.0.0.0/0 dst 0.0.0.0/0

Regards,
Nicolas

>From 522ed7348cdf3b6f501af2a5a5d989de1696565a Mon Sep 17 00:00:00 2001
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Thu, 23 Dec 2010 06:48:12 -0500
Subject: [PATCH] iproute2: allow to specify truncation bits on auth algo

Attribute XFRMA_ALG_AUTH_TRUNC can be used to specify
truncation bits, so we add a new algo type: auth-trunc.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
13 years agoiproute2: fix man page whitespace
Vlad Dogaru [Wed, 26 Jan 2011 07:35:27 +0000 (07:35 +0000)]
iproute2: fix man page whitespace

Signed-off-by: Vlad Dogaru <ddvlad@rosedu.org>
13 years agosfq: add divisor support
Eric Dumazet [Sun, 23 Jan 2011 00:09:06 +0000 (00:09 +0000)]
sfq: add divisor support

In 2.6.39, we can build SFQ queues with a given hash table size,

13 years agoiproute: rename 'get_jiffies' since it uses msecs
Gerrit Renker [Fri, 25 Feb 2011 20:54:37 +0000 (12:54 -0800)]
iproute: rename 'get_jiffies' since it uses msecs

The get_jiffies() function retrieves rtt-type values in units of
milliseconds. This patch updates the function name accordingly,
following the pattern given by dst_metric() <=> dst_metric_rtt().

13 years agoiproute: fix unit conversion of rtt/rttvar/rto_min
Gerrit Renker [Fri, 25 Feb 2011 20:51:48 +0000 (12:51 -0800)]
iproute: fix unit conversion of rtt/rttvar/rto_min

Since July 2008 (2.6.27, c1e20f7c8b9), the kernel stores the values for
RTAX_{RTT{,VAR},RTO_MIN} in milliseconds. When using a kernel > 2.6.27 with
the current iproute2, conversion of these values is broken in either way.

This patch
 * updates the code to pass and retrieve milliseconds;
 * since values < 1msec would be rounded up, also drops the usec/nsec variants;
 * since there is no way to query kernel HZ, also drops the jiffies variant.

Arguments such as
rtt 3.23sec
rto_min 0xff
rto_min 0.200s
rttvar 25ms
now all work as expected when reading back previously set values.

13 years agoutils: get_jiffies always uses base=0
Gerrit Renker [Tue, 21 Dec 2010 11:54:09 +0000 (12:54 +0100)]
utils: get_jiffies always uses base=0

get_jiffies() is in all places called in the same manner, with base=0;
simplify argument list by putting the constant value into the function.

13 years agoxfrm security context support
Joy Latten [Wed, 2 Feb 2011 23:32:59 +0000 (17:32 -0600)]
xfrm security context support

Adds security context support to ip xfrm state.

Signed-off-by: Joy Latten <latten@austin.ibm.com>
13 years agoxfrm security context support
Joy Latten [Wed, 2 Feb 2011 23:32:18 +0000 (17:32 -0600)]
xfrm security context support

Adds security context support to ip xfrm policy.

Signed-off-by: Joy Latten <latten@austin.ibm.com>
13 years agoxfrm security context support
Joy Latten [Wed, 2 Feb 2011 23:31:39 +0000 (17:31 -0600)]
xfrm security context support

In the Linux kernel, ipsec policy and SAs can include a
security context to support MAC networking. This feature
is often referred to as "labeled ipsec".

This patchset adds security context support into ip xfrm
such that a security context can be included when
add/delete/display SAs and policies with the ip command.
The user provides the security context when adding
SAs and policies. If a policy or SA contains a security
context, the changes allow the security context to be displayed.

For example,
ip xfrm state
src 10.1.1.6 dst 10.1.1.2
proto esp spi 0x00000301 reqid 0 mode transport
replay-window 0
auth hmac(digest_null) 0x3078
enc cbc(des3_ede) 0x6970763672656164796c6f676f33646573636263696e3031
security context root:system_r:unconfined_t:s0

Please  let me know if all is ok with the patchset.
Thanks!!

regards,
Joy

Signed-off-by: Joy Latten <latten@austin.ibm.com>
13 years agoiproute2: support device group semantics
Vlad Dogaru [Wed, 2 Feb 2011 18:23:41 +0000 (20:23 +0200)]
iproute2: support device group semantics

Add the group keyword to ip link set, which has the following meaning:
If both a group and a device name are pressent, we change the device's
group to the specified one. If only a group is present, then the
operation specified by the rest of the command should apply on an entire
group, not a single device.

So, to set eth0 to the default group, one would use
ip link set dev eth0 group default

Conversely, to set all the devices in the default group down, use
ip link set group default down

Signed-off-by: Vlad Dogaru <ddvlad@rosedu.org>
13 years agoiproute2: support device group semantics
Vlad Dogaru [Wed, 2 Feb 2011 18:23:41 +0000 (20:23 +0200)]
iproute2: support device group semantics

Add the group keyword to ip link set, which has the following meaning:
If both a group and a device name are pressent, we change the device's
group to the specified one. If only a group is present, then the
operation specified by the rest of the command should apply on an entire
group, not a single device.

So, to set eth0 to the default group, one would use
ip link set dev eth0 group default

Conversely, to set all the devices in the default group down, use
ip link set group default down

Signed-off-by: Vlad Dogaru <ddvlad@rosedu.org>
13 years agoiproute2: support listing devices by group
Vlad Dogaru [Wed, 2 Feb 2011 18:23:40 +0000 (20:23 +0200)]
iproute2: support listing devices by group

User can specify device group to list by using the group keyword:

ip link show group test

If no group is specified, 0 (default) is implied.

Signed-off-by: Vlad Dogaru <ddvlad@rosedu.org>
13 years agoMerge branch 'choke' into net-next
Stephen Hemminger [Fri, 25 Feb 2011 20:35:01 +0000 (12:35 -0800)]
Merge branch 'choke' into net-next

Conflicts:
include/linux/pkt_sched.h

13 years agoupdate to net-next (2.6.39) headers
Stephen Hemminger [Fri, 25 Feb 2011 20:31:36 +0000 (12:31 -0800)]
update to net-next (2.6.39) headers

13 years agoMerge branch 'master' into choke
Stephen Hemminger [Sun, 20 Feb 2011 20:35:40 +0000 (12:35 -0800)]
Merge branch 'master' into choke

13 years agoCHOKe scheduler
Stephen Hemminger [Thu, 13 Jan 2011 17:23:17 +0000 (09:23 -0800)]
CHOKe scheduler

TC commands for CHOKe qdisc

13 years agoRevert "iproute2: add VF_PORT support"
Stephen Hemminger [Thu, 13 Jan 2011 22:53:02 +0000 (14:53 -0800)]
Revert "iproute2: add VF_PORT support"

This reverts commit 632110aa0db4518b33fc09189ffcdd1b2e2e1762.

There seem to be some recent changes in the 802.1Qbh/bg specs which may
result in changes to this patch in the near future. It seems like its best
to ignore this patch for now.
I will re-spin at a later time when the changes in the specs converge.

BTW, Please let me know if I should CC netdev list and others on the
original email. I can resend this email.

Thanks,
Roopa

13 years agoiproute2: add VF_PORT support
Roopa Prabhu [Tue, 9 Nov 2010 14:47:52 +0000 (14:47 +0000)]
iproute2: add VF_PORT support

Resubmitting Scott Feldmans original patch with below changes

- Fix port profile strlen which was off by 1
- Added function to convert IFLA_PORT_RESPONSE codes to string

Add support for IFLA_VF_PORTS.  VF port netlink msg layout is

        [IFLA_NUM_VF]
        [IFLA_VF_PORTS]
                [IFLA_VF_PORT]
                        [IFLA_PORT_*], ...
                [IFLA_VF_PORT]
                        [IFLA_PORT_*], ...
                ...
        [IFLA_PORT_SELF]
                [IFLA_PORT_*], ...

The iproute2 cmd line for link set is now:

Usage: ip link add link DEV [ name ] NAME
                   [ txqueuelen PACKETS ]
                   [ address LLADDR ]
                   [ broadcast LLADDR ]
                   [ mtu MTU ]
                   type TYPE [ ARGS ]
       ip link delete DEV type TYPE [ ARGS ]

       ip link set DEVICE [ { up | down } ]
                          [ arp { on | off } ]
                          [ dynamic { on | off } ]
                          [ multicast { on | off } ]
                          [ allmulticast { on | off } ]
                          [ promisc { on | off } ]
                          [ trailers { on | off } ]
                          [ txqueuelen PACKETS ]
                          [ name NEWNAME ]
                          [ address LLADDR ]
                          [ broadcast LLADDR ]
                          [ mtu MTU ]
                          [ netns PID ]
                          [ alias NAME ]
                          [ port MODE { PROFILE | VSI } ]
                          [ vf NUM [ mac LLADDR ]
                                   [ vlan VLANID [ qos VLAN-QOS ] ]
                                   [ rate TXRATE ]
                                   [ port MODE { PROFILE | VSI } ] ]
       ip link show [ DEVICE ]

TYPE := { vlan | veth | vcan | dummy | ifb | macvlan | can }
MODE := { assoc | preassoc | preassocrr | disassoc }
PROFILE := profile PROFILE
           [ instance UUID ]
           [ host UUID ]
VSI := vsi mgr MGRID type VTID ver VER
       [ instance UUID ]

Signed-off-by: Scott Feldman <scofeldm@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
13 years agoUpdate to lasest kernel headers
Stephen Hemminger [Thu, 13 Jan 2011 02:46:54 +0000 (18:46 -0800)]
Update to lasest kernel headers

13 years agov2.6.37
Stephen Hemminger [Fri, 7 Jan 2011 17:54:30 +0000 (09:54 -0800)]
v2.6.37

13 years agoUpdate to 2.6.37-rc8 headers
Stephen Hemminger [Wed, 29 Dec 2010 23:05:48 +0000 (15:05 -0800)]
Update to 2.6.37-rc8 headers

Use sanitized headers from 2.6.37-rc8

13 years agoip: Few typo and grammar errors fixes for ip(8) manpage
Petr Sabata [Thu, 16 Dec 2010 16:24:54 +0000 (17:24 +0100)]
ip: Few typo and grammar errors fixes for ip(8) manpage

13 years agoCleanup ll_map
Stephen Hemminger [Fri, 10 Dec 2010 19:49:29 +0000 (11:49 -0800)]
Cleanup ll_map

In preparation for adding name hash:
  * add const
  * use same types in cache as ifinfomsg
  * rename idxmap to ll_cache

13 years agoiproute2: initialize the ll_map only once
Octavian Purdila [Fri, 10 Dec 2010 14:59:50 +0000 (16:59 +0200)]
iproute2: initialize the ll_map only once

Avoid initializing the LL map (which involves a costly RTNL dump)
multiple times. This can happen when running in batch mode.

Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>
13 years agoIncrease size of ifindex hash heads
Stephen Hemminger [Fri, 10 Dec 2010 17:46:24 +0000 (09:46 -0800)]
Increase size of ifindex hash heads

The default of 16 is too small for users with 10,000 interfaces.

13 years agotc-red: typo in man page
Gerrit Renker [Thu, 9 Dec 2010 17:39:47 +0000 (09:39 -0800)]
tc-red: typo in man page

13 years agoss: Change "do now" to "do not" in ss(8), -n option
Petr Sabata [Wed, 8 Dec 2010 13:49:09 +0000 (14:49 +0100)]
ss: Change "do now" to "do not" in ss(8), -n option

A small typo fix.

13 years agoAdd ip route save/restore
Dan Smith [Wed, 1 Dec 2010 19:24:58 +0000 (11:24 -0800)]
Add ip route save/restore

This patch adds save and restore commands to "ip route". Save dumps
the RTNL stream to stdout which can then be passed to restore later.
This may be helpful in some normal situations, and will allow C/R to
migrate the routing information in userspace.  Tweaking of the stream
can be done by userspace helpers to convert between versions and adjust
things like device indexes when restoring routes in a different
environment.

By factoring out some of the common bits of print_route() into
filter_nlmsg(), the "save" command can use the same selection logic
as "list," allowing the caller to save only specific routes as
necessary.

The only change since the RFC is the addition of manpage and doc
material.

Signed-off-by: Dan Smith <danms@us.ibm.com>
13 years agotc: add ACT_CSUM action support (csum)
Gregoire Baron [Wed, 1 Dec 2010 19:17:46 +0000 (11:17 -0800)]
tc: add ACT_CSUM action support (csum)

Add the iproute2 support for the ACT_CSUM action. Can be used as
following, certainly in conjunction with the ACT_PEDIT action (pedit):

 # In order to DNAT (stateless) IPv4 packet from 192.168.1.100 to
 #  0x12345678 (18.52.86.120), and update the IPv4 header checksum and
 #  the UDP checksum (the last one, only if the packet is UDP).
tc filter add eth0 prio 1 protocol ip parent ffff: \
  u32 match ip src 192.168.1.100/32 flowid :1 \
    action pedit munge offset 16 u32 set 0x12345678 \
      pipe csum ip and udp

 # In order to alter destination address of IPv6 TCP packets from fc00::1
 #  and correct the TCP checksum (nothing happened? except maybe for
 #  checksums in the TCP payload ...).
tc filter add eth0 prio 1 protocol ipv6 parent ffff: \
  u32 match ip6 src fc00::1/128 match ip6 protocol 0x06 0xff flowid :1 \
    action pedit munge offset 24 u32 set 0x12345678 \
      pipe csum tcp

13 years agoAllow 'ip addr flush' to loop more than 10 times
Ben Greear [Wed, 1 Dec 2010 19:13:51 +0000 (11:13 -0800)]
Allow 'ip addr flush' to loop more than 10 times

The default remains at 10 for backwards compatibility.

For instance:
 # ip addr flush dev eth2
 *** Flush remains incomplete after 10 rounds. ***
 # ip -l 20 addr flush dev eth2
 *** Flush remains incomplete after 20 rounds. ***
 # ip -loops 0 addr flush dev eth2
 #

This is useful for getting rid of large numbers of IP
addresses in scripts.

Signed-off-by: Ben Greear <greearb@candelatech.com>
13 years agoSupport 'mode' parameter when creating macvtap device
Sridhar Samudrala [Thu, 28 Oct 2010 13:10:40 +0000 (13:10 +0000)]
Support 'mode' parameter when creating macvtap device

Add support for 'mode' parameter when creating a macvtap device.
This allows a macvtap device to be created in bridge, private or
the default vepa modes.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
-------------------------------------------------------------------
Acked-by: Arnd Bergmann <arnd@arndb.de>
13 years agoiproute2: remove useless use of buffer
Andreas Schwab [Fri, 5 Nov 2010 23:26:29 +0000 (23:26 +0000)]
iproute2: remove useless use of buffer

Print directly to the file instead of going through a buffer.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
13 years agoiproute2: tc: f_flow: add key rxhash
Changli Gao [Sat, 21 Aug 2010 06:30:01 +0000 (06:30 +0000)]
iproute2: tc: f_flow: add key rxhash

We can use rxhash to classify the traffic into flows. As rxhash maybe
supplied by NIC or RPS, it is cheaper.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Acked-by: Jamal Hadi Salim <hadi@cyberus.ca>
13 years agoiproute2: support xfrm upper protocol gre key
Timo Teräs [Tue, 23 Nov 2010 22:18:58 +0000 (22:18 +0000)]
iproute2: support xfrm upper protocol gre key

Similar to tunnel side: accept dotted-quad and number formats.
Use regular number for printing the key.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
13 years agoiproute2: treat gre key as number
Timo Teräs [Tue, 23 Nov 2010 22:18:57 +0000 (22:18 +0000)]
iproute2: treat gre key as number

Print GRE key as a regular number. It is not really an IPv4 address
and this is also how Cisco and Juniper treats GRE keys. Do keep the
parsing of dotted-quad format for backwards compatibility.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
13 years agom_xt: stop using xtables_set_revision()
Mike Frysinger [Sun, 21 Nov 2010 21:16:54 +0000 (16:16 -0500)]
m_xt: stop using xtables_set_revision()

iptables dropped the xtables_set_revision() function around version 1.4.9,
so set the rev directly ourselves.  This should be compatible back to the
original version m_xt itself is designed for.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
13 years agoss(8) improvements by Jiri Popelka <jpopelka@redhat.com>
Petr Sabata [Mon, 29 Nov 2010 13:00:37 +0000 (14:00 +0100)]
ss(8) improvements by Jiri Popelka <jpopelka@redhat.com>

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>