Commit cbec8fba authored by David S. Miller's avatar David S. Miller

Merge davem@nuts.ninka.net:/home/davem/src/BK/net-2.5

into kernel.bkbits.net:/home/davem/net-2.5
parents c2e2d4f7 d171187b
...@@ -31,6 +31,11 @@ ipfrag_low_thresh - INTEGER ...@@ -31,6 +31,11 @@ ipfrag_low_thresh - INTEGER
ipfrag_time - INTEGER ipfrag_time - INTEGER
Time in seconds to keep an IP fragment in memory. Time in seconds to keep an IP fragment in memory.
ipfrag_secret_interval - INTEGER
Regeneration interval (in seconds) of the hash secret (or lifetime
for the hash secret) for IP fragments.
Default: 600
INET peer storage: INET peer storage:
inet_peer_threshold - INTEGER inet_peer_threshold - INTEGER
...@@ -515,6 +520,25 @@ bindv6only - BOOLEAN ...@@ -515,6 +520,25 @@ bindv6only - BOOLEAN
Default: FALSE (as specified in RFC2553bis) Default: FALSE (as specified in RFC2553bis)
IPv6 Fragmentation:
ip6frag_high_thresh - INTEGER
Maximum memory used to reassemble IPv6 fragments. When
ip6frag_high_thresh bytes of memory is allocated for this purpose,
the fragment handler will toss packets until ip6frag_low_thresh
is reached.
ip6frag_low_thresh - INTEGER
See ip6frag_high_thresh
ip6frag_time - INTEGER
Time in seconds to keep an IPv6 fragment in memory.
ip6frag_secret_interval - INTEGER
Regeneration interval (in seconds) of the hash secret (or lifetime
for the hash secret) for IPv6 fragments.
Default: 600
conf/default/*: conf/default/*:
Change the interface-specific default settings. Change the interface-specific default settings.
......
...@@ -304,7 +304,7 @@ static int eth_configure(int n, void *init, char *mac, ...@@ -304,7 +304,7 @@ static int eth_configure(int n, void *init, char *mac,
} }
memset(device, 0, sizeof(*device)); memset(device, 0, sizeof(*device));
device->list = INIT_LIST_HEAD(device->list); INIT_LIST_HEAD(&device->list);
device->index = n; device->index = n;
spin_lock(&devices_lock); spin_lock(&devices_lock);
...@@ -362,7 +362,7 @@ static int eth_configure(int n, void *init, char *mac, ...@@ -362,7 +362,7 @@ static int eth_configure(int n, void *init, char *mac,
return 1; return 1;
lp = dev->priv; lp = dev->priv;
lp->list = INIT_LIST_HEAD(lp->list); INIT_LIST_HEAD(&lp->list);
spin_lock_init(&lp->lock); spin_lock_init(&lp->lock);
lp->dev = dev; lp->dev = dev;
lp->fd = -1; lp->fd = -1;
...@@ -537,7 +537,7 @@ static int eth_setup(char *str) ...@@ -537,7 +537,7 @@ static int eth_setup(char *str)
return(1); return(1);
} }
new->list = INIT_LIST_HEAD(new->list); INIT_LIST_HEAD(&new->list);
new->index = n; new->index = n;
new->init = str; new->init = str;
......
...@@ -6,16 +6,12 @@ menu "Cryptographic options" ...@@ -6,16 +6,12 @@ menu "Cryptographic options"
config CRYPTO config CRYPTO
bool "Cryptographic API" bool "Cryptographic API"
default y if INET_AH=y || INET_AH=m || INET_ESP=y || INET_ESP=m || INET6_AH=y || INET6_AH=m || \
INET6_ESP=y || INET6_ESP=m || INET6_IPCOMP=y || INET6_IPCOMP=m || IPV6_PRIVACY=y
help help
This option provides the core Cryptographic API. This option provides the core Cryptographic API.
config CRYPTO_HMAC config CRYPTO_HMAC
bool "HMAC support" bool "HMAC support"
depends on CRYPTO depends on CRYPTO
default y if INET_AH=y || INET_AH=m || INET_ESP=y || INET_ESP=m || INET6_AH=y || INET6_AH=m || \
INET6_ESP=y || INET6_ESP=m
help help
HMAC: Keyed-Hashing for Message Authentication (RFC2104). HMAC: Keyed-Hashing for Message Authentication (RFC2104).
This is required for IPSec. This is required for IPSec.
...@@ -35,16 +31,12 @@ config CRYPTO_MD4 ...@@ -35,16 +31,12 @@ config CRYPTO_MD4
config CRYPTO_MD5 config CRYPTO_MD5
tristate "MD5 digest algorithm" tristate "MD5 digest algorithm"
depends on CRYPTO depends on CRYPTO
default y if INET_AH=y || INET_AH=m || INET_ESP=y || INET_ESP=m || INET6_AH=y || INET6_AH=m || \
INET6_ESP=y || INET6_ESP=m || IPV6_PRIVACY=y
help help
MD5 message digest algorithm (RFC1321). MD5 message digest algorithm (RFC1321).
config CRYPTO_SHA1 config CRYPTO_SHA1
tristate "SHA1 digest algorithm" tristate "SHA1 digest algorithm"
depends on CRYPTO depends on CRYPTO
default y if INET_AH=y || INET_AH=m || INET_ESP=y || INET_ESP=m || INET6_AH=y || INET6_AH=m || \
INET6_ESP=y || INET6_ESP=m
help help
SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2). SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2).
...@@ -72,7 +64,6 @@ config CRYPTO_SHA512 ...@@ -72,7 +64,6 @@ config CRYPTO_SHA512
config CRYPTO_DES config CRYPTO_DES
tristate "DES and Triple DES EDE cipher algorithms" tristate "DES and Triple DES EDE cipher algorithms"
depends on CRYPTO depends on CRYPTO
default y if INET_ESP=y || INET_ESP=m || INET6_ESP=y || INET6_ESP=m
help help
DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3). DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3).
...@@ -138,7 +129,6 @@ config CRYPTO_AES ...@@ -138,7 +129,6 @@ config CRYPTO_AES
config CRYPTO_DEFLATE config CRYPTO_DEFLATE
tristate "Deflate compression algorithm" tristate "Deflate compression algorithm"
depends on CRYPTO depends on CRYPTO
default y if INET_IPCOMP=y || INET_IPCOMP=m || INET6_IPCOMP=y || INET6_IPCOMP=m
help help
This is the Deflate algorithm (RFC1951), specified for use in This is the Deflate algorithm (RFC1951), specified for use in
IPSec with the IPCOMP protocol (RFC3173, RFC2394). IPSec with the IPCOMP protocol (RFC3173, RFC2394).
......
This diff is collapsed.
This diff is collapsed.
...@@ -300,17 +300,11 @@ static int nopnp; ...@@ -300,17 +300,11 @@ static int nopnp;
* *
* Both call el3_common_init/el3_common_remove. */ * Both call el3_common_init/el3_common_remove. */
static int __init el3_common_init (struct net_device *dev) static void __init el3_common_init(struct net_device *dev)
{ {
struct el3_private *lp = dev->priv; struct el3_private *lp = dev->priv;
short i; short i;
el3_cards++;
if (!lp->dev) /* probed devices are not chained */
{
lp->next_dev = el3_root_dev;
el3_root_dev = dev;
}
spin_lock_init(&lp->lock); spin_lock_init(&lp->lock);
if (dev->mem_start & 0x05) { /* xcvr codes 1/3/4/12 */ if (dev->mem_start & 0x05) { /* xcvr codes 1/3/4/12 */
...@@ -343,8 +337,6 @@ static int __init el3_common_init (struct net_device *dev) ...@@ -343,8 +337,6 @@ static int __init el3_common_init (struct net_device *dev)
dev->tx_timeout = el3_tx_timeout; dev->tx_timeout = el3_tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT; dev->watchdog_timeo = TX_TIMEOUT;
dev->do_ioctl = netdev_ioctl; dev->do_ioctl = netdev_ioctl;
return 0;
} }
static void el3_common_remove (struct net_device *dev) static void el3_common_remove (struct net_device *dev)
...@@ -374,6 +366,7 @@ static int __init el3_probe(int card_idx) ...@@ -374,6 +366,7 @@ static int __init el3_probe(int card_idx)
int ioaddr, irq, if_port; int ioaddr, irq, if_port;
u16 phys_addr[3]; u16 phys_addr[3];
static int current_tag; static int current_tag;
int err = -ENODEV;
#if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800) #if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800)
static int pnp_cards; static int pnp_cards;
struct pnp_dev *idev = NULL; struct pnp_dev *idev = NULL;
...@@ -413,7 +406,8 @@ static int __init el3_probe(int card_idx) ...@@ -413,7 +406,8 @@ static int __init el3_probe(int card_idx)
phys_addr[j] = phys_addr[j] =
htons(read_eeprom(ioaddr, j)); htons(read_eeprom(ioaddr, j));
if_port = read_eeprom(ioaddr, 8) >> 14; if_port = read_eeprom(ioaddr, 8) >> 14;
if (!(dev = init_etherdev(NULL, sizeof(struct el3_private)))) { dev = alloc_etherdev(sizeof (struct el3_private));
if (!dev) {
release_region(ioaddr, EL3_IO_EXTENT); release_region(ioaddr, EL3_IO_EXTENT);
pnp_device_detach(idev); pnp_device_detach(idev);
return -ENOMEM; return -ENOMEM;
...@@ -421,6 +415,8 @@ static int __init el3_probe(int card_idx) ...@@ -421,6 +415,8 @@ static int __init el3_probe(int card_idx)
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
pnp_cards++; pnp_cards++;
netdev_boot_setup_check(dev);
goto found; goto found;
} }
} }
...@@ -514,11 +510,14 @@ static int __init el3_probe(int card_idx) ...@@ -514,11 +510,14 @@ static int __init el3_probe(int card_idx)
irq = 13; irq = 13;
#endif #endif
if (!(dev = init_etherdev(NULL, sizeof(struct el3_private)))) dev = alloc_etherdev(sizeof (struct el3_private));
if (!dev)
return -ENOMEM; return -ENOMEM;
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
netdev_boot_setup_check(dev);
/* Set passed-in IRQ or I/O Addr. */ /* Set passed-in IRQ or I/O Addr. */
if (dev->irq > 1 && dev->irq < 16) if (dev->irq > 1 && dev->irq < 16)
irq = dev->irq; irq = dev->irq;
...@@ -527,15 +526,13 @@ static int __init el3_probe(int card_idx) ...@@ -527,15 +526,13 @@ static int __init el3_probe(int card_idx)
if (dev->mem_end == 0x3c509 /* Magic key */ if (dev->mem_end == 0x3c509 /* Magic key */
&& dev->base_addr >= 0x200 && dev->base_addr <= 0x3e0) && dev->base_addr >= 0x200 && dev->base_addr <= 0x3e0)
ioaddr = dev->base_addr & 0x3f0; ioaddr = dev->base_addr & 0x3f0;
else if (dev->base_addr != ioaddr) { else if (dev->base_addr != ioaddr)
unregister_netdev (dev); goto out;
return -ENODEV;
}
} }
if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509")) { if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509")) {
unregister_netdev (dev); err = -EBUSY;
return -EBUSY; goto out;
} }
/* Set the adaptor tag so that the next card can be found. */ /* Set the adaptor tag so that the next card can be found. */
...@@ -549,11 +546,8 @@ static int __init el3_probe(int card_idx) ...@@ -549,11 +546,8 @@ static int __init el3_probe(int card_idx)
#endif #endif
EL3WINDOW(0); EL3WINDOW(0);
if (inw(ioaddr) != 0x6d50) { if (inw(ioaddr) != 0x6d50)
unregister_netdev (dev); goto out1;
release_region(ioaddr, EL3_IO_EXTENT);
return -ENODEV;
}
/* Free the interrupt so that some other card can use it. */ /* Free the interrupt so that some other card can use it. */
outw(0x0f00, ioaddr + WN0_IRQ); outw(0x0f00, ioaddr + WN0_IRQ);
...@@ -570,6 +564,11 @@ static int __init el3_probe(int card_idx) ...@@ -570,6 +564,11 @@ static int __init el3_probe(int card_idx)
#if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800) #if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800)
lp->dev = &idev->dev; lp->dev = &idev->dev;
#endif #endif
el3_common_init(dev);
err = register_netdev(dev);
if (err)
goto out1;
#ifdef CONFIG_PM #ifdef CONFIG_PM
/* register power management */ /* register power management */
...@@ -581,7 +580,22 @@ static int __init el3_probe(int card_idx) ...@@ -581,7 +580,22 @@ static int __init el3_probe(int card_idx)
} }
#endif #endif
return el3_common_init (dev); el3_cards++;
#if !defined(__ISAPNP__) || defined(CONFIG_X86_PC9800)
lp->next_dev = el3_root_dev;
el3_root_dev = dev;
#endif
return 0;
out1:
release_region(ioaddr, EL3_IO_EXTENT);
#if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800)
if (idev)
pnp_device_detach(idev);
#endif
out:
kfree(dev);
return err;
} }
#ifdef CONFIG_MCA #ifdef CONFIG_MCA
...@@ -602,6 +616,7 @@ static int __init el3_mca_probe(struct device *device) { ...@@ -602,6 +616,7 @@ static int __init el3_mca_probe(struct device *device) {
u_char pos4, pos5; u_char pos4, pos5;
struct mca_device *mdev = to_mca_device(device); struct mca_device *mdev = to_mca_device(device);
int slot = mdev->slot; int slot = mdev->slot;
int err;
pos4 = mca_device_read_stored_pos(mdev, 4); pos4 = mca_device_read_stored_pos(mdev, 4);
pos5 = mca_device_read_stored_pos(mdev, 5); pos5 = mca_device_read_stored_pos(mdev, 5);
...@@ -630,13 +645,14 @@ static int __init el3_mca_probe(struct device *device) { ...@@ -630,13 +645,14 @@ static int __init el3_mca_probe(struct device *device) {
phys_addr[i] = htons(read_eeprom(ioaddr, i)); phys_addr[i] = htons(read_eeprom(ioaddr, i));
} }
dev = init_etherdev(NULL, sizeof(struct el3_private)); dev = alloc_etherdev(sizeof (struct el3_private));
if (dev == NULL) { if (dev == NULL) {
release_region(ioaddr, EL3_IO_EXTENT); release_region(ioaddr, EL3_IO_EXTENT);
return -ENOMEM; return -ENOMEM;
} }
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
netdev_boot_setup_check(dev);
memcpy(dev->dev_addr, phys_addr, sizeof(phys_addr)); memcpy(dev->dev_addr, phys_addr, sizeof(phys_addr));
dev->base_addr = ioaddr; dev->base_addr = ioaddr;
...@@ -646,8 +662,16 @@ static int __init el3_mca_probe(struct device *device) { ...@@ -646,8 +662,16 @@ static int __init el3_mca_probe(struct device *device) {
lp->dev = device; lp->dev = device;
lp->type = EL3_MCA; lp->type = EL3_MCA;
device->driver_data = dev; device->driver_data = dev;
el3_common_init(dev);
err = register_netdev(dev);
if (err) {
release_region(ioaddr, EL3_IO_EXTENT);
return -ENOMEM;
}
return el3_common_init (dev); el3_cards++;
return 0;
} }
#endif /* CONFIG_MCA */ #endif /* CONFIG_MCA */
...@@ -661,6 +685,7 @@ static int __init el3_eisa_probe (struct device *device) ...@@ -661,6 +685,7 @@ static int __init el3_eisa_probe (struct device *device)
u16 phys_addr[3]; u16 phys_addr[3];
struct net_device *dev = NULL; struct net_device *dev = NULL;
struct eisa_device *edev; struct eisa_device *edev;
int err;
/* Yeepee, The driver framework is calling us ! */ /* Yeepee, The driver framework is calling us ! */
edev = to_eisa_device (device); edev = to_eisa_device (device);
...@@ -680,7 +705,7 @@ static int __init el3_eisa_probe (struct device *device) ...@@ -680,7 +705,7 @@ static int __init el3_eisa_probe (struct device *device)
/* Restore the "Product ID" to the EEPROM read register. */ /* Restore the "Product ID" to the EEPROM read register. */
read_eeprom(ioaddr, 3); read_eeprom(ioaddr, 3);
dev = init_etherdev(NULL, sizeof(struct el3_private)); dev = alloc_etherdev(sizeof (struct el3_private));
if (dev == NULL) { if (dev == NULL) {
release_region(ioaddr, EL3_IO_EXTENT); release_region(ioaddr, EL3_IO_EXTENT);
return -ENOMEM; return -ENOMEM;
...@@ -688,6 +713,8 @@ static int __init el3_eisa_probe (struct device *device) ...@@ -688,6 +713,8 @@ static int __init el3_eisa_probe (struct device *device)
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
netdev_boot_setup_check(dev);
memcpy(dev->dev_addr, phys_addr, sizeof(phys_addr)); memcpy(dev->dev_addr, phys_addr, sizeof(phys_addr));
dev->base_addr = ioaddr; dev->base_addr = ioaddr;
dev->irq = irq; dev->irq = irq;
...@@ -696,8 +723,16 @@ static int __init el3_eisa_probe (struct device *device) ...@@ -696,8 +723,16 @@ static int __init el3_eisa_probe (struct device *device)
lp->dev = device; lp->dev = device;
lp->type = EL3_EISA; lp->type = EL3_EISA;
eisa_set_drvdata (edev, dev); eisa_set_drvdata (edev, dev);
el3_common_init(dev);
return el3_common_init (dev); err = register_netdev(dev);
if (err) {
release_region(ioaddr, EL3_IO_EXTENT);
return err;
}
el3_cards++;
return 0;
} }
#endif #endif
......
...@@ -250,8 +250,6 @@ struct scc_info { ...@@ -250,8 +250,6 @@ struct scc_info {
/* Function declarations */ /* Function declarations */
int dmascc_init(void) __init;
static int setup_adapter(int card_base, int type, int n) __init; static int setup_adapter(int card_base, int type, int n) __init;
static void write_scc(struct scc_priv *priv, int reg, int val); static void write_scc(struct scc_priv *priv, int reg, int val);
...@@ -299,23 +297,12 @@ static struct scc_info *first; ...@@ -299,23 +297,12 @@ static struct scc_info *first;
static unsigned long rand; static unsigned long rand;
/* Module functions */
#ifdef MODULE
MODULE_AUTHOR("Klaus Kudielka"); MODULE_AUTHOR("Klaus Kudielka");
MODULE_DESCRIPTION("Driver for high-speed SCC boards"); MODULE_DESCRIPTION("Driver for high-speed SCC boards");
MODULE_PARM(io, "1-" __MODULE_STRING(MAX_NUM_DEVS) "i"); MODULE_PARM(io, "1-" __MODULE_STRING(MAX_NUM_DEVS) "i");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static void __exit dmascc_exit(void) {
int init_module(void) {
return dmascc_init();
}
void cleanup_module(void) {
int i; int i;
struct scc_info *info; struct scc_info *info;
...@@ -341,24 +328,16 @@ void cleanup_module(void) { ...@@ -341,24 +328,16 @@ void cleanup_module(void) {
} }
} }
#ifndef MODULE
#else
void __init dmascc_setup(char *str, int *ints) { void __init dmascc_setup(char *str, int *ints) {
int i; int i;
for (i = 0; i < MAX_NUM_DEVS && i < ints[0]; i++) for (i = 0; i < MAX_NUM_DEVS && i < ints[0]; i++)
io[i] = ints[i+1]; io[i] = ints[i+1];
} }
#endif #endif
static int __init dmascc_init(void) {
/* Initialization functions */
int __init dmascc_init(void) {
int h, i, j, n; int h, i, j, n;
int base[MAX_NUM_DEVS], tcmd[MAX_NUM_DEVS], t0[MAX_NUM_DEVS], int base[MAX_NUM_DEVS], tcmd[MAX_NUM_DEVS], t0[MAX_NUM_DEVS],
t1[MAX_NUM_DEVS]; t1[MAX_NUM_DEVS];
...@@ -461,6 +440,9 @@ int __init dmascc_init(void) { ...@@ -461,6 +440,9 @@ int __init dmascc_init(void) {
return -EIO; return -EIO;
} }
module_init(dmascc_init);
module_exit(dmascc_exit);
int __init setup_adapter(int card_base, int type, int n) { int __init setup_adapter(int card_base, int type, int n) {
int i, irq, chip; int i, irq, chip;
...@@ -580,6 +562,7 @@ int __init setup_adapter(int card_base, int type, int n) { ...@@ -580,6 +562,7 @@ int __init setup_adapter(int card_base, int type, int n) {
if (sizeof(dev->name) == sizeof(char *)) dev->name = priv->name; if (sizeof(dev->name) == sizeof(char *)) dev->name = priv->name;
#endif #endif
sprintf(dev->name, "dmascc%i", 2*n+i); sprintf(dev->name, "dmascc%i", 2*n+i);
SET_MODULE_OWNER(dev);
dev->base_addr = card_base; dev->base_addr = card_base;
dev->irq = irq; dev->irq = irq;
dev->open = scc_open; dev->open = scc_open;
...@@ -707,12 +690,9 @@ static int scc_open(struct net_device *dev) { ...@@ -707,12 +690,9 @@ static int scc_open(struct net_device *dev) {
struct scc_info *info = priv->info; struct scc_info *info = priv->info;
int card_base = priv->card_base; int card_base = priv->card_base;
MOD_INC_USE_COUNT;
/* Request IRQ if not already used by other channel */ /* Request IRQ if not already used by other channel */
if (!info->irq_used) { if (!info->irq_used) {
if (request_irq(dev->irq, scc_isr, 0, "dmascc", info)) { if (request_irq(dev->irq, scc_isr, 0, "dmascc", info)) {
MOD_DEC_USE_COUNT;
return -EAGAIN; return -EAGAIN;
} }
} }
...@@ -722,7 +702,6 @@ static int scc_open(struct net_device *dev) { ...@@ -722,7 +702,6 @@ static int scc_open(struct net_device *dev) {
if (priv->param.dma >= 0) { if (priv->param.dma >= 0) {
if (request_dma(priv->param.dma, "dmascc")) { if (request_dma(priv->param.dma, "dmascc")) {
if (--info->irq_used == 0) free_irq(dev->irq, info); if (--info->irq_used == 0) free_irq(dev->irq, info);
MOD_DEC_USE_COUNT;
return -EAGAIN; return -EAGAIN;
} else { } else {
unsigned long flags = claim_dma_lock(); unsigned long flags = claim_dma_lock();
...@@ -866,7 +845,6 @@ static int scc_close(struct net_device *dev) { ...@@ -866,7 +845,6 @@ static int scc_close(struct net_device *dev) {
} }
if (--info->irq_used == 0) free_irq(dev->irq, info); if (--info->irq_used == 0) free_irq(dev->irq, info);
MOD_DEC_USE_COUNT;
return 0; return 0;
} }
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/netlink.h> #include <linux/netlink.h>
extern int dmascc_init(void);
extern int scc_enet_init(void); extern int scc_enet_init(void);
extern int fec_enet_init(void); extern int fec_enet_init(void);
...@@ -29,10 +27,6 @@ static struct net_probe pci_probes[] __initdata = { ...@@ -29,10 +27,6 @@ static struct net_probe pci_probes[] __initdata = {
/* /*
* Early setup devices * Early setup devices
*/ */
#if defined(CONFIG_DMASCC)
{dmascc_init, 0},
#endif
#if defined(CONFIG_SCC_ENET) #if defined(CONFIG_SCC_ENET)
{scc_enet_init, 0}, {scc_enet_init, 0},
#endif #endif
......
...@@ -383,6 +383,7 @@ struct s_DevNet { ...@@ -383,6 +383,7 @@ struct s_DevNet {
int Mtu; int Mtu;
int Up; int Up;
SK_AC *pAC; SK_AC *pAC;
struct proc_dir_entry *proc;
}; };
typedef struct s_TxPort TX_PORT; typedef struct s_TxPort TX_PORT;
......
...@@ -351,11 +351,7 @@ static int SkGeIocMib(DEV_NET*, unsigned int, int); ...@@ -351,11 +351,7 @@ static int SkGeIocMib(DEV_NET*, unsigned int, int);
static const char SK_Root_Dir_entry[] = "sk98lin"; static const char SK_Root_Dir_entry[] = "sk98lin";
static struct proc_dir_entry *pSkRootDir; static struct proc_dir_entry *pSkRootDir;
extern struct file_operations sk_proc_fops;
//extern struct proc_dir_entry Our_Proc_Dir;
extern int sk_proc_read(char *buffer, char **buffer_location,
off_t offset, int buffer_length, int *eof, void *data);
#ifdef DEBUG #ifdef DEBUG
static void DumpMsg(struct sk_buff*, char*); static void DumpMsg(struct sk_buff*, char*);
...@@ -399,7 +395,6 @@ static int __init skge_probe (void) ...@@ -399,7 +395,6 @@ static int __init skge_probe (void)
struct pci_dev *pdev = NULL; struct pci_dev *pdev = NULL;
unsigned long base_address; unsigned long base_address;
struct net_device *dev = NULL; struct net_device *dev = NULL;
struct proc_dir_entry *pProcFile;
if (probed) if (probed)
return -ENODEV; return -ENODEV;
...@@ -420,7 +415,6 @@ static int __init skge_probe (void) ...@@ -420,7 +415,6 @@ static int __init skge_probe (void)
while((pdev = pci_find_device(PCI_VENDOR_ID_SYSKONNECT, while((pdev = pci_find_device(PCI_VENDOR_ID_SYSKONNECT,
PCI_DEVICE_ID_SYSKONNECT_GE, pdev)) != NULL) { PCI_DEVICE_ID_SYSKONNECT_GE, pdev)) != NULL) {
dev = NULL;
pNet = NULL; pNet = NULL;
if (pci_enable_device(pdev)) if (pci_enable_device(pdev))
...@@ -431,7 +425,8 @@ static int __init skge_probe (void) ...@@ -431,7 +425,8 @@ static int __init skge_probe (void)
pci_set_dma_mask(pdev, (u64) 0xffffffff)) pci_set_dma_mask(pdev, (u64) 0xffffffff))
continue; continue;
if ((dev = init_etherdev(dev, sizeof(DEV_NET))) == 0) { dev = alloc_etherdev(sizeof(DEV_NET));
if (!dev) {
printk(KERN_ERR "Unable to allocate etherdev " printk(KERN_ERR "Unable to allocate etherdev "
"structure!\n"); "structure!\n");
break; break;
...@@ -440,7 +435,7 @@ static int __init skge_probe (void) ...@@ -440,7 +435,7 @@ static int __init skge_probe (void)
pNet = dev->priv; pNet = dev->priv;
pNet->pAC = kmalloc(sizeof(SK_AC), GFP_KERNEL); pNet->pAC = kmalloc(sizeof(SK_AC), GFP_KERNEL);
if (pNet->pAC == NULL){ if (pNet->pAC == NULL){
kfree(dev->priv); kfree(dev);
printk(KERN_ERR "Unable to allocate adapter " printk(KERN_ERR "Unable to allocate adapter "
"structure!\n"); "structure!\n");
break; break;
...@@ -477,15 +472,6 @@ static int __init skge_probe (void) ...@@ -477,15 +472,6 @@ static int __init skge_probe (void)
proc_root_initialized = 1; proc_root_initialized = 1;
} }
pProcFile = create_proc_entry(dev->name,
S_IFREG | 0444, pSkRootDir);
pProcFile->read_proc = sk_proc_read;
pProcFile->write_proc = NULL;
pProcFile->nlink = 1;
pProcFile->size = sizeof(dev->name+1);
pProcFile->data = (void*)pProcFile;
pProcFile->owner = THIS_MODULE;
/* /*
* Dummy value. * Dummy value.
*/ */
...@@ -532,11 +518,29 @@ static int __init skge_probe (void) ...@@ -532,11 +518,29 @@ static int __init skge_probe (void)
pNet->PortNr = 0; pNet->PortNr = 0;
pNet->NetNr = 0; pNet->NetNr = 0;
if (register_netdev(dev) != 0) {
printk(KERN_ERR "Unable to register etherdev\n");
sk98lin_root_dev = pAC->Next;
remove_proc_entry(dev->name, pSkRootDir);
FreeResources(dev);
kfree(dev);
continue;
}
pNet->proc = create_proc_entry(dev->name,
S_IFREG | 0444, pSkRootDir);
if (pNet->proc) {
pNet->proc->data = dev;
pNet->proc->owner = THIS_MODULE;
pNet->proc->proc_fops = &sk_proc_fops;
}
boards_found++; boards_found++;
/* More then one port found */ /* More then one port found */
if ((pAC->GIni.GIMacsFound == 2 ) && (pAC->RlmtNets == 2)) { if ((pAC->GIni.GIMacsFound == 2 ) && (pAC->RlmtNets == 2)) {
if ((dev = init_etherdev(NULL, sizeof(DEV_NET))) == 0) { dev = alloc_etherdev(sizeof(DEV_NET));
if (!dev) {
printk(KERN_ERR "Unable to allocate etherdev " printk(KERN_ERR "Unable to allocate etherdev "
"structure!\n"); "structure!\n");
break; break;
...@@ -559,21 +563,26 @@ static int __init skge_probe (void) ...@@ -559,21 +563,26 @@ static int __init skge_probe (void)
dev->do_ioctl = &SkGeIoctl; dev->do_ioctl = &SkGeIoctl;
dev->change_mtu = &SkGeChangeMtu; dev->change_mtu = &SkGeChangeMtu;
pProcFile = create_proc_entry(dev->name,
S_IFREG | 0444, pSkRootDir);
pProcFile->read_proc = sk_proc_read;
pProcFile->write_proc = NULL;
pProcFile->nlink = 1;
pProcFile->size = sizeof(dev->name+1);
pProcFile->data = (void*)pProcFile;
pProcFile->owner = THIS_MODULE;
memcpy((caddr_t) &dev->dev_addr, memcpy((caddr_t) &dev->dev_addr,
(caddr_t) &pAC->Addr.Net[1].CurrentMacAddress, 6); (caddr_t) &pAC->Addr.Net[1].CurrentMacAddress, 6);
printk("%s: %s\n", dev->name, pAC->DeviceStr); printk("%s: %s\n", dev->name, pAC->DeviceStr);
printk(" PrefPort:B RlmtMode:Dual Check Link State\n"); printk(" PrefPort:B RlmtMode:Dual Check Link State\n");
if (register_netdev(dev) != 0) {
printk(KERN_ERR "Unable to register etherdev\n");
kfree(dev);
break;
}
pNet->proc = create_proc_entry(dev->name,
S_IFREG | 0444, pSkRootDir);
if (pNet->proc) {
pNet->proc->data = dev;
pNet->proc->owner = THIS_MODULE;
pNet->proc->proc_fops = &sk_proc_fops;
}
} }
...@@ -740,6 +749,7 @@ static int __init skge_init_module(void) ...@@ -740,6 +749,7 @@ static int __init skge_init_module(void)
return cards ? 0 : -ENODEV; return cards ? 0 : -ENODEV;
} /* skge_init_module */ } /* skge_init_module */
spinlock_t sk_devs_lock = SPIN_LOCK_UNLOCKED;
/***************************************************************************** /*****************************************************************************
* *
...@@ -766,6 +776,11 @@ SK_EVPARA EvPara; ...@@ -766,6 +776,11 @@ SK_EVPARA EvPara;
netif_stop_queue(sk98lin_root_dev); netif_stop_queue(sk98lin_root_dev);
SkGeYellowLED(pAC, pAC->IoBase, 0); SkGeYellowLED(pAC, pAC->IoBase, 0);
if (pNet->proc) {
spin_lock(&sk_devs_lock);
pNet->proc->data = NULL;
spin_unlock(&sk_devs_lock);
}
if(pAC->BoardLevel == 2) { if(pAC->BoardLevel == 2) {
/* board is still alive */ /* board is still alive */
...@@ -792,6 +807,12 @@ SK_EVPARA EvPara; ...@@ -792,6 +807,12 @@ SK_EVPARA EvPara;
} }
if ((pAC->GIni.GIMacsFound == 2) && pAC->RlmtNets == 2){ if ((pAC->GIni.GIMacsFound == 2) && pAC->RlmtNets == 2){
pNet = (DEV_NET*) pAC->dev[1]->priv;
if (pNet->proc) {
spin_lock(&sk_devs_lock);
pNet->proc->data = NULL;
spin_unlock(&sk_devs_lock);
}
unregister_netdev(pAC->dev[1]); unregister_netdev(pAC->dev[1]);
kfree(pAC->dev[1]); kfree(pAC->dev[1]);
} }
......
This diff is collapsed.
...@@ -1682,11 +1682,13 @@ static int __init init_sdla(void) ...@@ -1682,11 +1682,13 @@ static int __init init_sdla(void)
static void __exit exit_sdla(void) static void __exit exit_sdla(void)
{ {
#ifdef MODULE
unregister_netdev(&sdla0); unregister_netdev(&sdla0);
if (sdla0.priv) if (sdla0.priv)
kfree(sdla0.priv); kfree(sdla0.priv);
if (sdla0.irq) if (sdla0.irq)
free_irq(sdla0.irq, &sdla0); free_irq(sdla0.irq, &sdla0);
#endif
} }
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#define RTM_MAX (RTM_BASE+31) #define RTM_MAX (RTM_BASE+31)
/* /*
Generic structure for encapsulation optional route information. Generic structure for encapsulation of optional route information.
It is reminiscent of sockaddr, but with sa_family replaced It is reminiscent of sockaddr, but with sa_family replaced
with attribute type. with attribute type.
*/ */
......
...@@ -111,9 +111,10 @@ static inline void fib6_walker_unlink(struct fib6_walker_t *w) ...@@ -111,9 +111,10 @@ static inline void fib6_walker_unlink(struct fib6_walker_t *w)
struct rt6_statistics { struct rt6_statistics {
__u32 fib_nodes; __u32 fib_nodes;
__u32 fib_route_nodes; __u32 fib_route_nodes;
__u32 fib_rt_alloc; /* permanet routes */ __u32 fib_rt_alloc; /* permanent routes */
__u32 fib_rt_entries; /* rt entries in table */ __u32 fib_rt_entries; /* rt entries in table */
__u32 fib_rt_cache; /* cache routes */ __u32 fib_rt_cache; /* cache routes */
__u32 fib_discarded_routes;
}; };
#define RTN_TL_ROOT 0x0001 #define RTN_TL_ROOT 0x0001
......
...@@ -42,6 +42,11 @@ ...@@ -42,6 +42,11 @@
*/ */
/*
* RFC 1213: MIB-II
* RFC 2011 (updates 1213): SNMPv2-MIB-IP
* RFC 2863: Interfaces Group MIB
*/
struct ip_mib struct ip_mib
{ {
unsigned long IpInReceives; unsigned long IpInReceives;
...@@ -64,6 +69,9 @@ struct ip_mib ...@@ -64,6 +69,9 @@ struct ip_mib
unsigned long __pad[0]; unsigned long __pad[0];
}; };
/*
* RFC 2465: IPv6 MIB: General Group
*/
struct ipv6_mib struct ipv6_mib
{ {
unsigned long Ip6InReceives; unsigned long Ip6InReceives;
...@@ -91,6 +99,10 @@ struct ipv6_mib ...@@ -91,6 +99,10 @@ struct ipv6_mib
unsigned long __pad[0]; unsigned long __pad[0];
}; };
/*
* RFC 1213: MIB-II ICMP Group
* RFC 2011 (updates 1213): SNMPv2 MIB for IP: ICMP group
*/
struct icmp_mib struct icmp_mib
{ {
unsigned long IcmpInMsgs; unsigned long IcmpInMsgs;
...@@ -123,6 +135,9 @@ struct icmp_mib ...@@ -123,6 +135,9 @@ struct icmp_mib
unsigned long __pad[0]; unsigned long __pad[0];
}; };
/*
* RFC 2466: ICMPv6-MIB
*/
struct icmpv6_mib struct icmpv6_mib
{ {
unsigned long Icmp6InMsgs; unsigned long Icmp6InMsgs;
...@@ -161,6 +176,10 @@ struct icmpv6_mib ...@@ -161,6 +176,10 @@ struct icmpv6_mib
unsigned long __pad[0]; unsigned long __pad[0];
}; };
/*
* RFC 1213: MIB-II TCP group
* RFC 2012 (updates 1213): SNMPv2-MIB-TCP
*/
struct tcp_mib struct tcp_mib
{ {
unsigned long TcpRtoAlgorithm; unsigned long TcpRtoAlgorithm;
...@@ -180,6 +199,10 @@ struct tcp_mib ...@@ -180,6 +199,10 @@ struct tcp_mib
unsigned long __pad[0]; unsigned long __pad[0];
}; };
/*
* RFC 1213: MIB-II UDP group
* RFC 2013 (updates 1213): SNMPv2-MIB-UDP
*/
struct udp_mib struct udp_mib
{ {
unsigned long UdpInDatagrams; unsigned long UdpInDatagrams;
......
/* /*
* net/dst.c Protocol independent destination cache. * net/core/dst.c Protocol independent destination cache.
* *
* Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
* *
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
* *
* Generic frame diversion * Generic frame diversion
* *
* Version: @(#)eth.c 0.41 09/09/2000
*
* Authors: * Authors:
* Benoit LOCHER: initial integration within the kernel with support for ethernet * Benoit LOCHER: initial integration within the kernel with support for ethernet
* Dave Miller: improvement on the code (correctness, performance and source files) * Dave Miller: improvement on the code (correctness, performance and source files)
......
This diff is collapsed.
...@@ -41,35 +41,35 @@ int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode) ...@@ -41,35 +41,35 @@ int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode)
{ {
int size, err, ct; int size, err, ct;
if(m->msg_namelen) if (m->msg_namelen) {
{ if (mode == VERIFY_READ) {
if(mode==VERIFY_READ) err = move_addr_to_kernel(m->msg_name, m->msg_namelen,
{ address);
err=move_addr_to_kernel(m->msg_name, m->msg_namelen, address); if (err < 0)
if(err<0) return err;
goto out;
}
m->msg_name = address; m->msg_name = address;
} else } else
m->msg_name = NULL; m->msg_name = NULL;
}
err = -EFAULT;
size = m->msg_iovlen * sizeof(struct iovec); size = m->msg_iovlen * sizeof(struct iovec);
if (copy_from_user(iov, m->msg_iov, size)) if (copy_from_user(iov, m->msg_iov, size))
goto out; return -EFAULT;
m->msg_iov=iov;
m->msg_iov = iov;
err = 0;
for (err = 0, ct = 0; ct < m->msg_iovlen; ct++) { for (ct = 0; ct < m->msg_iovlen; ct++) {
err += iov[ct].iov_len; err += iov[ct].iov_len;
/* Goal is not to verify user data, but to prevent returning /*
negative value, which is interpreted as errno. * Goal is not to verify user data, but to prevent returning
Overflow is still possible, but it is harmless. * negative value, which is interpreted as errno.
* Overflow is still possible, but it is harmless.
*/ */
if (err < 0) if (err < 0)
return -EMSGSIZE; return -EMSGSIZE;
} }
out:
return err; return err;
} }
...@@ -81,25 +81,20 @@ int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode) ...@@ -81,25 +81,20 @@ int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode)
int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len) int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len)
{ {
int err = -EFAULT; while (len > 0) {
if (iov->iov_len) {
while(len>0)
{
if(iov->iov_len)
{
int copy = min_t(unsigned int, iov->iov_len, len); int copy = min_t(unsigned int, iov->iov_len, len);
if (copy_to_user(iov->iov_base, kdata, copy)) if (copy_to_user(iov->iov_base, kdata, copy))
goto out; return -EFAULT;
kdata+=copy; kdata += copy;
len-=copy; len -= copy;
iov->iov_len-=copy; iov->iov_len -= copy;
iov->iov_base+=copy; iov->iov_base += copy;
} }
iov++; iov++;
} }
err = 0;
out: return 0;
return err;
} }
/* /*
...@@ -110,16 +105,14 @@ int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len) ...@@ -110,16 +105,14 @@ int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len)
void memcpy_tokerneliovec(struct iovec *iov, unsigned char *kdata, int len) void memcpy_tokerneliovec(struct iovec *iov, unsigned char *kdata, int len)
{ {
while(len>0) while (len > 0) {
{ if (iov->iov_len) {
if(iov->iov_len)
{
int copy = min_t(unsigned int, iov->iov_len, len); int copy = min_t(unsigned int, iov->iov_len, len);
memcpy(iov->iov_base, kdata, copy); memcpy(iov->iov_base, kdata, copy);
kdata+=copy; kdata += copy;
len-=copy; len -= copy;
iov->iov_len-=copy; iov->iov_len -= copy;
iov->iov_base+=copy; iov->iov_base += copy;
} }
iov++; iov++;
} }
...@@ -134,59 +127,47 @@ void memcpy_tokerneliovec(struct iovec *iov, unsigned char *kdata, int len) ...@@ -134,59 +127,47 @@ void memcpy_tokerneliovec(struct iovec *iov, unsigned char *kdata, int len)
int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len) int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len)
{ {
int err = -EFAULT; while (len > 0) {
if (iov->iov_len) {
while(len>0)
{
if(iov->iov_len)
{
int copy = min_t(unsigned int, len, iov->iov_len); int copy = min_t(unsigned int, len, iov->iov_len);
if (copy_from_user(kdata, iov->iov_base, copy)) if (copy_from_user(kdata, iov->iov_base, copy))
goto out; return -EFAULT;
len-=copy; len -= copy;
kdata+=copy; kdata += copy;
iov->iov_base+=copy; iov->iov_base += copy;
iov->iov_len-=copy; iov->iov_len -= copy;
} }
iov++; iov++;
} }
err = 0;
out:
return err;
}
return 0;
}
/* /*
* For use with ip_build_xmit * For use with ip_build_xmit
*/ */
int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov, int offset, int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov, int offset,
int len) int len)
{ {
int err = -EFAULT;
/* Skip over the finished iovecs */ /* Skip over the finished iovecs */
while(offset >= iov->iov_len) while (offset >= iov->iov_len) {
{
offset -= iov->iov_len; offset -= iov->iov_len;
iov++; iov++;
} }
while (len > 0) while (len > 0) {
{
u8 *base = iov->iov_base + offset; u8 *base = iov->iov_base + offset;
int copy = min_t(unsigned int, len, iov->iov_len - offset); int copy = min_t(unsigned int, len, iov->iov_len - offset);
offset = 0; offset = 0;
if (copy_from_user(kdata, base, copy)) if (copy_from_user(kdata, base, copy))
goto out; return -EFAULT;
len -= copy; len -= copy;
kdata += copy; kdata += copy;
iov++; iov++;
} }
err = 0;
out: return 0;
return err;
} }
/* /*
...@@ -197,7 +178,6 @@ int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov, int offset, ...@@ -197,7 +178,6 @@ int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov, int offset,
* ip_build_xmit must ensure that when fragmenting only the last * ip_build_xmit must ensure that when fragmenting only the last
* call to this function will be unaligned also. * call to this function will be unaligned also.
*/ */
int csum_partial_copy_fromiovecend(unsigned char *kdata, struct iovec *iov, int csum_partial_copy_fromiovecend(unsigned char *kdata, struct iovec *iov,
int offset, unsigned int len, int *csump) int offset, unsigned int len, int *csump)
{ {
...@@ -205,21 +185,19 @@ int csum_partial_copy_fromiovecend(unsigned char *kdata, struct iovec *iov, ...@@ -205,21 +185,19 @@ int csum_partial_copy_fromiovecend(unsigned char *kdata, struct iovec *iov,
int partial_cnt = 0, err = 0; int partial_cnt = 0, err = 0;
/* Skip over the finished iovecs */ /* Skip over the finished iovecs */
while (offset >= iov->iov_len) while (offset >= iov->iov_len) {
{
offset -= iov->iov_len; offset -= iov->iov_len;
iov++; iov++;
} }
while (len > 0) while (len > 0) {
{
u8 *base = iov->iov_base + offset; u8 *base = iov->iov_base + offset;
int copy = min_t(unsigned int, len, iov->iov_len - offset); int copy = min_t(unsigned int, len, iov->iov_len - offset);
offset = 0; offset = 0;
/* There is a remnant from previous iov. */ /* There is a remnant from previous iov. */
if (partial_cnt) if (partial_cnt) {
{
int par_len = 4 - partial_cnt; int par_len = 4 - partial_cnt;
/* iov component is too short ... */ /* iov component is too short ... */
...@@ -247,11 +225,9 @@ int csum_partial_copy_fromiovecend(unsigned char *kdata, struct iovec *iov, ...@@ -247,11 +225,9 @@ int csum_partial_copy_fromiovecend(unsigned char *kdata, struct iovec *iov,
partial_cnt = 0; partial_cnt = 0;
} }
if (len > copy) if (len > copy) {
{
partial_cnt = copy % 4; partial_cnt = copy % 4;
if (partial_cnt) if (partial_cnt) {
{
copy -= partial_cnt; copy -= partial_cnt;
if (copy_from_user(kdata + copy, base + copy, if (copy_from_user(kdata + copy, base + copy,
partial_cnt)) partial_cnt))
......
...@@ -343,6 +343,10 @@ config SYN_COOKIES ...@@ -343,6 +343,10 @@ config SYN_COOKIES
config INET_AH config INET_AH
tristate "IP: AH transformation" tristate "IP: AH transformation"
select CRYPTO
select CRYPTO_HMAC
select CRYPTO_MD5
select CRYPTO_SHA1
---help--- ---help---
Support for IPsec AH. Support for IPsec AH.
...@@ -350,6 +354,11 @@ config INET_AH ...@@ -350,6 +354,11 @@ config INET_AH
config INET_ESP config INET_ESP
tristate "IP: ESP transformation" tristate "IP: ESP transformation"
select CRYPTO
select CRYPTO_HMAC
select CRYPTO_MD5
select CRYPTO_SHA1
select CRYPTO_DES
---help--- ---help---
Support for IPsec ESP. Support for IPsec ESP.
...@@ -357,6 +366,8 @@ config INET_ESP ...@@ -357,6 +366,8 @@ config INET_ESP
config INET_IPCOMP config INET_IPCOMP
tristate "IP: IPComp transformation" tristate "IP: IPComp transformation"
select CRYPTO
select CRYPTO_DEFLATE
---help--- ---help---
Support for IP Paylod Compression (RFC3173), typically needed Support for IP Paylod Compression (RFC3173), typically needed
for IPsec. for IPsec.
......
...@@ -16,8 +16,8 @@ obj-$(CONFIG_IP_MROUTE) += ipmr.o ...@@ -16,8 +16,8 @@ obj-$(CONFIG_IP_MROUTE) += ipmr.o
obj-$(CONFIG_NET_IPIP) += ipip.o obj-$(CONFIG_NET_IPIP) += ipip.o
obj-$(CONFIG_NET_IPGRE) += ip_gre.o obj-$(CONFIG_NET_IPGRE) += ip_gre.o
obj-$(CONFIG_SYN_COOKIES) += syncookies.o obj-$(CONFIG_SYN_COOKIES) += syncookies.o
obj-$(CONFIG_INET_AH) += ah.o obj-$(CONFIG_INET_AH) += ah4.o
obj-$(CONFIG_INET_ESP) += esp.o obj-$(CONFIG_INET_ESP) += esp4.o
obj-$(CONFIG_INET_IPCOMP) += ipcomp.o obj-$(CONFIG_INET_IPCOMP) += ipcomp.o
obj-$(CONFIG_IP_PNP) += ipconfig.o obj-$(CONFIG_IP_PNP) += ipconfig.o
obj-$(CONFIG_NETFILTER) += netfilter/ obj-$(CONFIG_NETFILTER) += netfilter/
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
config IPV6_PRIVACY config IPV6_PRIVACY
bool "IPv6: Privacy Extensions (RFC 3041) support" bool "IPv6: Privacy Extensions (RFC 3041) support"
depends on IPV6 depends on IPV6
select CRYPTO
select CRYPTO_MD5
---help--- ---help---
Privacy Extensions for Stateless Address Autoconfiguration in IPv6 Privacy Extensions for Stateless Address Autoconfiguration in IPv6
support. With this option, additional periodically-alter support. With this option, additional periodically-alter
...@@ -20,6 +22,10 @@ config IPV6_PRIVACY ...@@ -20,6 +22,10 @@ config IPV6_PRIVACY
config INET6_AH config INET6_AH
tristate "IPv6: AH transformation" tristate "IPv6: AH transformation"
depends on IPV6 depends on IPV6
select CRYPTO
select CRYPTO_HMAC
select CRYPTO_MD5
select CRYPTO_SHA1
---help--- ---help---
Support for IPsec AH. Support for IPsec AH.
...@@ -28,6 +34,11 @@ config INET6_AH ...@@ -28,6 +34,11 @@ config INET6_AH
config INET6_ESP config INET6_ESP
tristate "IPv6: ESP transformation" tristate "IPv6: ESP transformation"
depends on IPV6 depends on IPV6
select CRYPTO
select CRYPTO_HMAC
select CRYPTO_MD5
select CRYPTO_SHA1
select CRYPTO_DES
---help--- ---help---
Support for IPsec ESP. Support for IPsec ESP.
...@@ -36,6 +47,8 @@ config INET6_ESP ...@@ -36,6 +47,8 @@ config INET6_ESP
config INET6_IPCOMP config INET6_IPCOMP
tristate "IPv6: IPComp transformation" tristate "IPv6: IPComp transformation"
depends on IPV6 depends on IPV6
select CRYPTO
select CRYPTO_DEFLATE
---help--- ---help---
Support for IP Paylod Compression (RFC3173), typically needed Support for IP Paylod Compression (RFC3173), typically needed
for IPsec. for IPsec.
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* *
* Janos Farkas : delete timer on ifdown * Janos Farkas : delete timer on ifdown
* <chexum@bankinf.banki.hu> * <chexum@bankinf.banki.hu>
* Andi Kleen : kill doube kfree on module * Andi Kleen : kill double kfree on module
* unload. * unload.
* Maciej W. Rozycki : FDDI support * Maciej W. Rozycki : FDDI support
* sekiya@USAGI : Don't send too many RS * sekiya@USAGI : Don't send too many RS
...@@ -343,6 +343,7 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev) ...@@ -343,6 +343,7 @@ static struct inet6_dev * ipv6_add_dev(struct net_device *dev)
"%s(): cannot create /proc/net/dev_snmp6/%s\n", "%s(): cannot create /proc/net/dev_snmp6/%s\n",
__FUNCTION__, dev->name)); __FUNCTION__, dev->name));
neigh_parms_release(&nd_tbl, ndev->nd_parms); neigh_parms_release(&nd_tbl, ndev->nd_parms);
ndev->dead = 1;
in6_dev_finish_destroy(ndev); in6_dev_finish_destroy(ndev);
return NULL; return NULL;
} }
...@@ -1256,7 +1257,7 @@ static void sit_route_add(struct net_device *dev) ...@@ -1256,7 +1257,7 @@ static void sit_route_add(struct net_device *dev)
rtmsg.rtmsg_type = RTMSG_NEWROUTE; rtmsg.rtmsg_type = RTMSG_NEWROUTE;
rtmsg.rtmsg_metric = IP6_RT_PRIO_ADDRCONF; rtmsg.rtmsg_metric = IP6_RT_PRIO_ADDRCONF;
/* prefix length - 96 bytes "::d.d.d.d" */ /* prefix length - 96 bits "::d.d.d.d" */
rtmsg.rtmsg_dst_len = 96; rtmsg.rtmsg_dst_len = 96;
rtmsg.rtmsg_flags = RTF_UP|RTF_NONEXTHOP; rtmsg.rtmsg_flags = RTF_UP|RTF_NONEXTHOP;
rtmsg.rtmsg_ifindex = dev->ifindex; rtmsg.rtmsg_ifindex = dev->ifindex;
......
...@@ -310,7 +310,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) ...@@ -310,7 +310,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
} else { } else {
if (addr_type != IPV6_ADDR_ANY) { if (addr_type != IPV6_ADDR_ANY) {
/* ipv4 addr of the socket is invalid. Only the /* ipv4 addr of the socket is invalid. Only the
* unpecified and mapped address have a v4 equivalent. * unspecified and mapped address have a v4 equivalent.
*/ */
v4addr = LOOPBACK4_IPV6; v4addr = LOOPBACK4_IPV6;
if (!(addr_type & IPV6_ADDR_MULTICAST)) { if (!(addr_type & IPV6_ADDR_MULTICAST)) {
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#include <net/ip6_route.h> #include <net/ip6_route.h>
#define RT6_DEBUG 2 #define RT6_DEBUG 2
#undef CONFIG_IPV6_SUBTREES
#if RT6_DEBUG >= 3 #if RT6_DEBUG >= 3
#define RT6_TRACE(x...) printk(KERN_DEBUG x) #define RT6_TRACE(x...) printk(KERN_DEBUG x)
...@@ -594,8 +593,8 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nlmsghdr *nlh, ...@@ -594,8 +593,8 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nlmsghdr *nlh,
is orphan. If it is, shoot it. is orphan. If it is, shoot it.
*/ */
st_failure: st_failure:
if (fn && !(fn->fn_flags&RTN_RTINFO|RTN_ROOT)) if (fn && !(fn->fn_flags & (RTN_RTINFO|RTN_ROOT)))
fib_repair_tree(fn); fib6_repair_tree(fn);
dst_free(&rt->u.dst); dst_free(&rt->u.dst);
return err; return err;
#endif #endif
...@@ -896,6 +895,7 @@ static void fib6_del_route(struct fib6_node *fn, struct rt6_info **rtp, ...@@ -896,6 +895,7 @@ static void fib6_del_route(struct fib6_node *fn, struct rt6_info **rtp,
*rtp = rt->u.next; *rtp = rt->u.next;
rt->rt6i_node = NULL; rt->rt6i_node = NULL;
rt6_stats.fib_rt_entries--; rt6_stats.fib_rt_entries--;
rt6_stats.fib_discarded_routes++;
/* Adjust walkers */ /* Adjust walkers */
read_lock(&fib6_walker_lock); read_lock(&fib6_walker_lock);
......
...@@ -336,7 +336,7 @@ static int rt6_ins(struct rt6_info *rt, struct nlmsghdr *nlh, void *_rtattr) ...@@ -336,7 +336,7 @@ static int rt6_ins(struct rt6_info *rt, struct nlmsghdr *nlh, void *_rtattr)
return err; return err;
} }
/* No rt6_lock! If COW faild, the function returns dead route entry /* No rt6_lock! If COW failed, the function returns dead route entry
with dst->error set to errno value. with dst->error set to errno value.
*/ */
...@@ -1786,11 +1786,12 @@ extern struct rt6_statistics rt6_stats; ...@@ -1786,11 +1786,12 @@ extern struct rt6_statistics rt6_stats;
static int rt6_stats_seq_show(struct seq_file *seq, void *v) static int rt6_stats_seq_show(struct seq_file *seq, void *v)
{ {
seq_printf(seq, "%04x %04x %04x %04x %04x %04x\n", seq_printf(seq, "%04x %04x %04x %04x %04x %04x %04x\n",
rt6_stats.fib_nodes, rt6_stats.fib_route_nodes, rt6_stats.fib_nodes, rt6_stats.fib_route_nodes,
rt6_stats.fib_rt_alloc, rt6_stats.fib_rt_entries, rt6_stats.fib_rt_alloc, rt6_stats.fib_rt_entries,
rt6_stats.fib_rt_cache, rt6_stats.fib_rt_cache,
atomic_read(&ip6_dst_ops.entries)); atomic_read(&ip6_dst_ops.entries),
rt6_stats.fib_discarded_routes);
return 0; return 0;
} }
......
...@@ -254,7 +254,6 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) ...@@ -254,7 +254,6 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
struct inet_opt *inet = inet_sk(sk); struct inet_opt *inet = inet_sk(sk);
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
struct in6_addr *daddr; struct in6_addr *daddr;
struct in6_addr saddr;
struct dst_entry *dst; struct dst_entry *dst;
struct flowi fl; struct flowi fl;
struct ip6_flowlabel *flowlabel = NULL; struct ip6_flowlabel *flowlabel = NULL;
...@@ -355,7 +354,7 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) ...@@ -355,7 +354,7 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
fl.proto = IPPROTO_UDP; fl.proto = IPPROTO_UDP;
ipv6_addr_copy(&fl.fl6_dst, &np->daddr); ipv6_addr_copy(&fl.fl6_dst, &np->daddr);
ipv6_addr_copy(&fl.fl6_src, &saddr); ipv6_addr_copy(&fl.fl6_src, &np->saddr);
fl.oif = sk->bound_dev_if; fl.oif = sk->bound_dev_if;
fl.fl_ip_dport = inet->dport; fl.fl_ip_dport = inet->dport;
fl.fl_ip_sport = inet->sport; fl.fl_ip_sport = inet->sport;
...@@ -381,20 +380,23 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) ...@@ -381,20 +380,23 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
return err; return err;
} }
ip6_dst_store(sk, dst, &fl.fl6_dst);
/* get the source address used in the appropriate device */ /* get the source address used in the appropriate device */
err = ipv6_get_saddr(dst, daddr, &saddr); err = ipv6_get_saddr(dst, daddr, &fl.fl6_src);
if (err == 0) { if (err == 0) {
if (ipv6_addr_any(&np->saddr)) if (ipv6_addr_any(&np->saddr))
ipv6_addr_copy(&np->saddr, &saddr); ipv6_addr_copy(&np->saddr, &fl.fl6_src);
if (ipv6_addr_any(&np->rcv_saddr)) { if (ipv6_addr_any(&np->rcv_saddr)) {
ipv6_addr_copy(&np->rcv_saddr, &saddr); ipv6_addr_copy(&np->rcv_saddr, &fl.fl6_src);
inet->rcv_saddr = LOOPBACK4_IPV6; inet->rcv_saddr = LOOPBACK4_IPV6;
} }
ip6_dst_store(sk, dst,
!ipv6_addr_cmp(&fl.fl6_dst, &np->daddr) ?
&np->daddr : NULL);
sk->state = TCP_ESTABLISHED; sk->state = TCP_ESTABLISHED;
} }
fl6_sock_release(flowlabel); fl6_sock_release(flowlabel);
......
...@@ -146,7 +146,7 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int ...@@ -146,7 +146,7 @@ __xfrm6_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int
memcpy(&dst_prev->metrics, &rt->u.dst.metrics, sizeof(dst_prev->metrics)); memcpy(&dst_prev->metrics, &rt->u.dst.metrics, sizeof(dst_prev->metrics));
dst_prev->path = &rt->u.dst; dst_prev->path = &rt->u.dst;
/* Copy neighbout for reachability confirmation */ /* Copy neighbour for reachability confirmation */
dst_prev->neighbour = neigh_clone(rt->u.dst.neighbour); dst_prev->neighbour = neigh_clone(rt->u.dst.neighbour);
dst_prev->input = rt->u.dst.input; dst_prev->input = rt->u.dst.input;
dst_prev->output = dst_prev->xfrm->type->output; dst_prev->output = dst_prev->xfrm->type->output;
......
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