tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: NPF issue with inet6($if) vs. ifaddrs($if)



anthony.mallet%laas.fr@localhost (Anthony Mallet) writes:

>Nice catch, thanks! The bytecode for inet6($ifgw) looks the same as
>what you posted in kern/55403: it jumps to the rest of the rule
>matching as soon as one byte of the address matches :/

>For the ifaddrs($ifgw) the bytecode uses "unimp 0x27". I'm not sure
>what this means, but this seems to behave correctly at least.

BPF_MISC 0x07
BPF_COP  0x20

That's a "co-processor instruction", in this case used for
a table lookup.

   BPF_STMT(BPF_MISC+BPF_COP, NPF_COP_TABLE), 

ifaddrs() works by creating a small table that you can search
for an interface address. A compiled match (inet6()) can only
work for static addresses.



Home | Main Index | Thread Index | Old Index