Commit Graph

108 Commits

Author SHA1 Message Date
Masahide NAKAMURA
288384f22f TUNNEL: IPv6-over-IPv6 tunnel support.
Fix ip6tunnel.c to be fit with current ip command style.
Unlike other modules currently iptunnel (and ip6tunnel) is not
designed as protocol-independent because of unarranged structure
between IPv4 and IPv6.

Usage: ip -f inet6 tunnel { add | change | del | show } [ NAME ]
          [ remote ADDR local ADDR ] [ dev PHYS_DEV ]
          [ encaplimit ELIM ]
          [ hoplimit HLIM ] [ tc TC ] [ fl FL ]
          [ dscp inherit ]

Where: NAME := STRING
       ADDR := IPV6_ADDRESS
       ELIM := { none | 0..255 }(default=4)
       HLIM := 0..255 (default=64)
       TC   := { 0x0..0xff | inherit }
       FL   := { 0x0..0xfffff | inherit }

Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-11-27 08:41:26 -08:00
Masahide NAKAMURA
9447a0d344 TUNNEL: Import ip6tunnel.c.
This file (ip6tunnel.c) is renamed from ipv6tunnel.c which is imported
from usagi cvs tree. It is originally ported by MIPL to work on their
2.4 kernel patch (MIPL1).

Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-11-27 08:41:23 -08:00
Masahide NAKAMURA
d9bd1bd945 TUNNEL: Split common functions to export them.
Split common functions like ioctl to export them.
This is a preparation to support to configure IPv6-over-IPv6 tunnel.
This patch also includes minor improvemen:
 o to stop to include unused headers
 o to change function static if it is not needed to be exported

Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-11-27 08:41:10 -08:00
Masahide NAKAMURA
141bb60640 ADDR: Define 0xFFFFFFFFU as INFINITY_LIFE_TIME regarding to the kernel.
Signed-off-by: TAKAMIYA Noriaki <takamiya@po.ntts.co.jp>
Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-11-27 08:41:07 -08:00
Noriaki TAKAMIYA
0aef366b48 ADDR: Add the 'change' and 'replace' commands to the IPv6 address manipulation context.
Signed-off-by: TAKAMIYA Noriaki <takamiya@po.ntts.co.jp>
Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-11-27 08:40:56 -08:00
Masahide NAKAMURA
35546df7d5 ADDR: Enable to add IPv6 address with valid/preferred lifetime.
Signed-off-by: TAKAMIYA Noriaki <takamiya@po.ntts.co.jp>
Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-11-27 08:40:36 -08:00
Masahide NAKAMURA
0cc5ebf46d ADDR: Fix print format for lifetimes.
Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-11-27 08:40:35 -08:00
Thomas Graf
98bde989db Add rule notification support to ip monitor
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-11-10 09:40:30 -08:00
Thomas Graf
3123a0ccdd Add support for inverted selectors
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-11-09 08:51:29 -08:00
Stephen Hemminger
6a79240b6f Route metrics decode bug.
Array was not being offset correctly.

See http://bugs.archlinux.org/task/5669

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-10-26 08:47:00 -07:00
Stephen Hemminger
34e099e24f SA and SP in IPSec BEET mode.
Patch which allows for setting SA and SP also for
new IPSec mode BEET, beside tunnel and transport, according to the latest
changes in the kernel you can find at the following link:

Signed-off-by: Diego Beltrami <diego.beltrami@gmail.com>
Signed-off-by: Miika Komu <miika@iki.fi>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-10-19 13:15:35 -07:00
Stephen Hemminger
3bfa73ff99 rtnl fd check
Prevent accidental damage from rtnl library if fd is uninitialized.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-09-26 10:41:57 -07:00
Stephen Hemminger
77219712bf Fix XFRM monitor
The change to hold open the netlink socket (for ip batch mode),
broke XFRM monitoring.

Bug report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=383133

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-09-25 17:27:37 -07:00
Andy Gay
af1b6a41d4 Fix struct alignment with cris architecture
[IPROUTE]: Fix struct alignment with cris architecture

gcc for the cris arch does not pad structures to the next multiple of 4
bytes, as the i386 gcc does.

This causes errors like this when displaying xfrm policies:

# ip x p
!!!Deficit 3, rta_len=300
src 192.168.251.32/29 dst 192.168.251.32/29
        dir in priority 0
!!!Deficit 3, rta_len=180
src 0.0.0.0/0 dst 192.168.251.32/29
        dir in priority 2208
....

Similar errors are seen from ip x s.

This patch fixes the errors when printing. I'm not sure whether we
should worry about other uses of the affected structs, I've not seen any
other bad effects from this though, so hopefully this is enough.

(Thanks to Herbert Xu for pointing out that NLMSG_SPACE is the correct
macro to use here.)

Tested against 2.6.17.6 kernel on i386, and 2.6.16.1 kernel on cris.

Signed-off-by: Andy Gay <andy@andynet.net>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-08-11 09:44:36 -07:00
Patrick McHardy
34e9564753 Add support for larger number of routing tables
[IPROUTE]: Add support for larger number of routing tables

Support support for 2^32 routing tables by using the new RTA_TABLE
attribute for specifying tables > 255 and intepreting it if it is
sent by the kernel.

When tables > 255 are used on a kernel not supporting it an error will
occur because of the unknown netlink attribute.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-08-10 16:12:07 -07:00
Patrick McHardy
bd4bcdad77 Preparation for 32 bit table IDs
[IPROUTE]: Preparation for 32 bit table IDs

The route table filter uses an integer for the table number and the value
-1 to represent cloned routes. For 32 bit table IDs it needs to become an
unsigned, so this won't work anymore. Introduce a new filter flag "cloned"
and use instead of filter.tb = -1.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-08-10 16:11:53 -07:00
Patrick McHardy
e0b29fe7dd The current behaviour for IPv6 routing table filters is to derive the
table from the route type. This doesn't really work anymore now that IPv6
supports multiple tables. Add detection for IPv6 multiple table support
(relying on the fact that the first routes dumped belong to the local table
and have rtm_table == RT_TABLE_LOCAL with multiple tables) and handle it
like other protocols.

Signed-off-by: Patrick McHardy <kaber@trash.net>
2006-08-10 13:56:13 -07:00
Stephen Hemminger
e7be3b22e8 Fix build error on Ubuntu (Debian) because of ip.h dependence
on byteorder.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-08-08 12:16:55 -07:00
Stephen Hemminger
de0a0b52a6 Another .gitignore file.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-08-08 12:11:23 -07:00
Patrick McHardy
f4f6d6407d Add support for multipath route realms 2006-08-04 10:51:01 -07:00
Stephen Hemminger
f38c733409 Cleanup mx_names table
use C99 initialization to match rtnetlink.h
2006-08-04 10:49:51 -07:00
Vince Worthington
a1f1143e8d Proposed patch to iproute to add Initial Max Congestion Window Size route tuning parameter
Vince Worthington wrote:
> Hello,
>
> We've been working with a customer of ours who was experiencing some
> latency issues, and in the process of helping them solve their problem
> we found that adding the ability to adjust the Initial Max Congestion
> Window size on a route, they were able to tune their routes to perform
> more favorably in their mixed Linux and Solaris environment.  There
> were a couple of other tuning steps necessary as well but we did find
> that the ability to set a larger initial max congestion window size
> was helpful in making Linux behave more like Solaris in low-latency
> situations.
>
> The kernel already supports this route attribute, this patch simply
> adds the option to iproute.c to provide a means to set it from userspace.
>
> I've attached the patch we used in test builds of the iproute packages
> we distribute in RHEL3 and RHEL4 for your consideration for possible
> acceptance and inclusion in iproute.  Please let us know if there is
> any further information you would need or if there is a more
> appropriate venue to submit this patch.
>
> Thanks,
> Vince Worthington
> Red Hat, Inc.

Stephen,

I apologize for the last patch I sent not applying cleanly to the latest
iproute2 sources.  I realized that this might impede any
review/acceptance of the patch and created a separate patch against the
20060323 build of iproute2, which seems to be the latest (by looking at
the website).

The previous patch wouldn't apply cleanly due to the label of the
ssthresh argument being corrected from REALMS to NUMBER.

Please let us know if there is any other information or assistance we
can be with this patch submission.

Thanks
Vince
2006-08-04 10:26:39 -07:00
Stephen Hemminger
58bb642f72 if you simply run ifcfg iface, you get:
/sbin/ifcfg: line 25: [: too many arguments
/sbin/ifcfg: line 26: [: -ge: unary operator expected
/sbin/ifcfg: line 27: [: -ge: unary operator expected
/sbin/ifcfg: line 28: [: -ge: unary operator expected

might i suggest the attached patch
-mike
2006-05-09 10:56:53 -07:00
shemminger
7b5657545d The ip(8) command has a bug when dealing with IPoIB link layer
addresses. Specifically it does not correctly handle the addition of
new entries in the neighbor/arp table. For example, this command will
fail:

ip neigh add 192.168.0.138 lladdr
00:00:04:04:fe:80:00:00:00:00:00:00:00:01:73:00:00:00:8a:91 nud
permanent dev ib0

An IPoIB link layer address is 20-bytes (see
http://www.ietf.org/internet-drafts/draft-ietf-ipoib-ip-over-infiniband-09.txt,
section 9.1.1).

The command line parsing code expects link layer addresses to be a
maximum of 16-bytes. Addresses over 16-bytes are truncated.
2006-03-21 23:57:50 +00:00
shemminger
27356a5e00 ndle DCCP in ipxfrm.c to allow using port numbers in the selector. 2006-01-12 18:31:36 +00:00
shemminger
143969f24b Add missing files. 2006-01-10 18:50:18 +00:00
shemminger
09954dc61a IP ntable support and header update. 2006-01-10 18:43:32 +00:00
shemminger
e25d697069 Backout ambigious error for ip 2005-12-02 20:02:26 +00:00
shemminger
ede723964a Add ip command aliases and better matching 2005-11-22 17:30:43 +00:00
shemminger
669ae748d6 Minor fixes from Masahide for XFRM dynamic keying 2005-11-07 18:39:30 +00:00
shemminger
c595c790a0 Fix XFRM bugs introduced by batching code.
Re-introduces the SA and policy add/del events
2005-11-01 23:03:03 +00:00
shemminger
234b613556 Fix ip command shortcuts 2005-10-24 16:26:25 +00:00
shemminger
7849fb5591 Fix memcpy overwrite in iproute.c because of bits vs. bytes confusion 2005-10-12 22:49:50 +00:00
shemminger
b77caeba0e Fix ip rule flush 2005-10-12 22:32:34 +00:00
shemminger
84616f8317 Reenable 'ip mroute' 2005-10-07 16:41:34 +00:00
shemminger
8ed63ab1f1 Fix leaks and warnings reported by valgrind. 2005-09-21 19:33:17 +00:00
shemminger
fc57a9df1b Fix ip monitor since it is special and can't reuse
rtnl_open handle.
2005-09-07 17:43:00 +00:00
shemminger
3d418dc38a Add usage for ip -batch 2005-09-01 22:29:33 +00:00
shemminger
351efcde4e Update header files to 2.6.14
Integrate support for DCCP and tcp_diag into ss
Add -batch to ip command
2005-09-01 19:21:50 +00:00
shemminger
660818498d Update include files and fix a couple of minor bugs 2005-08-16 21:10:51 +00:00
shemminger
737f15f6da Thomas's ematch fixes for lex.
Fix more GCC signedness warnings.
2005-07-08 22:08:47 +00:00
shemminger
f332d16924 Cleanup GCC4 warnings about signedness. 2005-07-05 22:37:15 +00:00
shemminger
02d2ae55c6 IPv4 multipath algorithm selection support 2005-06-23 17:31:27 +00:00
shemminger
9bec1a4363 Masahide NAKAMURA <nakam@linux-ipv6.org>
It fixes flush feature for IPsec(ip xfrm).
Jamal gave me comment about it. I've tested it on 2.6.11.7.
Please find the log below, check code and pull it:

bk://bk.skbuff.net:38000/iproute2-xfrm-flush


ChangeSet@1.182, 2005-04-13 21:19:44+09:00, nakam@linux-ipv6.org
  [ip] add "deleteall" command for xfrm;
  "flush" uses kernel's flush interface and
  "deleteall" uses legacy iproute2's flush feature like
  getting-and-deleting-for-each.
2005-06-07 21:58:25 +00:00
shemminger
90f93024a0 Monitor time patch from Masahide NAKAMURA 2005-06-07 21:55:55 +00:00
net[shemminger]!shemminger
f082b64fb4 Import patch addr-del
(Logical change 1.178)
2005-03-30 18:16:10 +00:00
linux-ipv6.org!nakam
15ac4cdc2f split printing state/policy info function for xfrm common use.
add xfrm monitor.

(Logical change 1.175)
2005-03-22 16:13:21 +00:00
linux-ipv6.org!nakam
48f1ef9f15 split printing state/policy info function for xfrm common use.
(Logical change 1.175)
2005-03-22 16:13:21 +00:00
linux-ipv6.org!nakam
56e8ad38cb split printing policy info function for xfrm common use.
(Logical change 1.175)
2005-03-22 16:13:21 +00:00
linux-ipv6.org!nakam
fb7399b2ba allocspi feature support.
support to specify sequence number.
split printing state info function for xfrm common use.

(Logical change 1.175)
2005-03-22 16:13:21 +00:00