Commit 32686b9d authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://gkernel.bkbits.net/net-drivers-2.6

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 532de20c fc252a2b
...@@ -1061,23 +1061,33 @@ M: tigran@veritas.com ...@@ -1061,23 +1061,33 @@ M: tigran@veritas.com
S: Maintained S: Maintained
INTEL PRO/100 ETHERNET SUPPORT INTEL PRO/100 ETHERNET SUPPORT
P: John Ronciak
M: john.ronciak@intel.com
P: Ganesh Venkatesan
M: ganesh.venkatesan@intel.com
P: Scott Feldman P: Scott Feldman
M: scott.feldman@intel.com M: scott.feldman@intel.com
W: http://sourceforge.net/projects/e1000/
S: Supported S: Supported
INTEL PRO/1000 GIGABIT ETHERNET SUPPORT INTEL PRO/1000 GIGABIT ETHERNET SUPPORT
P: Jeb Cramer P: Jeb Cramer
M: cramerj@intel.com M: cramerj@intel.com
P: Scott Feldman P: John Ronciak
M: scott.feldman@intel.com M: john.ronciak@intel.com
P: Ganesh Venkatesan
M: ganesh.venkatesan@intel.com
W: http://sourceforge.net/projects/e1000/ W: http://sourceforge.net/projects/e1000/
S: Supported S: Supported
INTEL PRO/10GbE SUPPORT INTEL PRO/10GbE SUPPORT
P: Ayyappan Veeraiyan
M: ayyappan.veeraiyan@intel.com
P: Ganesh Venkatesan P: Ganesh Venkatesan
M: Ganesh.Venkatesan@intel.com M: ganesh.venkatesan@intel.com
P: Scott Feldman P: John Ronciak
M: scott.feldman@intel.com M: john.ronciak@intel.com
W: http://sourceforge.net/projects/e1000/
S: Supported S: Supported
INTERMEZZO FILE SYSTEM INTERMEZZO FILE SYSTEM
......
...@@ -1084,7 +1084,7 @@ void NS8390_init(struct net_device *dev, int startp) ...@@ -1084,7 +1084,7 @@ void NS8390_init(struct net_device *dev, int startp)
for(i = 0; i < 6; i++) for(i = 0; i < 6; i++)
{ {
outb_p(dev->dev_addr[i], e8390_base + EN1_PHYS_SHIFT(i)); outb_p(dev->dev_addr[i], e8390_base + EN1_PHYS_SHIFT(i));
if(inb_p(e8390_base + EN1_PHYS_SHIFT(i))!=dev->dev_addr[i]) if (ei_debug > 1 && inb_p(e8390_base + EN1_PHYS_SHIFT(i))!=dev->dev_addr[i])
printk(KERN_ERR "Hw. address read/write mismap %d\n",i); printk(KERN_ERR "Hw. address read/write mismap %d\n",i);
} }
......
...@@ -131,8 +131,19 @@ struct ei_device { ...@@ -131,8 +131,19 @@ struct ei_device {
#define inb_p(port) in_8(port) #define inb_p(port) in_8(port)
#define outb_p(val,port) out_8(port,val) #define outb_p(val,port) out_8(port,val)
#elif defined(CONFIG_ARM_ETHERH) || defined(CONFIG_ARM_ETHERH_MODULE) || \ #elif defined(CONFIG_ARM_ETHERH) || defined(CONFIG_ARM_ETHERH_MODULE)
defined(CONFIG_NET_CBUS) #define EI_SHIFT(x) (ei_local->reg_offset[x])
#undef inb
#undef inb_p
#undef outb
#undef outb_p
#define inb(_p) readb(_p)
#define outb(_v,_p) writeb(_v,_p)
#define inb_p(_p) inb(_p)
#define outb_p(_v,_p) outb(_v,_p)
#elif defined(CONFIG_NET_CBUS)
#define EI_SHIFT(x) (ei_local->reg_offset[x]) #define EI_SHIFT(x) (ei_local->reg_offset[x])
#else #else
#define EI_SHIFT(x) (x) #define EI_SHIFT(x) (x)
......
...@@ -1230,6 +1230,9 @@ config AMD8111_ETH ...@@ -1230,6 +1230,9 @@ config AMD8111_ETH
To compile this driver as a module, choose M here and read To compile this driver as a module, choose M here and read
<file:Documentation/networking/net-modules.txt>. The module <file:Documentation/networking/net-modules.txt>. The module
will be called amd8111e. will be called amd8111e.
config AMD8111E_NAPI
bool "Enable NAPI support"
depends on AMD8111_ETH
config ADAPTEC_STARFIRE config ADAPTEC_STARFIRE
tristate "Adaptec Starfire/DuraLAN support" tristate "Adaptec Starfire/DuraLAN support"
......
This diff is collapsed.
...@@ -606,7 +606,7 @@ typedef enum { ...@@ -606,7 +606,7 @@ typedef enum {
/* ipg parameters */ /* ipg parameters */
#define DEFAULT_IPG 0x60 #define DEFAULT_IPG 0x60
#define IFS1_DELTA 36 #define IFS1_DELTA 36
#define IPG_CONVERGE_JIFFIES (HZ / 2) #define IPG_CONVERGE_JIFFIES (HZ/2)
#define IPG_STABLE_TIME 5 #define IPG_STABLE_TIME 5
#define MIN_IPG 96 #define MIN_IPG 96
#define MAX_IPG 255 #define MAX_IPG 255
...@@ -790,6 +790,7 @@ struct amd8111e_priv{ ...@@ -790,6 +790,7 @@ struct amd8111e_priv{
#endif #endif
char opened; char opened;
struct net_device_stats stats; struct net_device_stats stats;
unsigned int drv_rx_errors;
struct dev_mc_list* mc_list; struct dev_mc_list* mc_list;
struct amd8111e_coalesce_conf coal_conf; struct amd8111e_coalesce_conf coal_conf;
......
...@@ -185,8 +185,6 @@ static void __exit com20020_exit(void) ...@@ -185,8 +185,6 @@ static void __exit com20020_exit(void)
#ifndef MODULE #ifndef MODULE
static int __init com20020isa_setup(char *s) static int __init com20020isa_setup(char *s)
{ {
struct net_device *dev;
struct arcnet_local *lp;
int ints[8]; int ints[8];
s = get_options(s, 8, ints); s = get_options(s, 8, ints);
......
This diff is collapsed.
...@@ -2910,7 +2910,7 @@ static void iph5526_timeout(struct net_device *dev) ...@@ -2910,7 +2910,7 @@ static void iph5526_timeout(struct net_device *dev)
{ {
struct fc_info *fi = dev->priv; struct fc_info *fi = dev->priv;
printk(KERN_WARNING "%s: timed out on send.\n", dev->name); printk(KERN_WARNING "%s: timed out on send.\n", dev->name);
fi->fc_stats.rx_dropped++; fi->fc_stats.tx_dropped++;
dev->trans_start = jiffies; dev->trans_start = jiffies;
netif_wake_queue(dev); netif_wake_queue(dev);
} }
...@@ -2953,7 +2953,7 @@ static int iph5526_send_packet(struct sk_buff *skb, struct net_device *dev) ...@@ -2953,7 +2953,7 @@ static int iph5526_send_packet(struct sk_buff *skb, struct net_device *dev)
fi->fc_stats.tx_packets++; fi->fc_stats.tx_packets++;
} }
else else
fi->fc_stats.rx_dropped++; fi->fc_stats.tx_dropped++;
dev->trans_start = jiffies; dev->trans_start = jiffies;
/* We free up the IP buffers in the OCI_interrupt handler. /* We free up the IP buffers in the OCI_interrupt handler.
* status == 0 implies that the frame was not transmitted. So the * status == 0 implies that the frame was not transmitted. So the
......
...@@ -387,7 +387,7 @@ enum register_offsets { ...@@ -387,7 +387,7 @@ enum register_offsets {
IntrStatus = 0x10, IntrStatus = 0x10,
IntrMask = 0x14, IntrMask = 0x14,
IntrEnable = 0x18, IntrEnable = 0x18,
IntrHoldoff = 0x16, /* DP83816 only */ IntrHoldoff = 0x1C, /* DP83816 only */
TxRingPtr = 0x20, TxRingPtr = 0x20,
TxConfig = 0x24, TxConfig = 0x24,
RxRingPtr = 0x30, RxRingPtr = 0x30,
......
...@@ -1022,10 +1022,11 @@ pcnet32_probe1(unsigned long ioaddr, unsigned int irq_line, int shared, ...@@ -1022,10 +1022,11 @@ pcnet32_probe1(unsigned long ioaddr, unsigned int irq_line, int shared,
* starting until the packet is loaded. Strike one for reliability, lose * starting until the packet is loaded. Strike one for reliability, lose
* one for latency - although on PCI this isnt a big loss. Older chips * one for latency - although on PCI this isnt a big loss. Older chips
* have FIFO's smaller than a packet, so you can't do this. * have FIFO's smaller than a packet, so you can't do this.
* Turn on BCR18:BurstRdEn and BCR18:BurstWrEn.
*/ */
if (fset) { if (fset) {
a->write_bcr(ioaddr, 18, (a->read_bcr(ioaddr, 18) | 0x0800)); a->write_bcr(ioaddr, 18, (a->read_bcr(ioaddr, 18) | 0x0860));
a->write_csr(ioaddr, 80, (a->read_csr(ioaddr, 80) & 0x0C00) | 0x0c00); a->write_csr(ioaddr, 80, (a->read_csr(ioaddr, 80) & 0x0C00) | 0x0c00);
dxsuflo = 1; dxsuflo = 1;
ltint = 1; ltint = 1;
......
...@@ -28,10 +28,10 @@ ...@@ -28,10 +28,10 @@
Linux kernel version history: Linux kernel version history:
LK1.1.0: LK1.1.0:
- Jeff Garzik: softnet 'n stuff - Jeff Garzik: softnet 'n stuff
LK1.1.1: LK1.1.1:
- Justin Guyett: softnet and locking fixes - Justin Guyett: softnet and locking fixes
- Jeff Garzik: use PCI interface - Jeff Garzik: use PCI interface
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
LK1.1.6: LK1.1.6:
- Urban Widmark: merges from Beckers 1.08b version (VT6102 + mdio) - Urban Widmark: merges from Beckers 1.08b version (VT6102 + mdio)
set netif_running_on/off on startup, del_timer_sync set netif_running_on/off on startup, del_timer_sync
LK1.1.7: LK1.1.7:
- Manfred Spraul: added reset into tx_timeout - Manfred Spraul: added reset into tx_timeout
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
LK1.1.13 (jgarzik): LK1.1.13 (jgarzik):
- Add ethtool support - Add ethtool support
- Replace some MII-related magic numbers with constants - Replace some MII-related magic numbers with constants
LK1.1.14 (Ivan G.): LK1.1.14 (Ivan G.):
- fixes comments for Rhine-III - fixes comments for Rhine-III
- removes W_MAX_TIMEOUT (unused) - removes W_MAX_TIMEOUT (unused)
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
- sends chip_id as a parameter to wait_for_reset since np is not - sends chip_id as a parameter to wait_for_reset since np is not
initialized on first call initialized on first call
- changes mmio "else if (chip_id==VT6102)" to "else" so it will work - changes mmio "else if (chip_id==VT6102)" to "else" so it will work
for Rhine-III's (documentation says same bit is correct) for Rhine-III's (documentation says same bit is correct)
- transmit frame queue message is off by one - fixed - transmit frame queue message is off by one - fixed
- adds IntrNormalSummary to "Something Wicked" exclusion list - adds IntrNormalSummary to "Something Wicked" exclusion list
so normal interrupts will not trigger the message (src: Donald Becker) so normal interrupts will not trigger the message (src: Donald Becker)
...@@ -316,10 +316,10 @@ IIId. Synchronization ...@@ -316,10 +316,10 @@ IIId. Synchronization
The driver runs as two independent, single-threaded flows of control. One The driver runs as two independent, single-threaded flows of control. One
is the send-packet routine, which enforces single-threaded use by the is the send-packet routine, which enforces single-threaded use by the
dev->priv->lock spinlock. The other thread is the interrupt handler, which dev->priv->lock spinlock. The other thread is the interrupt handler, which
is single threaded by the hardware and interrupt handling software. is single threaded by the hardware and interrupt handling software.
The send packet thread has partial control over the Tx ring. It locks the The send packet thread has partial control over the Tx ring. It locks the
dev->priv->lock whenever it's queuing a Tx packet. If the next slot in the ring dev->priv->lock whenever it's queuing a Tx packet. If the next slot in the ring
is not available it stops the transmit queue by calling netif_stop_queue. is not available it stops the transmit queue by calling netif_stop_queue.
...@@ -639,7 +639,7 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev, ...@@ -639,7 +639,7 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
#ifdef USE_MEM #ifdef USE_MEM
long ioaddr0; long ioaddr0;
#endif #endif
/* when built into the kernel, we only print version if device is found */ /* when built into the kernel, we only print version if device is found */
#ifndef MODULE #ifndef MODULE
static int printed_version; static int printed_version;
...@@ -660,7 +660,7 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev, ...@@ -660,7 +660,7 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
printk(KERN_ERR "32-bit PCI DMA addresses not supported by the card!?\n"); printk(KERN_ERR "32-bit PCI DMA addresses not supported by the card!?\n");
goto err_out; goto err_out;
} }
/* sanity check */ /* sanity check */
if ((pci_resource_len (pdev, 0) < io_size) || if ((pci_resource_len (pdev, 0) < io_size) ||
(pci_resource_len (pdev, 1) < io_size)) { (pci_resource_len (pdev, 1) < io_size)) {
...@@ -681,7 +681,7 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev, ...@@ -681,7 +681,7 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
} }
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev); SET_NETDEV_DEV(dev, &pdev->dev);
if (pci_request_regions(pdev, shortname)) if (pci_request_regions(pdev, shortname))
goto err_out_free_netdev; goto err_out_free_netdev;
...@@ -847,6 +847,8 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev, ...@@ -847,6 +847,8 @@ static int __devinit via_rhine_init_one (struct pci_dev *pdev,
netif_carrier_on(dev); netif_carrier_on(dev);
else else
netif_carrier_off(dev); netif_carrier_off(dev);
break;
} }
} }
np->mii_cnt = phy_idx; np->mii_cnt = phy_idx;
...@@ -891,7 +893,7 @@ static int alloc_ring(struct net_device* dev) ...@@ -891,7 +893,7 @@ static int alloc_ring(struct net_device* dev)
void *ring; void *ring;
dma_addr_t ring_dma; dma_addr_t ring_dma;
ring = pci_alloc_consistent(np->pdev, ring = pci_alloc_consistent(np->pdev,
RX_RING_SIZE * sizeof(struct rx_desc) + RX_RING_SIZE * sizeof(struct rx_desc) +
TX_RING_SIZE * sizeof(struct tx_desc), TX_RING_SIZE * sizeof(struct tx_desc),
&ring_dma); &ring_dma);
...@@ -903,7 +905,7 @@ static int alloc_ring(struct net_device* dev) ...@@ -903,7 +905,7 @@ static int alloc_ring(struct net_device* dev)
np->tx_bufs = pci_alloc_consistent(np->pdev, PKT_BUF_SZ * TX_RING_SIZE, np->tx_bufs = pci_alloc_consistent(np->pdev, PKT_BUF_SZ * TX_RING_SIZE,
&np->tx_bufs_dma); &np->tx_bufs_dma);
if (np->tx_bufs == NULL) { if (np->tx_bufs == NULL) {
pci_free_consistent(np->pdev, pci_free_consistent(np->pdev,
RX_RING_SIZE * sizeof(struct rx_desc) + RX_RING_SIZE * sizeof(struct rx_desc) +
TX_RING_SIZE * sizeof(struct tx_desc), TX_RING_SIZE * sizeof(struct tx_desc),
ring, ring_dma); ring, ring_dma);
...@@ -923,7 +925,7 @@ void free_ring(struct net_device* dev) ...@@ -923,7 +925,7 @@ void free_ring(struct net_device* dev)
{ {
struct netdev_private *np = dev->priv; struct netdev_private *np = dev->priv;
pci_free_consistent(np->pdev, pci_free_consistent(np->pdev,
RX_RING_SIZE * sizeof(struct rx_desc) + RX_RING_SIZE * sizeof(struct rx_desc) +
TX_RING_SIZE * sizeof(struct tx_desc), TX_RING_SIZE * sizeof(struct tx_desc),
np->rx_ring, np->rx_ring_dma); np->rx_ring, np->rx_ring_dma);
...@@ -948,7 +950,7 @@ static void alloc_rbufs(struct net_device *dev) ...@@ -948,7 +950,7 @@ static void alloc_rbufs(struct net_device *dev)
np->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32); np->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32);
np->rx_head_desc = &np->rx_ring[0]; np->rx_head_desc = &np->rx_ring[0];
next = np->rx_ring_dma; next = np->rx_ring_dma;
/* Init the ring entries */ /* Init the ring entries */
for (i = 0; i < RX_RING_SIZE; i++) { for (i = 0; i < RX_RING_SIZE; i++) {
np->rx_ring[i].rx_status = 0; np->rx_ring[i].rx_status = 0;
...@@ -1151,7 +1153,7 @@ static int via_rhine_open(struct net_device *dev) ...@@ -1151,7 +1153,7 @@ static int via_rhine_open(struct net_device *dev)
if (debug > 1) if (debug > 1)
printk(KERN_DEBUG "%s: via_rhine_open() irq %d.\n", printk(KERN_DEBUG "%s: via_rhine_open() irq %d.\n",
dev->name, np->pdev->irq); dev->name, np->pdev->irq);
i = alloc_ring(dev); i = alloc_ring(dev);
if (i) if (i)
return i; return i;
...@@ -1266,7 +1268,7 @@ static void via_rhine_tx_timeout (struct net_device *dev) ...@@ -1266,7 +1268,7 @@ static void via_rhine_tx_timeout (struct net_device *dev)
/* Reinitialize the hardware. */ /* Reinitialize the hardware. */
wait_for_reset(dev, np->chip_id, dev->name); wait_for_reset(dev, np->chip_id, dev->name);
init_registers(dev); init_registers(dev);
spin_unlock(&np->lock); spin_unlock(&np->lock);
enable_irq(np->pdev->irq); enable_irq(np->pdev->irq);
...@@ -1316,7 +1318,7 @@ static int via_rhine_start_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -1316,7 +1318,7 @@ static int via_rhine_start_tx(struct sk_buff *skb, struct net_device *dev)
np->tx_ring[entry].addr = cpu_to_le32(np->tx_skbuff_dma[entry]); np->tx_ring[entry].addr = cpu_to_le32(np->tx_skbuff_dma[entry]);
} }
np->tx_ring[entry].desc_length = np->tx_ring[entry].desc_length =
cpu_to_le32(TXDESC | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN)); cpu_to_le32(TXDESC | (skb->len >= ETH_ZLEN ? skb->len : ETH_ZLEN));
/* lock eth irq */ /* lock eth irq */
...@@ -1364,7 +1366,7 @@ static irqreturn_t via_rhine_interrupt(int irq, void *dev_instance, struct pt_re ...@@ -1364,7 +1366,7 @@ static irqreturn_t via_rhine_interrupt(int irq, void *dev_instance, struct pt_re
int handled = 0; int handled = 0;
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
while ((intr_status = get_intr_status(dev))) { while ((intr_status = get_intr_status(dev))) {
handled = 1; handled = 1;
...@@ -1584,7 +1586,7 @@ static void via_rhine_rx(struct net_device *dev) ...@@ -1584,7 +1586,7 @@ static void via_rhine_rx(struct net_device *dev)
break; /* Better luck next round. */ break; /* Better luck next round. */
skb->dev = dev; /* Mark as being used by this device. */ skb->dev = dev; /* Mark as being used by this device. */
np->rx_skbuff_dma[entry] = np->rx_skbuff_dma[entry] =
pci_map_single(np->pdev, skb->tail, np->rx_buf_sz, pci_map_single(np->pdev, skb->tail, np->rx_buf_sz,
PCI_DMA_FROMDEVICE); PCI_DMA_FROMDEVICE);
np->rx_ring[entry].addr = cpu_to_le32(np->rx_skbuff_dma[entry]); np->rx_ring[entry].addr = cpu_to_le32(np->rx_skbuff_dma[entry]);
} }
...@@ -1892,7 +1894,7 @@ static int via_rhine_close(struct net_device *dev) ...@@ -1892,7 +1894,7 @@ static int via_rhine_close(struct net_device *dev)
static void __devexit via_rhine_remove_one (struct pci_dev *pdev) static void __devexit via_rhine_remove_one (struct pci_dev *pdev)
{ {
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
unregister_netdev(dev); unregister_netdev(dev);
pci_release_regions(pdev); pci_release_regions(pdev);
......
...@@ -42,13 +42,14 @@ struct divert_blk; ...@@ -42,13 +42,14 @@ struct divert_blk;
struct vlan_group; struct vlan_group;
struct ethtool_ops; struct ethtool_ops;
/* source back-compat hook */ /* source back-compat hooks */
#define SET_ETHTOOL_OPS(netdev,ops) \ #define SET_ETHTOOL_OPS(netdev,ops) \
( (netdev)->ethtool_ops = (ops) ) ( (netdev)->ethtool_ops = (ops) )
#define HAVE_ALLOC_NETDEV /* feature macro: alloc_xxxdev #define HAVE_ALLOC_NETDEV /* feature macro: alloc_xxxdev
functions are available. */ functions are available. */
#define HAVE_FREE_NETDEV #define HAVE_FREE_NETDEV /* free_netdev() */
#define HAVE_NETDEV_PRIV /* netdev_priv() */
#define NET_XMIT_SUCCESS 0 #define NET_XMIT_SUCCESS 0
#define NET_XMIT_DROP 1 /* skb dropped */ #define NET_XMIT_DROP 1 /* skb dropped */
......
...@@ -163,21 +163,15 @@ void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) ...@@ -163,21 +163,15 @@ void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
spin_lock(&np->dev->xmit_lock); spin_lock(&np->dev->xmit_lock);
np->dev->xmit_lock_owner = smp_processor_id(); np->dev->xmit_lock_owner = smp_processor_id();
if (netif_queue_stopped(np->dev)) {
np->dev->xmit_lock_owner = -1;
spin_unlock(&np->dev->xmit_lock);
netpoll_poll(np);
goto repeat;
}
status = np->dev->hard_start_xmit(skb, np->dev); status = np->dev->hard_start_xmit(skb, np->dev);
np->dev->xmit_lock_owner = -1; np->dev->xmit_lock_owner = -1;
spin_unlock(&np->dev->xmit_lock); spin_unlock(&np->dev->xmit_lock);
/* transmit busy */ /* transmit busy */
if(status) if(status) {
netpoll_poll(np);
goto repeat; goto repeat;
}
} }
void netpoll_send_udp(struct netpoll *np, const char *msg, int len) void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
...@@ -231,9 +225,8 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len) ...@@ -231,9 +225,8 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
static void arp_reply(struct sk_buff *skb) static void arp_reply(struct sk_buff *skb)
{ {
struct in_device *in_dev = (struct in_device *) skb->dev->ip_ptr;
struct arphdr *arp; struct arphdr *arp;
unsigned char *arp_ptr, *sha, *tha; unsigned char *arp_ptr;
int size, type = ARPOP_REPLY, ptype = ETH_P_ARP; int size, type = ARPOP_REPLY, ptype = ETH_P_ARP;
u32 sip, tip; u32 sip, tip;
struct sk_buff *send_skb; struct sk_buff *send_skb;
...@@ -253,7 +246,7 @@ static void arp_reply(struct sk_buff *skb) ...@@ -253,7 +246,7 @@ static void arp_reply(struct sk_buff *skb)
if (!np) return; if (!np) return;
/* No arp on this interface */ /* No arp on this interface */
if (!in_dev || skb->dev->flags & IFF_NOARP) if (skb->dev->flags & IFF_NOARP)
return; return;
if (!pskb_may_pull(skb, (sizeof(struct arphdr) + if (!pskb_may_pull(skb, (sizeof(struct arphdr) +
...@@ -270,21 +263,15 @@ static void arp_reply(struct sk_buff *skb) ...@@ -270,21 +263,15 @@ static void arp_reply(struct sk_buff *skb)
arp->ar_op != htons(ARPOP_REQUEST)) arp->ar_op != htons(ARPOP_REQUEST))
return; return;
arp_ptr= (unsigned char *)(arp+1); arp_ptr = (unsigned char *)(arp+1) + skb->dev->addr_len;
sha = arp_ptr;
arp_ptr += skb->dev->addr_len;
memcpy(&sip, arp_ptr, 4); memcpy(&sip, arp_ptr, 4);
arp_ptr += 4; arp_ptr += 4 + skb->dev->addr_len;
tha = arp_ptr;
arp_ptr += skb->dev->addr_len;
memcpy(&tip, arp_ptr, 4); memcpy(&tip, arp_ptr, 4);
/* Should we ignore arp? */ /* Should we ignore arp? */
if (tip != in_dev->ifa_list->ifa_address || if (tip != htonl(np->local_ip) || LOOPBACK(tip) || MULTICAST(tip))
LOOPBACK(tip) || MULTICAST(tip))
return; return;
size = sizeof(struct arphdr) + 2 * (skb->dev->addr_len + 4); size = sizeof(struct arphdr) + 2 * (skb->dev->addr_len + 4);
send_skb = find_skb(np, size + LL_RESERVED_SPACE(np->dev), send_skb = find_skb(np, size + LL_RESERVED_SPACE(np->dev),
LL_RESERVED_SPACE(np->dev)); LL_RESERVED_SPACE(np->dev));
...@@ -325,7 +312,7 @@ static void arp_reply(struct sk_buff *skb) ...@@ -325,7 +312,7 @@ static void arp_reply(struct sk_buff *skb)
arp_ptr += np->dev->addr_len; arp_ptr += np->dev->addr_len;
memcpy(arp_ptr, &tip, 4); memcpy(arp_ptr, &tip, 4);
arp_ptr += 4; arp_ptr += 4;
memcpy(arp_ptr, np->local_mac, np->dev->addr_len); memcpy(arp_ptr, np->remote_mac, np->dev->addr_len);
arp_ptr += np->dev->addr_len; arp_ptr += np->dev->addr_len;
memcpy(arp_ptr, &sip, 4); memcpy(arp_ptr, &sip, 4);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment