https://redmine.pfsense.org/https://redmine.pfsense.org/favicon.ico?16780521162014-11-09T21:26:48ZpfSense bugtrackerpfSense - Bug #3998: Duplicated limiter numbershttps://redmine.pfsense.org/issues/3998?journal_id=155902014-11-09T21:26:48ZPhillip Davisphil@jankaritech.com
<ul></ul><p>On 2.2 I tried adding a few limiters and children and then deleting ones in the middle of the list... It seems that current code rewrites the limiter numbers after each delete/disable so that there is no gap. Actually those numbers do not seem to be in the config like that anyway, they are generated on the fly. I was executing this bit of code to see what was happening to the numbers:<br /> include_once("shaper.inc");<br /> read_dummynet_config();<br /> $nextnum = dnqueue_find_nextnumber();<br /> var_dump($nextnum);</p>
<pre><code>$dnused = array();<br /> if (is_array($dummynet_pipe_list)) {<br /> foreach ($dummynet_pipe_list as $dn) {<br /> $tmplist =& $dn->get_queue_list();<br /> foreach ($tmplist as $qname => $link) {<br /> var_dump($qname);<br /> var_dump($link);<br /> if ($link[0] == "?")<br /> $dnused[$qname] = substr($link, 1);<br /> }<br /> }<br /> }<br /> var_dump($dnused);</code></pre>
<p>And ended up with this result:<br /> int(3)<br /> string(9) "MyLimiter" <br /> string(1) "1" <br /> string(4) "MyL2" <br /> string(1) "2" <br /> string(5) "Lim21" <br /> string(2) "?1" <br /> string(4) "Lim3" <br /> string(1) "3" <br /> string(5) "Lim31" <br /> string(2) "?2" <br /> array(2) {<br /> ["Lim21"]=><br /> string(1) "1" <br /> ["Lim31"]=><br /> string(1) "2" <br /> }</p>
<p>And during the testing I had the last array with more entries in it, always with numbers "1" "2" "3" ... in order.<br />So I suspect that is why not everyone is seeing this bug. It only happens if you somehow have a limiter config that gets gaps in it.<br />In any case, if there is a gap, the code does not fill it in correctly, as you point out. The fix you suggest looks the right thing to do.<br />You could go to <a class="external" href="https://github.com/pfsense/pfsense">https://github.com/pfsense/pfsense</a> and make the change and submit a pull request - it is very easy to do online for small changes like this.</p> pfSense - Bug #3998: Duplicated limiter numbershttps://redmine.pfsense.org/issues/3998?journal_id=156642014-11-13T06:20:12ZRenato Botelhorenato@netgate.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Feedback</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset <a class="changeset" title="Fix logic to find available next number for limiters and queues. It fixes #3998" href="https://redmine.pfsense.org/projects/pfsense/repository/2/revisions/89cf3dc0b6958322974d40fd1111ef276174053e">89cf3dc0b6958322974d40fd1111ef276174053e</a>.</p> pfSense - Bug #3998: Duplicated limiter numbershttps://redmine.pfsense.org/issues/3998?journal_id=156652014-11-13T06:20:12ZRenato Botelhorenato@netgate.com
<ul></ul><p>Applied in changeset <a class="changeset" title="Fix logic to find available next number for limiters and queues. It fixes #3998" href="https://redmine.pfsense.org/projects/pfsense/repository/2/revisions/8105ffa61c2d5aba42fa0ceac92ae7f9f80f8b19">8105ffa61c2d5aba42fa0ceac92ae7f9f80f8b19</a>.</p> pfSense - Bug #3998: Duplicated limiter numbershttps://redmine.pfsense.org/issues/3998?journal_id=157132014-11-16T15:14:08ZChris Buechlercbuechler@gmail.com
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Resolved</i></li></ul><p>fixed</p>