StoreIPAddress::configure() bug
Vladimir Olteanu <[email protected]> Mon, 23 Sep 2013 10:36:09 +0200
| Newsgroups | gmane.network.routing.click |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --------------040106040102020804030704 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, StoreIPAddress has a bug: if the OFFSET argument is anything other than "src", configure() returns an error. I've attached a patch. Cheers, Vlad --------------040106040102020804030704 Content-Type: text/x-patch; name="storeipaddrfix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="storeipaddrfix.patch" >From 798f0f1678b43ba68c5bcbc92d34f2f40ee2de17 Mon Sep 17 00:00:00 2001 From: Vladimir Olteanu <[email protected]> Date: Mon, 23 Sep 2013 10:27:57 +0200 Subject: [PATCH] StoreIPAddress: fixed conf parsing --- elements/ip/storeipaddress.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elements/ip/storeipaddress.cc b/elements/ip/storeipaddress.cc index c63c536..ba4047f 100644 --- a/elements/ip/storeipaddress.cc +++ b/elements/ip/storeipaddress.cc @@ -49,9 +49,9 @@ StoreIPAddress::configure(Vector<String> &conf, ErrorHandler *errh) return r; if (offset.lower() == "src") _offset = -12; - else if (conf.back().lower() == "dst") + else if (offset.lower() == "dst") _offset = -16; - else if (!IntArg().parse(conf.back(), _offset) || _offset < 0) + else if (!IntArg().parse(offset, _offset) || _offset < 0) return errh->error("type mismatch: OFFSET requires integer"); return 0; } -- 1.8.1.4 --------------040106040102020804030704 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ click mailing list [email protected] https://amsterdam.lcs.mit.edu/mailman/listinfo/click --------------040106040102020804030704--