Skip to contentSkip to conversation

ipt_CLASSIFY module

PATCH Jan Srzednicki 2 participants 2 messages Apr 21, 2003 netfilter

lore
Share & tools
lore
#0 lore raw

Hello there,

I've just checked: -j CLASSIFY works well also in mangle table, chain FORWARD (with HTB, if that matters). So I made a little fix for that:

ipt_CLASSIFY.c Mon Apr 21 15:58:12 2003 renamed from ipt_CLASSIFY.c.old Mon Apr 21 16:02:08 2003 +3 -2
@@ -39,8 +39,9 @@
                return 0;
        }
        
-       if (hook_mask & ~(1 << NF_IP_POST_ROUTING)) {
-               printk(KERN_ERR "CLASSIFY: only valid in POST_ROUTING.\n");
+       if (hook_mask & ~(1 << NF_IP_POST_ROUTING) && 
+           hook_mask & ~(1 << NF_IP_FORWARD) ) {
+               printk(KERN_ERR "CLASSIFY: only valid in POSTROUTING or FORWARD.\n");
                return 0;
        }
 

greets,

Signature · 4 lines
  -- wrzask --= v =-- Winfried --===-- GG# 3838383 ---
-- [email protected] --- [email protected] --===-- http://violent.dream.vg/ ---
--=< Ride the wild wind - push the envelope, don't sit on the fence, ---
  -- Ride the wild wind - live life on the razor's edge! >=-- Queen --
#1 lore raw

Hi Jan,
thanks for your patch ;)

My first version worked in FORWARD chain, too. The problem is LOCAL_OUT doesn't work because "skb->priority = sk->priority" line in ip_queue_xmit2. It was discussed to move it to ip_queue_xmit some time ago because Bert Huber made a similar patch but the networking maintainers didn't like it. So for consistency i decided to restrict usage to POST_ROUTING only. Harald said he would have no problem with such a change because he doesn't plan to submit the CLASSIFY target in the near future anyways, so maybe an incremental patch which enables use in FORWARD and OUTPUT chain would be ok ..

Best regards,
Patrick

Quoted 22 lines · Jan Srzednicki

Hello there,

I've just checked: -j CLASSIFY works well also in mangle table, chain FORWARD (with HTB, if that matters). So I made a little fix for that:

ipt_CLASSIFY.c Mon Apr 21 15:58:12 2003 renamed from ipt_CLASSIFY.c.old Mon Apr 21 16:02:08 2003 +3 -2
@@ -39,8 +39,9 @@
               return 0;
       }
 
-       if (hook_mask & ~(1 << NF_IP_POST_ROUTING)) {
-               printk(KERN_ERR "CLASSIFY: only valid in POST_ROUTING.\n");
+       if (hook_mask & ~(1 << NF_IP_POST_ROUTING) && 
+           hook_mask & ~(1 << NF_IP_FORWARD) ) {
+               printk(KERN_ERR "CLASSIFY: only valid in POSTROUTING or FORWARD.\n");
               return 0;
       }
 

greets,