functions.m4: Correctly clear `to' network field in packet mark.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 11 Dec 2012 10:23:42 +0000 (10:23 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 11 Dec 2012 10:26:23 +0000 (10:26 +0000)
I thibk this worked before anyway, but it's good to fix it properly.

functions.m4

index d7b42b2..f75d16e 100644 (file)
@@ -427,9 +427,9 @@ defnetclass () {
        from=$(( $from + $bit ))
       done
       to=$(( ($netclassindex << $BIT_TO) ))
-      tomask=$(( $MASK_MASK ^ (1 << ($netclassindex + $BIT_MASK)) ))
+      tomask=$(( $MASK_TO | $MASK_MASK ^ (1 << ($netclassindex + $BIT_MASK)) ))
       trace "from $name --> set $(printf %08x/%08x $from $frommask)"
-      trace "  to $name --> and $(printf %08x/%08x $to $tomask)"
+      trace "  to $name --> set $(printf %08x/%08x $to $tomask)"
 
       ## Now establish the mark-from-NAME and mark-to-NAME chains.
       clearchain mangle:mark-from-$name mangle:mark-to-$name