[relug] [ppc] mol modules patch 2.6.9

  • From: Luca Bigliardi - shammash <shammash@xxxxxxxxxx>
  • To: RElug <relug@xxxxxxxxxxxxx>
  • Date: Thu, 21 Oct 2004 20:39:05 +0200

ciao ragazzi,
piccola patch per compilare correttamente i moduli
di mac on linux su 2.6.9


ciao
        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 ) {

Other related posts:

  • » [relug] [ppc] mol modules patch 2.6.9