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

mol modules and 2.6.9



mol-modules-source 0.9.70-8 does not compile for 2.6.9,
i've attached a little patch that fix the problem.

HTH
	Luca

-- 
BOFH excuse #372:
Forced to support NT servers; sysadmins quit.

Linux Registered User # 286841
diff -Naurp src/netdriver/sheep.c src_ORIG/netdriver/sheep.c
--- src/netdriver/sheep.c	2004-10-21 20:00:51.422903944 +0200
+++ src_ORIG/netdriver/sheep.c	2004-09-11 22:04:35.000000000 +0200
@@ -153,7 +153,7 @@ demasquerade( struct sk_buff *skb, struc
 static int 
 sheep_net_receiver( struct sk_buff *skb, struct net_device *dev, struct packet_type *pt )
 {
-	int multicast = (eth_hdr(skb)->h_dest[0] & ETH_ADDR_MULTICAST);
+	int multicast = (skb->mac.ethernet->h_dest[0] & ETH_ADDR_MULTICAST);
 	const char *laddr = dev->dev_addr;
 	struct sk_buff *skb2;
 	struct SheepVars *v = (struct SheepVars*)pt;
@@ -167,7 +167,7 @@ sheep_net_receiver( struct sk_buff *skb,
 
 		if( !multicast ) {
 			// Drop, unless this is a localhost -> MOL transmission */
-			if( addrcmp((char*)&eth_hdr(skb)->h_dest, v->fake_addr) )
+			if( addrcmp((char*)&skb->mac.ethernet->h_dest, v->fake_addr) )
 				goto drop;
 
 			/* XXX: If it were possible, we would prevent the packet from beeing sent out
@@ -178,16 +178,16 @@ sheep_net_receiver( struct sk_buff *skb,
 			 * the controller. This way, the packet ought to be discarded by
 			 * switches.
 			 */
-			cpyaddr( &eth_hdr(skb)->h_dest[0], laddr );
+			cpyaddr( &skb->mac.ethernet->h_dest[0], laddr );
 		}
 	} else {
 		// is this a packet to the local host from MOL?
-		if( !addrcmp((char*)&eth_hdr(skb)->h_source, v->fake_addr) )
+		if( !addrcmp((char*)&skb->mac.ethernet->h_source, v->fake_addr) )
 			goto drop;
 		
 		if( !multicast ) {
 			// if the packet is not meant for this host, discard it
-			if( addrcmp((char*)&eth_hdr(skb)->h_dest, laddr) )
+			if( addrcmp((char*)&skb->mac.ethernet->h_dest, laddr) )
 				goto drop;
 
 			// filter IP-traffic
@@ -215,7 +215,7 @@ sheep_net_receiver( struct sk_buff *skb,
 	skb = skb2;
 
 	if( !multicast )
-		cpyaddr( &eth_hdr(skb)->h_dest[0], v->fake_addr );
+		cpyaddr( &skb->mac.ethernet->h_dest[0], v->fake_addr );
 
 	// We also want the Ethernet header
 	skb_push( skb, skb->data - skb->mac.raw );
@@ -396,7 +396,7 @@ sheep_net_writev( struct file *f, const 
 	skb->mac.raw = skb->data;
 
 	// Base the IP-filter on the IP address of outgoing ARPs
-	if( eth_hdr(skb)->h_proto == htons(ETH_P_ARP) ) {
+	if( skb->mac.ethernet->h_proto == htons(ETH_P_ARP) ) {
 		char *s = &skb->data[14+14];	/* source IP-address */
 		int n[4];
 		if( *(long*)s != v->ipfilter ) {

Reply to: