Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Quagga: Dev

[PATCH] lib: make IPv6 prefix parser slightly more strict

 

 

Quagga dev RSS feed   Index | Next | Previous | View Threaded


equinox at opensourcerouting

Jul 19, 2012, 7:26 AM

Post #1 of 3 (273 views)
Permalink
[PATCH] lib: make IPv6 prefix parser slightly more strict

This makes it possible to have both "show babel route A.B.C.D/M"
and "show babel route X:X::X:X/M" commands at the same time without
the parser complaining about ambiguity.

* lib/command.c: only accept STATE_DOT after : was seen.

Reported-by: Juliusz Chroboczek <jch [at] pps>
Signed-off-by: David Lamparter <equinox [at] opensourcerouting>
---
Simpler version...

Note that cmd_ipv6_match uses inet_pton on master; I think I might've broken
partly_match support there... need to re-check that.

-David
---
lib/command.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/lib/command.c b/lib/command.c
index 4d95e92..64563b5 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -954,7 +954,12 @@ cmd_ipv6_prefix_match (const char *str)
if (*(str + 1) == ':')
state = STATE_COLON;
else if (*(str + 1) == '.')
- state = STATE_DOT;
+ {
+ if (colons || double_colon)
+ state = STATE_DOT;
+ else
+ return no_match;
+ }
else if (*(str + 1) == '/')
state = STATE_SLASH;
}
--
1.7.8.6

_______________________________________________
Quagga-dev mailing list
Quagga-dev [at] lists
http://lists.quagga.net/mailman/listinfo/quagga-dev


jch at pps

Jul 19, 2012, 5:49 PM

Post #2 of 3 (257 views)
Permalink
Re: [PATCH] lib: make IPv6 prefix parser slightly more strict [In reply to]

> This makes it possible to have both "show babel route A.B.C.D/M"
> and "show babel route X:X::X:X/M" commands at the same time without
> the parser complaining about ambiguity.
>
> * lib/command.c: only accept STATE_DOT after : was seen.

And what about cmd_ipv6_match ?

-- Juliusz
_______________________________________________
Quagga-dev mailing list
Quagga-dev [at] lists
http://lists.quagga.net/mailman/listinfo/quagga-dev


equinox at opensourcerouting

Jul 23, 2012, 8:55 AM

Post #3 of 3 (250 views)
Permalink
Re: [PATCH] lib: make IPv6 prefix parser slightly more strict [In reply to]

On Fri, Jul 20, 2012 at 02:49:33AM +0200, Juliusz Chroboczek wrote:
> > This makes it possible to have both "show babel route A.B.C.D/M"
> > and "show babel route X:X::X:X/M" commands at the same time without
> > the parser complaining about ambiguity.
> >
> > * lib/command.c: only accept STATE_DOT after : was seen.
>
> And what about cmd_ipv6_match ?

I'm looking at it, but since the code was changed inbetween by Roman's
patch (for similar reasons to yours), your patch doesn't apply anymore.

It's on the TODO list, after other stuff from the backlog.

-David
Attachments: signature.asc (0.22 KB)

Quagga dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.