switch dymmynet from mbuf based tagging to m_tag

Sepherosa Ziehau sepherosa at gmail.com
Sun Oct 21 23:18:53 PDT 2007

On 10/22/07, Matthew Dillon <dillon at apollo.backplane.com> wrote:
> :Hi all,
> :
> :Followin patcch switches dymmynet from mbuf based tagging to m_tag:
> :http://leaf.dragonflybsd.org/~sephe/dummynet_mtag.diff
> :
> :Please review it.  If no objection comes, it will committed three days later.
> :
> :Best Regards,
> :sephe
>      I didn't test it but it looks like a nice cleanup.  I do have one
>      concern, and that is the 'rule' is being referenced in the mtag
>      (and was referenced in the mbuf originally as well)... what happens
>      if the rule is deleted while there are packets in transit referencing
>      it?

Hmm, that's problematic.  How about fixing it in following way:
1) add a key field to ipfw rule (e.g. random number when rule was created)
2) hash ipfw rules using above key, mainly to accelerate the following
ipfw rule looking up
3) when recording ipfw rule address in dummynet m_tag, the key of the
ipfw rule is recorded in a seperate field in dummynet m_tag too
4) in ipfw_chk(), we try finding the rule using the key recorded in
dummynet m_tag, and compare the found ipfw rule address with the ipfw
rule address recorded in dummynet m_tag, if they match then the rule
is not deleted

But I think that's a different problem than what the above patch
intends to address, so I don't want to fix them in one patch :)

Best Regards,

Live Free or Die

More information about the Submit mailing list