Commit Graph

1201 Commits

Author SHA1 Message Date
Stephen Hemminger
d93b6b51e6 ip: iproute fix set never used warning 2011-06-20 14:34:11 -07:00
Stephen Hemminger
cdf3585224 ip: addrlabel fix set never used warning 2011-06-20 14:33:55 -07:00
Eric Dumazet
df39de8d24 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>
2011-06-20 14:31:51 -07:00
Stephen Hemminger
bcd7abddd4 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.
2011-05-19 09:19:17 -07:00
Eric Dumazet
f78e316f25 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>
2011-05-12 08:55:49 -07:00
John Fastabend
892eba309f 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>
2011-04-26 14:59:32 -07:00
Stephen Hemminger
4d91e4f168 Merge branch 'for-2.6.39' of /home/shemminger/iproute2-net-next
Conflicts:
	include/linux/xfrm.h
	ip/iplink.c
2011-04-12 14:42:20 -07:00
Stephen Hemminger
242b8da71b Use INIT_NETDEV_GROUP
Now that headers are sanitized, use the define.
2011-04-12 14:40:14 -07:00
Ulrich Weber
c0635644cd iproute2: parse flag XFRM_POLICY_ICMP
parse flag XFRM_POLICY_ICMP

Signed-off-by: Ulrich Weber <uweber@astaro.com>
2011-04-12 14:38:32 -07:00
Stephen Hemminger
7b032a1f77 Update README information
Change url's and describe current kernel header values.
2011-04-12 14:30:11 -07:00
John Fastabend
914953046a 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>
2011-04-12 14:28:19 -07:00
Brandon Philips
27b3f52444 doc: add pdf targets
Hello Stephen-

Here is one more patch that SUSE has been carrying.

Cheers, Brandon
2011-04-12 14:28:04 -07:00
Juliusz Chroboczek
d7f3299d59 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>
2011-04-12 14:27:37 -07:00
Stephen Hemminger
876cd7fa10 Add README.devel 2011-04-12 14:24:15 -07:00
Stephen Hemminger
59a935d204 Update email address of netem 2011-04-12 14:24:01 -07:00
Brandon Philips
1f7190db39 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>
2011-04-12 14:23:52 -07:00
Stephen Hemminger
d7ac9ad4f4 Fix warning in u32 from assignment in conditional 2011-04-12 14:23:39 -07:00
Stephen Hemminger
8988b02ee1 Fix snprintf with non format
snprintf was being called with environment variable.
If variable had format string (like %s) then program would crash.
2011-04-12 14:23:27 -07:00
Stephen Hemminger
38c867d2a8 Add checks for fgets() when reading proc
If expected proc headers are missing, catch and print error.
2011-04-12 14:23:17 -07:00
Stephen Hemminger
46dc73a57d 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.
2011-04-12 14:23:06 -07:00
Stephen Hemminger
21cfb5e1d9 update to 2.6.39-rc3 headers 2011-04-12 14:20:01 -07:00
Vlad Dogaru
ac694c333f 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>
2011-04-12 14:18:05 -07:00
Stephen Hemminger
77d1e6ab84 v2.6.38.1 2011-03-17 10:05:47 -07:00
Nicolas Dichtel
aba383448c 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>
2011-03-17 10:02:02 -07:00
Vlad Dogaru
2c19bf6aaf iproute2: fix man page whitespace
Signed-off-by: Vlad Dogaru <ddvlad@rosedu.org>
2011-03-17 10:01:37 -07:00
Gerrit Renker
db6b0cfa51 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().
2011-03-17 10:01:22 -07:00
Gerrit Renker
fca1dae821 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.
2011-03-17 10:01:09 -07:00
Gerrit Renker
897fb84fd9 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.
2011-03-17 10:00:43 -07:00
Joy Latten
4bb75da2d0 xfrm security context support
Adds security context support to ip xfrm state.

Signed-off-by: Joy Latten <latten@austin.ibm.com>
2011-03-17 10:00:21 -07:00
Joy Latten
e5055b591b xfrm security context support
Adds security context support to ip xfrm policy.

Signed-off-by: Joy Latten <latten@austin.ibm.com>
2011-03-17 10:00:07 -07:00
Joy Latten
2c319e1ab7 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>
2011-03-17 09:58:23 -07:00
Sridhar Samudrala
f0612d566b 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>
2011-03-16 17:01:58 -07:00
Stephen Hemminger
fcae78992c v2.6.38 2011-03-15 19:27:36 -07:00
Diego Elio Pettenò
2230ac1d18 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>
2011-03-09 10:18:03 -08:00
Nicolas Dichtel
98f5519cd9 iproute2: add support of flag XFRM_STATE_ALIGN4
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
2011-03-02 11:50:09 -08:00
Stephen Hemminger
d5b7420a26 Remove #ifdef's
The iproute package keeps its own headers so there is no need
of polluting code with #ifdef's
2011-02-25 20:00:54 -08:00
Jiri Pirko
a1e191b90c iplink: implement setting of master devic 2011-02-25 19:55:19 -08:00
Nicolas Dichtel
f323f2a32c 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>
2011-02-25 19:52:12 -08:00
Vlad Dogaru
678b99ee6d iproute2: fix man page whitespace
Signed-off-by: Vlad Dogaru <ddvlad@rosedu.org>
2011-02-25 13:01:19 -08:00
Eric Dumazet
f3f28c2126 sfq: add divisor support
In 2.6.39, we can build SFQ queues with a given hash table size,
2011-02-25 12:59:53 -08:00
Gerrit Renker
81d03dc356 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().
2011-02-25 12:54:37 -08:00
Gerrit Renker
9b2cdc00da 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.
2011-02-25 12:51:48 -08:00
Gerrit Renker
94089ef772 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.
2011-02-25 12:49:42 -08:00
Joy Latten
0c7a594541 xfrm security context support
Adds security context support to ip xfrm state.

Signed-off-by: Joy Latten <latten@austin.ibm.com>
2011-02-25 12:45:58 -08:00
Joy Latten
e4f054f017 xfrm security context support
Adds security context support to ip xfrm policy.

Signed-off-by: Joy Latten <latten@austin.ibm.com>
2011-02-25 12:45:49 -08:00
Joy Latten
b2bb289a57 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>
2011-02-25 12:45:36 -08:00
Vlad Dogaru
db02608b6f 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>
2011-02-25 12:43:14 -08:00
Vlad Dogaru
26ad3aecfe 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>
2011-02-25 12:43:07 -08:00
Vlad Dogaru
f960c92aac 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>
2011-02-25 12:38:50 -08:00
Stephen Hemminger
dd4b25a0f9 Merge branch 'choke' into net-next
Conflicts:
	include/linux/pkt_sched.h
2011-02-25 12:35:01 -08:00