--- sheep.c 2004-03-27 21:04:35.000000000 +1000 +++ sheep.c.wade 2004-10-27 19:37:04.472232256 +1000 @@ -151,7 +151,8 @@ static int sheep_net_receiver( struct sk_buff *skb, struct net_device *dev, struct packet_type *pt ) { - int multicast = (skb->mac.ethernet->h_dest[0] & ETH_ADDR_MULTICAST); + int multicast = ( eth_hdr(skb)->h_dest[0] & ETH_ADDR_MULTICAST); + const char *laddr = dev->dev_addr; struct sk_buff *skb2; struct SheepVars *v = (struct SheepVars*)pt; @@ -165,7 +166,7 @@ if( !multicast ) { // Drop, unless this is a localhost -> MOL transmission */ - if( addrcmp((char*)&skb->mac.ethernet->h_dest, v->fake_addr) ) + if( addrcmp((char*)ð_hdr(skb)->h_dest, v->fake_addr) ) goto drop; /* XXX: If it were possible, we would prevent the packet from beeing sent out @@ -176,16 +177,16 @@ * the controller. This way, the packet ought to be discarded by * switches. */ - cpyaddr( &skb->mac.ethernet->h_dest[0], laddr ); + cpyaddr( ð_hdr(skb)->h_dest[0], laddr ); } } else { // is this a packet to the local host from MOL? - if( !addrcmp((char*)&skb->mac.ethernet->h_source, v->fake_addr) ) + if( !addrcmp((char*)ð_hdr(skb)->h_source , v->fake_addr) ) goto drop; if( !multicast ) { // if the packet is not meant for this host, discard it - if( addrcmp((char*)&skb->mac.ethernet->h_dest, laddr) ) + if( addrcmp((char*)ð_hdr(skb)->h_dest, laddr) ) goto drop; // filter IP-traffic @@ -213,7 +214,7 @@ skb = skb2; if( !multicast ) - cpyaddr( &skb->mac.ethernet->h_dest[0], v->fake_addr ); + cpyaddr( ð_hdr(skb)->h_dest[0], v->fake_addr ); // We also want the Ethernet header skb_push( skb, skb->data - skb->mac.raw ); @@ -394,7 +395,7 @@ skb->mac.raw = skb->data; // Base the IP-filter on the IP address of outgoing ARPs - if( skb->mac.ethernet->h_proto == htons(ETH_P_ARP) ) { + if( eth_hdr(skb)->h_proto == htons(ETH_P_ARP) ) { char *s = &skb->data[14+14]; /* source IP-address */ int n[4]; if( *(long*)s != v->ipfilter ) {