nomatch rule behave the same as block

Ming Fu <[email protected]>
Newsgroups gmane.comp.security.firewalls.ipfilter
Message-ID <21379_1224101055_48F64CBF_21379_7956_1_48F64BAA.6010800@borderware.com>
Hi,

I am working on FreeBSD 6.3, I compile the default rule as PASS.

the following nomatch rule blocks ICMP that matches it, the behavior is 
difference from FreeBSD 4.x where nomatch is as if the packet didn't 
match any rules.

    block in quick on vr0 proto icmp from any to 10.1.253.55
    nomatch in quick on vr0 proto icmp from any to 10.1.0.1

I added a printf just before the fr_check() is about to return. I found 
the value of pass in three difference cases:

    ping 10.1.0.2   /* this will not match any rule */
          pass value is 0x8000002    /* both pass and nomatch bit were 
set */

    ping 10.1.0.1  /* match nomatch in quick on vr0 proto icmp from any 
to 10.1.0.1 */
          pass value is 0x48008100  /* only nomatch bit was set */

    ping 10.1.253.55 /* match a block rule */
          pass value is 0x40008101  /* block is set, but nomatch and 
pass were off */

The code at finish: will drop the mbuf causing an effective block on the 
packet.
finished:
    if (!FR_ISPASS(pass)) {
        ATOMIC_INCL(frstats[out].fr_block);
        if (*mp != NULL) {
            FREE_MB_T(*mp);
            m = *mp = NULL;
        }

Anyone know if this is the desired effect?

Regards,
Ming
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.