Skip to contentSkip to conversation

fix for ISDN ippp filtering

PATCH Karsten Keil 2 participants 3 messages Apr 21, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

We do not longer use DLT_LINUX_SLL for activ/pass filters but DLT_PPP_WITHDIRECTION witch need 1 as outbound flag.
Please apply.

drivers/isdn/i4l/isdn_ppp.c +5 -5
diff -urN linux-2.6.12-rc2.org/drivers/isdn/i4l/isdn_ppp.c linux-2.6.12-rc2/drivers/isdn/i4l/isdn_ppp.c
@@ -1151,7 +1151,7 @@
 	{
 		u_int16_t *p = (u_int16_t *) skb->data;
 
-		*p = 0;	/* indicate inbound in DLT_LINUX_SLL */
+		*p = 0;	/* indicate inbound */
 	}
 
 	if (is->pass_filter
@@ -1293,12 +1293,12 @@
 	/* check if we should pass this packet
 	 * the filter instructions are constructed assuming
 	 * a four-byte PPP header on each packet */
-	skb_push(skb, 4);
+	*skb_push(skb, 4) = 1; /* indicate outbound */
 
 	{
 		u_int16_t *p = (u_int16_t *) skb->data;
 
-		*p++ = htons(4); /* indicate outbound in DLT_LINUX_SLL */
+		p++;
 		*p   = htons(proto);
 	}
 
@@ -1491,12 +1491,12 @@
 	 * temporarily remove part of the fake header stuck on
 	 * earlier.
 	 */
-	skb_pull(skb, IPPP_MAX_HEADER - 4);
+	*skb_pull(skb, IPPP_MAX_HEADER - 4) = 1; /* indicate outbound */
 
 	{
 		u_int16_t *p = (u_int16_t *) skb->data;
 
-		*p++ = htons(4);	/* indicate outbound in DLT_LINUX_SLL */
+		p++;
 		*p   = htons(proto);
 	}
 	
Signature · 3 lines
Karsten Keil
SuSE Labs
ISDN development
#1 lore raw
Quoted 5 lines · Karsten Keil

Hi,

We do not longer use DLT_LINUX_SLL for activ/pass filters but DLT_PPP_WITHDIRECTION witch need 1 as outbound flag.
Please apply.

Won't this break compatibility with old ipppd binaries?

Regards
Patrick

#2 lore raw
Quoted 10 lines · Patrick McHardy
Quoted 6 lines · Karsten Keil

Hi,

We do not longer use DLT_LINUX_SLL for activ/pass filters but DLT_PPP_WITHDIRECTION
witch need 1 as outbound flag.
Please apply.

Won't this break compatibility with old ipppd binaries?

Not really, since such a version was never in our I4L CVS and never released by isdn4linux. It was my fault that this wrong temporary attempt to solve the filtering problem was pushed into the kernel. The new version is still compatible to the old filtering using DLT_PPP (with libpcap 0.7x version) with was the previous version. The DLT_LINUX_SLL solution did break compatibility and was rejected because of this for PPP, but I did miss to revert the ISDN kernel part in time, so it simple do not work today.

Signature · 3 lines
Karsten Keil
SuSE Labs
ISDN development