* [ANNOUNCE] iproute2-2.6.23
@ 2007-10-16 23:44 Stephen Hemminger
2007-10-17 1:10 ` Herbert Xu
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2007-10-16 23:44 UTC (permalink / raw)
To: netdev
Now that 2.6.23 is out, and the patch storm has settled
here is a new version of iproute2
http://developer.osdl.org/dev/iproute2/download/iproute2-2.6.23.bz2
Changes since last version (v2.6.19)
Alexander Wirt (1):
Drop bogus reference to tc-filters and add lartc.org link to manpage.
Andreas Barth (1):
Remove bogus reference to tc-filters(8) from tc(8) manpage.
Andreas Henriksson (4):
Add new rtacct/nstat manpages and additional symlinks.
Fix overflow in time2tick / tick2time.
Switch helpers tc_core_{time2ktime,ktime2time} from long to unsigned as well.
Also do tc_core_time2big argument (long->unsigned).
David Lamparter (1):
iproute2: Format IPv6 tunnels endpoints nicely.
Eric Dumazet (1):
lnstat : force a flush before sleep
Johannes Berg (1):
show multicast groups
Lionel Elie Mamane (1):
Fix ematch cmp and nbyte syntax help text.
Masahide NAKAMURA (3):
ip: xfrm: Clean-up for internal mask to filter.
ip: xfrm: Fix policy and state flags.
ip: xfrm: Fix flush message.
Mike Frysinger (2):
do not ignore build failures in subdirs of iproute2
ip/routef lifesaver
Noriaki TAKAMIYA (1):
enabled to manipulate the flags of IFA_F_HOMEADDRESS or IFA_F_NODAD from ip.
PJ Waskiewicz (1):
iproute2: sch_rr support in tc
Patrick McHardy (17):
tbf: fix latency printing
Use tc_calc_xmittime() where appropriate
Introduce tc_calc_xmitsize and use where appropriate
Introduce TIME_UNITS_PER_SEC to represent internal clock resolution
Replace "usec" by "time" in function names
Add sprint_ticks() function and use in CBQ
Handle different kernel clock resolutions
Increase internal clock resolution to nsec
[Fwd: Re: more iproute2 issues (not critical)]
TC action parsing bug fix
Bug fix tc action drop
IPROUTE2: RTNETLINK nested attributes
Use FRA_* attributes for routing rules
iplink: use netlink for link configuration
Fix meta ematch usage of 0 values
vlan support
Prevent renaming interfaces to empty string.
Pavel Emelianov (2):
Make ip utility veth driver aware
Module for ip utility to support veth device (v.2.1)
Pavel Roskin (1):
ip: add support for displaying link types 802 and 803
Rick Jones (1):
rto support for ip command
Sridhar Samudrala (1):
Fix bug in display of ipv6 cloned/cached routes
Stephen Hemminger (33):
netem parameters to change command
fix tc-pfifo and tc-bfifo man pages
iptables library fix
TC bfifo man page
Use kernel headers from 2.6.20.y
Iproute2 v2.6.20-070313
Revert "Increase internal clock resolution to nsec"
Add xt_tcpudp.h
incorrect initialization
headers update to 2.6.22
fix last change
fix build warnings
netem: static
Add TC_LIB_DIR environment variable.
Snapshot update for 2.6.22
ss: fix issues with signed inodes
v2.6.22-070710
Fix ss to handle partial records.
sanitized headers update to 2.6.23-rc3
Fix m_ipt build
Revert "Make ip utility veth driver aware"
Fix modes of test files
Update kernel headers to 2.6.23-rc5
2.6.23 kernel headers
Merge 192.168.0.5:src/iproute2
don't make veth a shared library
remove outdated netbug script.
remove support for IP multipath
don't allow "" for device name
Revert "Remove bogus reference to tc-filters(8) from tc(8) manpage."
Revert "don't allow "" for device name"
Update snapshot for release
add q_rr to tc Makefile
Thomas Graf (2):
iproute2: support for goto/nop action and detached flag
iproute2: Support IFF_LOWER_UP and IFF_DORMANT
Thomas Hisch (1):
Fixes use of uninitialized string
YOSHIFUJI Hideaki / 吉藤英明 (1):
IPROUTE2: Support IPv4/IPv6 Tunnel
Yasuyuki KOZAKAI (1):
Fix symbolic link to tc-bfifo.8
jamal (5):
update rest to use nl_mgrp
nl_mgrp to crap if base multicast groups exceeded
Old bug on tc
see SAD info
see SPD info
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [ANNOUNCE] iproute2-2.6.23 2007-10-16 23:44 [ANNOUNCE] iproute2-2.6.23 Stephen Hemminger @ 2007-10-17 1:10 ` Herbert Xu 2007-10-23 6:12 ` Herbert Xu 0 siblings, 1 reply; 5+ messages in thread From: Herbert Xu @ 2007-10-17 1:10 UTC (permalink / raw) To: Stephen Hemminger; +Cc: netdev Stephen Hemminger <shemminger@linux-foundation.org> wrote: > Now that 2.6.23 is out, and the patch storm has settled > here is a new version of iproute2 Hi Stephen: Any chance you could include the NAT patch for the next release? [TC]: Add NAT action This patch adds the parser for the nat action which is used for stateless NAT. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- diff --git a/tc/Makefile b/tc/Makefile index 22cd437..cd5a69e 100644 --- a/tc/Makefile +++ b/tc/Makefile @@ -26,6 +26,7 @@ TCMODULES += q_htb.o TCMODULES += m_gact.o TCMODULES += m_mirred.o TCMODULES += m_ipt.o +TCMODULES += m_nat.o TCMODULES += m_pedit.o TCMODULES += p_ip.o TCMODULES += p_icmp.o diff --git a/tc/m_nat.c b/tc/m_nat.c new file mode 100644 index 0000000..6e7fd05 --- /dev/null +++ b/tc/m_nat.c @@ -0,0 +1,213 @@ +/* + * m_nat.c NAT module + * + * This program is free software; you can distribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Herbert Xu <herbert@gondor.apana.org.au> + * + */ + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <syslog.h> +#include <fcntl.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> +#include <string.h> +#include <dlfcn.h> +#include "utils.h" +#include "tc_util.h" +#include <linux/tc_act/tc_nat.h> + +static void +explain(void) +{ + fprintf(stderr, "Usage: ... nat NAT\n" + "NAT := DIRECTION OLD NEW\n" + "DIRECTION := { ingress | egress }\n" + "OLD := PREFIX\n" + "NEW := ADDRESS\n"); +} + +static void +usage(void) +{ + explain(); + exit(-1); +} + +static int +parse_nat_args(int *argc_p, char ***argv_p,struct tc_nat *sel) +{ + int argc = *argc_p; + char **argv = *argv_p; + inet_prefix addr; + + if (argc <= 0) + return -1; + + if (matches(*argv, "egress") == 0) + sel->flags |= TCA_NAT_FLAG_EGRESS; + else if (matches(*argv, "ingress") != 0) + goto bad_val; + + NEXT_ARG(); + + if (get_prefix_1(&addr, *argv, AF_INET)) + goto bad_val; + + sel->old_addr = addr.data[0]; + sel->mask = htonl(~0u << (32 - addr.bitlen)); + + NEXT_ARG(); + + if (get_prefix_1(&addr, *argv, AF_INET)) + goto bad_val; + + sel->new_addr = addr.data[0]; + + argc--; + argv++; + + *argc_p = argc; + *argv_p = argv; + return 0; + +bad_val: + return -1; +} + +static int +parse_nat(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, struct nlmsghdr *n) +{ + struct tc_nat sel; + + int argc = *argc_p; + char **argv = *argv_p; + int ok = 0; + struct rtattr *tail; + + memset(&sel, 0, sizeof(sel)); + + while (argc > 0) { + if (matches(*argv, "nat") == 0) { + NEXT_ARG(); + if (parse_nat_args(&argc, &argv, &sel)) { + fprintf(stderr, "Illegal nat construct (%s) \n", + *argv); + explain(); + return -1; + } + ok++; + continue; + } else if (matches(*argv, "help") == 0) { + usage(); + } else { + break; + } + + } + + if (!ok) { + explain(); + return -1; + } + + if (argc) { + if (matches(*argv, "reclassify") == 0) { + sel.action = TC_ACT_RECLASSIFY; + argc--; + argv++; + } else if (matches(*argv, "pipe") == 0) { + sel.action = TC_ACT_PIPE; + argc--; + argv++; + } else if (matches(*argv, "drop") == 0 || + matches(*argv, "shot") == 0) { + sel.action = TC_ACT_SHOT; + argc--; + argv++; + } else if (matches(*argv, "continue") == 0) { + sel.action = TC_ACT_UNSPEC; + argc--; + argv++; + } else if (matches(*argv, "pass") == 0) { + sel.action = TC_ACT_OK; + argc--; + argv++; + } + } + + if (argc) { + if (matches(*argv, "index") == 0) { + NEXT_ARG(); + if (get_u32(&sel.index, *argv, 10)) { + fprintf(stderr, "Pedit: Illegal \"index\"\n"); + return -1; + } + argc--; + argv++; + } + } + + tail = NLMSG_TAIL(n); + addattr_l(n, MAX_MSG, tca_id, NULL, 0); + addattr_l(n, MAX_MSG, TCA_NAT_PARMS, &sel, sizeof(sel)); + tail->rta_len = (char *)NLMSG_TAIL(n) - (char *)tail; + + *argc_p = argc; + *argv_p = argv; + return 0; +} + +static int +print_nat(struct action_util *au,FILE * f, struct rtattr *arg) +{ + struct tc_nat *sel; + struct rtattr *tb[TCA_NAT_MAX + 1]; + char buf1[256]; + char buf2[256]; + SPRINT_BUF(buf3); + int len; + + if (arg == NULL) + return -1; + + parse_rtattr_nested(tb, TCA_NAT_MAX, arg); + + if (tb[TCA_NAT_PARMS] == NULL) { + fprintf(f, "[NULL nat parameters]"); + return -1; + } + sel = RTA_DATA(tb[TCA_NAT_PARMS]); + + len = ffs(sel->mask); + len = len ? 33 - len : 0; + + fprintf(f, " nat %s %s/%d %s %s", sel->flags & TCA_NAT_FLAG_EGRESS ? + "egress" : "ingress", + format_host(AF_INET, 4, &sel->old_addr, buf1, sizeof(buf1)), + len, + format_host(AF_INET, 4, &sel->new_addr, buf2, sizeof(buf2)), + action_n2a(sel->action, buf3, sizeof (buf3))); + + if (show_stats) { + if (tb[TCA_NAT_TM]) { + struct tcf_t *tm = RTA_DATA(tb[TCA_NAT_TM]); + print_tm(f,tm); + } + } + + return 0; +} + +struct action_util nat_action_util = { + .id = "nat", + .parse_aopt = parse_nat, + .print_aopt = print_nat, +}; ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [ANNOUNCE] iproute2-2.6.23 2007-10-17 1:10 ` Herbert Xu @ 2007-10-23 6:12 ` Herbert Xu 2007-10-23 15:37 ` Stephen Hemminger 0 siblings, 1 reply; 5+ messages in thread From: Herbert Xu @ 2007-10-23 6:12 UTC (permalink / raw) To: Stephen Hemminger; +Cc: netdev On Wed, Oct 17, 2007 at 09:10:02AM +0800, Herbert Xu wrote: > > Any chance you could include the NAT patch for the next release? > > [TC]: Add NAT action > > This patch adds the parser for the nat action which is used > for stateless NAT. > > Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Hi Stephen: Is there a problem with merging this patch? Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ANNOUNCE] iproute2-2.6.23 2007-10-23 6:12 ` Herbert Xu @ 2007-10-23 15:37 ` Stephen Hemminger 2007-10-23 15:57 ` Herbert Xu 0 siblings, 1 reply; 5+ messages in thread From: Stephen Hemminger @ 2007-10-23 15:37 UTC (permalink / raw) To: Herbert Xu; +Cc: netdev On Tue, 23 Oct 2007 14:12:07 +0800 Herbert Xu <herbert@gondor.apana.org.au> wrote: > On Wed, Oct 17, 2007 at 09:10:02AM +0800, Herbert Xu wrote: > > > > Any chance you could include the NAT patch for the next release? > > > > [TC]: Add NAT action > > > > This patch adds the parser for the nat action which is used > > for stateless NAT. > > > > Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> > > Hi Stephen: > > Is there a problem with merging this patch? I was just holding off for a few days to see if there were any bug fixes to 2.6.23 version that needed to go in first. It is first in queue for 2.6.24 related stuff. Promise to get it in before 2.6.24-rc1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ANNOUNCE] iproute2-2.6.23 2007-10-23 15:37 ` Stephen Hemminger @ 2007-10-23 15:57 ` Herbert Xu 0 siblings, 0 replies; 5+ messages in thread From: Herbert Xu @ 2007-10-23 15:57 UTC (permalink / raw) To: Stephen Hemminger; +Cc: netdev On Tue, Oct 23, 2007 at 08:37:02AM -0700, Stephen Hemminger wrote: > > I was just holding off for a few days to see if there were any bug fixes > to 2.6.23 version that needed to go in first. It is first in queue for 2.6.24 > related stuff. > > Promise to get it in before 2.6.24-rc1 Thanks Stephen! -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-10-23 15:57 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-10-16 23:44 [ANNOUNCE] iproute2-2.6.23 Stephen Hemminger 2007-10-17 1:10 ` Herbert Xu 2007-10-23 6:12 ` Herbert Xu 2007-10-23 15:37 ` Stephen Hemminger 2007-10-23 15:57 ` Herbert Xu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox