[Click] Re: IPRewriter "nochange" inputspec syntax broken?
Eddie Kohler
kohler at cs.ucla.edu
Fri Jul 9 22:58:00 EDT 2004
Hi Erik,
This was a bug bug bug. It's fixed in CVS (as soon as it propagates); the patch
is attached. Thanks for reporting! This was totally like a model bug report,
you are my favorite person for the day.
Eddie
diff -u -u -r1.130 -r1.131
--- lib/confparse.cc 24 Jun 2004 00:04:50 -0000 1.130
+++ lib/confparse.cc 10 Jul 2004 04:56:08 -0000 1.131
@@ -63,7 +63,10 @@
bool
cp_eat_space(String &str)
{
- return str.substring(cp_skip_space(str.begin(), str.end()), str.end());
+ const char *begin = str.begin(), *end = str.end();
+ const char *space = cp_skip_space(begin, end);
+ str = str.substring(space, end);
+ return space != begin;
}
bool
Erik VandeKieft wrote:
> Is there something wrong with the IPRewriter element's "nochange"
> inputspec? I thought you're supposed to be able to specify an output port.
> When I specify one, I get an error. When I don't, it works. Here's a
> trivial example (not what I actually need to get to work, obviously, just
> meant to illustrate the syntax problem):
>
> When you specify an output port:
>
> # click -q -e 'InfiniteSource(\<0800>) -> IPRewriter(nochange 0) -> Discard'
> <expr>:1: While configuring
> 'IPRewriter at 2 :: IPRewriter':
> input spec 0: syntax error; expected `nochange [OUTPUT]'
> Router could not be initialized!
> #
>
> When you leave it blank:
>
> # click -q -e 'InfiniteSource(\<0800>) -> IPRewriter(nochange) -> Discard'
> #
>
> Am I using this element wrong?
>
> Thanks,
>
> --Erik Vandekieft
More information about the click
mailing list