diff options
| author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-02 20:39:49 -0400 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-02 20:39:49 -0400 | 
| commit | aa447acb9291518506a1aec644db47fa6c6e36eb (patch) | |
| tree | 4b7b3e5c72641f6695ea935ddd9f8250a2e4b937 | |
| parent | 317604633eface11cb7452298fa44a34624633dc (diff) | |
| parent | 5ba0eac6e0b7e2889649a1105d97c600595e2bb1 (diff) | |
Automatic merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
| -rw-r--r-- | drivers/atm/Makefile | 3 | ||||
| -rw-r--r-- | drivers/atm/fore200e.c | 6 | ||||
| -rw-r--r-- | drivers/atm/he.c | 6 | ||||
| -rw-r--r-- | drivers/atm/nicstar.c | 20 | ||||
| -rw-r--r-- | drivers/atm/zatm.c | 11 | ||||
| -rw-r--r-- | drivers/net/shaper.c | 86 | ||||
| -rw-r--r-- | include/linux/if_shaper.h | 3 | ||||
| -rw-r--r-- | include/linux/netdevice.h | 2 | ||||
| -rw-r--r-- | net/ipv4/ipvs/Makefile | 2 | ||||
| -rw-r--r-- | net/ipv4/ipvs/ip_vs_proto.c | 3 | ||||
| -rw-r--r-- | net/ipv4/ipvs/ip_vs_proto_icmp.c | 182 | ||||
| -rw-r--r-- | net/ipv6/ipv6_syms.c | 1 | 
12 files changed, 42 insertions, 283 deletions
| diff --git a/drivers/atm/Makefile b/drivers/atm/Makefile index d1dcd8eae3c9..5b77188527a9 100644 --- a/drivers/atm/Makefile +++ b/drivers/atm/Makefile | |||
| @@ -39,7 +39,8 @@ ifeq ($(CONFIG_ATM_FORE200E_PCA),y) | |||
| 39 | fore_200e-objs += fore200e_pca_fw.o | 39 | fore_200e-objs += fore200e_pca_fw.o | 
| 40 | # guess the target endianess to choose the right PCA-200E firmware image | 40 | # guess the target endianess to choose the right PCA-200E firmware image | 
| 41 | ifeq ($(CONFIG_ATM_FORE200E_PCA_DEFAULT_FW),y) | 41 | ifeq ($(CONFIG_ATM_FORE200E_PCA_DEFAULT_FW),y) | 
| 42 | CONFIG_ATM_FORE200E_PCA_FW = $(shell if test -n "`$(CC) -E -dM $(src)/../../include/asm/byteorder.h | grep ' __LITTLE_ENDIAN '`"; then echo $(obj)/pca200e.bin; else echo $(obj)/pca200e_ecd.bin2; fi) | 42 | byteorder.h := include$(if $(patsubst $(srctree),,$(objtree)),2)/asm/byteorder.h | 
| 43 | CONFIG_ATM_FORE200E_PCA_FW := $(obj)/pca200e$(if $(shell $(CC) -E -dM $(byteorder.h) | grep ' __LITTLE_ENDIAN '),.bin,_ecd.bin2) | ||
| 43 | endif | 44 | endif | 
| 44 | endif | 45 | endif | 
| 45 | 46 | ||
| diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c index 9e65bfb85ba3..5f702199543a 100644 --- a/drivers/atm/fore200e.c +++ b/drivers/atm/fore200e.c | |||
| @@ -383,8 +383,7 @@ fore200e_shutdown(struct fore200e* fore200e) | |||
| 383 | switch(fore200e->state) { | 383 | switch(fore200e->state) { | 
| 384 | 384 | ||
| 385 | case FORE200E_STATE_COMPLETE: | 385 | case FORE200E_STATE_COMPLETE: | 
| 386 | if (fore200e->stats) | 386 | kfree(fore200e->stats); | 
| 387 | kfree(fore200e->stats); | ||
| 388 | 387 | ||
| 389 | case FORE200E_STATE_IRQ: | 388 | case FORE200E_STATE_IRQ: | 
| 390 | free_irq(fore200e->irq, fore200e->atm_dev); | 389 | free_irq(fore200e->irq, fore200e->atm_dev); | 
| @@ -963,8 +962,7 @@ fore200e_tx_irq(struct fore200e* fore200e) | |||
| 963 | entry, txq->tail, entry->vc_map, entry->skb); | 962 | entry, txq->tail, entry->vc_map, entry->skb); | 
| 964 | 963 | ||
| 965 | /* free copy of misaligned data */ | 964 | /* free copy of misaligned data */ | 
| 966 | if (entry->data) | 965 | kfree(entry->data); | 
| 967 | kfree(entry->data); | ||
| 968 | 966 | ||
| 969 | /* remove DMA mapping */ | 967 | /* remove DMA mapping */ | 
| 970 | fore200e->bus->dma_unmap(fore200e, entry->tpd->tsd[ 0 ].buffer, entry->tpd->tsd[ 0 ].length, | 968 | fore200e->bus->dma_unmap(fore200e, entry->tpd->tsd[ 0 ].buffer, entry->tpd->tsd[ 0 ].length, | 
| diff --git a/drivers/atm/he.c b/drivers/atm/he.c index 3022c548a132..df2c83fd5496 100644 --- a/drivers/atm/he.c +++ b/drivers/atm/he.c | |||
| @@ -412,8 +412,7 @@ he_init_one(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent) | |||
| 412 | init_one_failure: | 412 | init_one_failure: | 
| 413 | if (atm_dev) | 413 | if (atm_dev) | 
| 414 | atm_dev_deregister(atm_dev); | 414 | atm_dev_deregister(atm_dev); | 
| 415 | if (he_dev) | 415 | kfree(he_dev); | 
| 416 | kfree(he_dev); | ||
| 417 | pci_disable_device(pci_dev); | 416 | pci_disable_device(pci_dev); | 
| 418 | return err; | 417 | return err; | 
| 419 | } | 418 | } | 
| @@ -2534,8 +2533,7 @@ he_open(struct atm_vcc *vcc) | |||
| 2534 | open_failed: | 2533 | open_failed: | 
| 2535 | 2534 | ||
| 2536 | if (err) { | 2535 | if (err) { | 
| 2537 | if (he_vcc) | 2536 | kfree(he_vcc); | 
| 2538 | kfree(he_vcc); | ||
| 2539 | clear_bit(ATM_VF_ADDR, &vcc->flags); | 2537 | clear_bit(ATM_VF_ADDR, &vcc->flags); | 
| 2540 | } | 2538 | } | 
| 2541 | else | 2539 | else | 
| diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c index 85bf5c8442b0..b2a7b754fd14 100644 --- a/drivers/atm/nicstar.c +++ b/drivers/atm/nicstar.c | |||
| @@ -676,10 +676,10 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev) | |||
| 676 | PRINTK("nicstar%d: RSQ base at 0x%x.\n", i, (u32) card->rsq.base); | 676 | PRINTK("nicstar%d: RSQ base at 0x%x.\n", i, (u32) card->rsq.base); | 
| 677 | 677 | ||
| 678 | /* Initialize SCQ0, the only VBR SCQ used */ | 678 | /* Initialize SCQ0, the only VBR SCQ used */ | 
| 679 | card->scq1 = (scq_info *) NULL; | 679 | card->scq1 = NULL; | 
| 680 | card->scq2 = (scq_info *) NULL; | 680 | card->scq2 = NULL; | 
| 681 | card->scq0 = get_scq(VBR_SCQSIZE, NS_VRSCD0); | 681 | card->scq0 = get_scq(VBR_SCQSIZE, NS_VRSCD0); | 
| 682 | if (card->scq0 == (scq_info *) NULL) | 682 | if (card->scq0 == NULL) | 
| 683 | { | 683 | { | 
| 684 | printk("nicstar%d: can't get SCQ0.\n", i); | 684 | printk("nicstar%d: can't get SCQ0.\n", i); | 
| 685 | error = 12; | 685 | error = 12; | 
| @@ -993,24 +993,24 @@ static scq_info *get_scq(int size, u32 scd) | |||
| 993 | int i; | 993 | int i; | 
| 994 | 994 | ||
| 995 | if (size != VBR_SCQSIZE && size != CBR_SCQSIZE) | 995 | if (size != VBR_SCQSIZE && size != CBR_SCQSIZE) | 
| 996 | return (scq_info *) NULL; | 996 | return NULL; | 
| 997 | 997 | ||
| 998 | scq = (scq_info *) kmalloc(sizeof(scq_info), GFP_KERNEL); | 998 | scq = (scq_info *) kmalloc(sizeof(scq_info), GFP_KERNEL); | 
| 999 | if (scq == (scq_info *) NULL) | 999 | if (scq == NULL) | 
| 1000 | return (scq_info *) NULL; | 1000 | return NULL; | 
| 1001 | scq->org = kmalloc(2 * size, GFP_KERNEL); | 1001 | scq->org = kmalloc(2 * size, GFP_KERNEL); | 
| 1002 | if (scq->org == NULL) | 1002 | if (scq->org == NULL) | 
| 1003 | { | 1003 | { | 
| 1004 | kfree(scq); | 1004 | kfree(scq); | 
| 1005 | return (scq_info *) NULL; | 1005 | return NULL; | 
| 1006 | } | 1006 | } | 
| 1007 | scq->skb = (struct sk_buff **) kmalloc(sizeof(struct sk_buff *) * | 1007 | scq->skb = (struct sk_buff **) kmalloc(sizeof(struct sk_buff *) * | 
| 1008 | (size / NS_SCQE_SIZE), GFP_KERNEL); | 1008 | (size / NS_SCQE_SIZE), GFP_KERNEL); | 
| 1009 | if (scq->skb == (struct sk_buff **) NULL) | 1009 | if (scq->skb == NULL) | 
| 1010 | { | 1010 | { | 
| 1011 | kfree(scq->org); | 1011 | kfree(scq->org); | 
| 1012 | kfree(scq); | 1012 | kfree(scq); | 
| 1013 | return (scq_info *) NULL; | 1013 | return NULL; | 
| 1014 | } | 1014 | } | 
| 1015 | scq->num_entries = size / NS_SCQE_SIZE; | 1015 | scq->num_entries = size / NS_SCQE_SIZE; | 
| 1016 | scq->base = (ns_scqe *) ALIGN_ADDRESS(scq->org, size); | 1016 | scq->base = (ns_scqe *) ALIGN_ADDRESS(scq->org, size); | 
| @@ -1498,7 +1498,7 @@ static int ns_open(struct atm_vcc *vcc) | |||
| 1498 | vc->cbr_scd = NS_FRSCD + frscdi * NS_FRSCD_SIZE; | 1498 | vc->cbr_scd = NS_FRSCD + frscdi * NS_FRSCD_SIZE; | 
| 1499 | 1499 | ||
| 1500 | scq = get_scq(CBR_SCQSIZE, vc->cbr_scd); | 1500 | scq = get_scq(CBR_SCQSIZE, vc->cbr_scd); | 
| 1501 | if (scq == (scq_info *) NULL) | 1501 | if (scq == NULL) | 
| 1502 | { | 1502 | { | 
| 1503 | PRINTK("nicstar%d: can't get fixed rate SCQ.\n", card->index); | 1503 | PRINTK("nicstar%d: can't get fixed rate SCQ.\n", card->index); | 
| 1504 | card->scd2vc[frscdi] = NULL; | 1504 | card->scd2vc[frscdi] = NULL; | 
| diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c index 47a800519ad0..8d5e65cb9755 100644 --- a/drivers/atm/zatm.c +++ b/drivers/atm/zatm.c | |||
| @@ -902,7 +902,7 @@ static void close_tx(struct atm_vcc *vcc) | |||
| 902 | zatm_dev->tx_bw += vcc->qos.txtp.min_pcr; | 902 | zatm_dev->tx_bw += vcc->qos.txtp.min_pcr; | 
| 903 | dealloc_shaper(vcc->dev,zatm_vcc->shaper); | 903 | dealloc_shaper(vcc->dev,zatm_vcc->shaper); | 
| 904 | } | 904 | } | 
| 905 | if (zatm_vcc->ring) kfree(zatm_vcc->ring); | 905 | kfree(zatm_vcc->ring); | 
| 906 | } | 906 | } | 
| 907 | 907 | ||
| 908 | 908 | ||
| @@ -1339,12 +1339,9 @@ static int __init zatm_start(struct atm_dev *dev) | |||
| 1339 | return 0; | 1339 | return 0; | 
| 1340 | out: | 1340 | out: | 
| 1341 | for (i = 0; i < NR_MBX; i++) | 1341 | for (i = 0; i < NR_MBX; i++) | 
| 1342 | if (zatm_dev->mbx_start[i] != 0) | 1342 | kfree(zatm_dev->mbx_start[i]); | 
| 1343 | kfree((void *) zatm_dev->mbx_start[i]); | 1343 | kfree(zatm_dev->rx_map); | 
| 1344 | if (zatm_dev->rx_map != NULL) | 1344 | kfree(zatm_dev->tx_map); | 
| 1345 | kfree(zatm_dev->rx_map); | ||
| 1346 | if (zatm_dev->tx_map != NULL) | ||
| 1347 | kfree(zatm_dev->tx_map); | ||
| 1348 | free_irq(zatm_dev->irq, dev); | 1345 | free_irq(zatm_dev->irq, dev); | 
| 1349 | return error; | 1346 | return error; | 
| 1350 | } | 1347 | } | 
| diff --git a/drivers/net/shaper.c b/drivers/net/shaper.c index e68cf5fb4920..20edeb345792 100644 --- a/drivers/net/shaper.c +++ b/drivers/net/shaper.c | |||
| @@ -100,35 +100,8 @@ static int sh_debug; /* Debug flag */ | |||
| 100 | 100 | ||
| 101 | #define SHAPER_BANNER "CymruNet Traffic Shaper BETA 0.04 for Linux 2.1\n" | 101 | #define SHAPER_BANNER "CymruNet Traffic Shaper BETA 0.04 for Linux 2.1\n" | 
| 102 | 102 | ||
| 103 | /* | ||
| 104 | * Locking | ||
| 105 | */ | ||
| 106 | |||
| 107 | static int shaper_lock(struct shaper *sh) | ||
| 108 | { | ||
| 109 | /* | ||
| 110 | * Lock in an interrupt must fail | ||
| 111 | */ | ||
| 112 | while (test_and_set_bit(0, &sh->locked)) | ||
| 113 | { | ||
| 114 | if (!in_interrupt()) | ||
| 115 | sleep_on(&sh->wait_queue); | ||
| 116 | else | ||
| 117 | return 0; | ||
| 118 | |||
| 119 | } | ||
| 120 | return 1; | ||
| 121 | } | ||
| 122 | |||
| 123 | static void shaper_kick(struct shaper *sh); | 103 | static void shaper_kick(struct shaper *sh); | 
| 124 | 104 | ||
| 125 | static void shaper_unlock(struct shaper *sh) | ||
| 126 | { | ||
| 127 | clear_bit(0, &sh->locked); | ||
| 128 | wake_up(&sh->wait_queue); | ||
| 129 | shaper_kick(sh); | ||
| 130 | } | ||
| 131 | |||
| 132 | /* | 105 | /* | 
| 133 | * Compute clocks on a buffer | 106 | * Compute clocks on a buffer | 
| 134 | */ | 107 | */ | 
| @@ -157,17 +130,15 @@ static void shaper_setspeed(struct shaper *shaper, int bitspersec) | |||
| 157 | * Throw a frame at a shaper. | 130 | * Throw a frame at a shaper. | 
| 158 | */ | 131 | */ | 
| 159 | 132 | ||
| 160 | static int shaper_qframe(struct shaper *shaper, struct sk_buff *skb) | 133 | |
| 134 | static int shaper_start_xmit(struct sk_buff *skb, struct net_device *dev) | ||
| 161 | { | 135 | { | 
| 136 | struct shaper *shaper = dev->priv; | ||
| 162 | struct sk_buff *ptr; | 137 | struct sk_buff *ptr; | 
| 163 | 138 | ||
| 164 | /* | 139 | if (down_trylock(&shaper->sem)) | 
| 165 | * Get ready to work on this shaper. Lock may fail if its | 140 | return -1; | 
| 166 | * an interrupt and locked. | 141 | |
| 167 | */ | ||
| 168 | |||
| 169 | if(!shaper_lock(shaper)) | ||
| 170 | return -1; | ||
| 171 | ptr=shaper->sendq.prev; | 142 | ptr=shaper->sendq.prev; | 
| 172 | 143 | ||
| 173 | /* | 144 | /* | 
| @@ -260,7 +231,8 @@ static int shaper_qframe(struct shaper *shaper, struct sk_buff *skb) | |||
| 260 | dev_kfree_skb(ptr); | 231 | dev_kfree_skb(ptr); | 
| 261 | shaper->stats.collisions++; | 232 | shaper->stats.collisions++; | 
| 262 | } | 233 | } | 
| 263 | shaper_unlock(shaper); | 234 | shaper_kick(shaper); | 
| 235 | up(&shaper->sem); | ||
| 264 | return 0; | 236 | return 0; | 
| 265 | } | 237 | } | 
| 266 | 238 | ||
| @@ -297,8 +269,13 @@ static void shaper_queue_xmit(struct shaper *shaper, struct sk_buff *skb) | |||
| 297 | 269 | ||
| 298 | static void shaper_timer(unsigned long data) | 270 | static void shaper_timer(unsigned long data) | 
| 299 | { | 271 | { | 
| 300 | struct shaper *sh=(struct shaper *)data; | 272 | struct shaper *shaper = (struct shaper *)data; | 
| 301 | shaper_kick(sh); | 273 | |
| 274 | if (!down_trylock(&shaper->sem)) { | ||
| 275 | shaper_kick(shaper); | ||
| 276 | up(&shaper->sem); | ||
| 277 | } else | ||
| 278 | mod_timer(&shaper->timer, jiffies); | ||
| 302 | } | 279 | } | 
| 303 | 280 | ||
| 304 | /* | 281 | /* | 
| @@ -311,19 +288,6 @@ static void shaper_kick(struct shaper *shaper) | |||
| 311 | struct sk_buff *skb; | 288 | struct sk_buff *skb; | 
| 312 | 289 | ||
| 313 | /* | 290 | /* | 
| 314 | * Shaper unlock will kick | ||
| 315 | */ | ||
| 316 | |||
| 317 | if (test_and_set_bit(0, &shaper->locked)) | ||
| 318 | { | ||
| 319 | if(sh_debug) | ||
| 320 | printk("Shaper locked.\n"); | ||
| 321 | mod_timer(&shaper->timer, jiffies); | ||
| 322 | return; | ||
| 323 | } | ||
| 324 | |||
| 325 | |||
| 326 | /* | ||
| 327 | * Walk the list (may be empty) | 291 | * Walk the list (may be empty) | 
| 328 | */ | 292 | */ | 
| 329 | 293 | ||
| @@ -364,8 +328,6 @@ static void shaper_kick(struct shaper *shaper) | |||
| 364 | 328 | ||
| 365 | if(skb!=NULL) | 329 | if(skb!=NULL) | 
| 366 | mod_timer(&shaper->timer, SHAPERCB(skb)->shapeclock); | 330 | mod_timer(&shaper->timer, SHAPERCB(skb)->shapeclock); | 
| 367 | |||
| 368 | clear_bit(0, &shaper->locked); | ||
| 369 | } | 331 | } | 
| 370 | 332 | ||
| 371 | 333 | ||
| @@ -376,14 +338,12 @@ static void shaper_kick(struct shaper *shaper) | |||
| 376 | static void shaper_flush(struct shaper *shaper) | 338 | static void shaper_flush(struct shaper *shaper) | 
| 377 | { | 339 | { | 
| 378 | struct sk_buff *skb; | 340 | struct sk_buff *skb; | 
| 379 | if(!shaper_lock(shaper)) | 341 | |
| 380 | { | 342 | down(&shaper->sem); | 
| 381 | printk(KERN_ERR "shaper: shaper_flush() called by an irq!\n"); | ||
| 382 | return; | ||
| 383 | } | ||
| 384 | while((skb=skb_dequeue(&shaper->sendq))!=NULL) | 343 | while((skb=skb_dequeue(&shaper->sendq))!=NULL) | 
| 385 | dev_kfree_skb(skb); | 344 | dev_kfree_skb(skb); | 
| 386 | shaper_unlock(shaper); | 345 | shaper_kick(shaper); | 
| 346 | up(&shaper->sem); | ||
| 387 | } | 347 | } | 
| 388 | 348 | ||
| 389 | /* | 349 | /* | 
| @@ -426,13 +386,6 @@ static int shaper_close(struct net_device *dev) | |||
| 426 | * ARP and other resolutions and not before. | 386 | * ARP and other resolutions and not before. | 
| 427 | */ | 387 | */ | 
| 428 | 388 | ||
| 429 | |||
| 430 | static int shaper_start_xmit(struct sk_buff *skb, struct net_device *dev) | ||
| 431 | { | ||
| 432 | struct shaper *sh=dev->priv; | ||
| 433 | return shaper_qframe(sh, skb); | ||
| 434 | } | ||
| 435 | |||
| 436 | static struct net_device_stats *shaper_get_stats(struct net_device *dev) | 389 | static struct net_device_stats *shaper_get_stats(struct net_device *dev) | 
| 437 | { | 390 | { | 
| 438 | struct shaper *sh=dev->priv; | 391 | struct shaper *sh=dev->priv; | 
| @@ -623,7 +576,6 @@ static void shaper_init_priv(struct net_device *dev) | |||
| 623 | init_timer(&sh->timer); | 576 | init_timer(&sh->timer); | 
| 624 | sh->timer.function=shaper_timer; | 577 | sh->timer.function=shaper_timer; | 
| 625 | sh->timer.data=(unsigned long)sh; | 578 | sh->timer.data=(unsigned long)sh; | 
| 626 | init_waitqueue_head(&sh->wait_queue); | ||
| 627 | } | 579 | } | 
| 628 | 580 | ||
| 629 | /* | 581 | /* | 
| diff --git a/include/linux/if_shaper.h b/include/linux/if_shaper.h index 0485b256d043..004e6f09a6e2 100644 --- a/include/linux/if_shaper.h +++ b/include/linux/if_shaper.h | |||
| @@ -23,7 +23,7 @@ struct shaper | |||
| 23 | __u32 shapeclock; | 23 | __u32 shapeclock; | 
| 24 | unsigned long recovery; /* Time we can next clock a packet out on | 24 | unsigned long recovery; /* Time we can next clock a packet out on | 
| 25 | an empty queue */ | 25 | an empty queue */ | 
| 26 | unsigned long locked; | 26 | struct semaphore sem; | 
| 27 | struct net_device_stats stats; | 27 | struct net_device_stats stats; | 
| 28 | struct net_device *dev; | 28 | struct net_device *dev; | 
| 29 | int (*hard_start_xmit) (struct sk_buff *skb, | 29 | int (*hard_start_xmit) (struct sk_buff *skb, | 
| @@ -38,7 +38,6 @@ struct shaper | |||
| 38 | int (*hard_header_cache)(struct neighbour *neigh, struct hh_cache *hh); | 38 | int (*hard_header_cache)(struct neighbour *neigh, struct hh_cache *hh); | 
| 39 | void (*header_cache_update)(struct hh_cache *hh, struct net_device *dev, unsigned char * haddr); | 39 | void (*header_cache_update)(struct hh_cache *hh, struct net_device *dev, unsigned char * haddr); | 
| 40 | struct net_device_stats* (*get_stats)(struct net_device *dev); | 40 | struct net_device_stats* (*get_stats)(struct net_device *dev); | 
| 41 | wait_queue_head_t wait_queue; | ||
| 42 | struct timer_list timer; | 41 | struct timer_list timer; | 
| 43 | }; | 42 | }; | 
| 44 | 43 | ||
| diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 470af8c1a4a0..ba5d1236aa17 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -204,7 +204,7 @@ struct hh_cache | |||
| 204 | /* cached hardware header; allow for machine alignment needs. */ | 204 | /* cached hardware header; allow for machine alignment needs. */ | 
| 205 | #define HH_DATA_MOD 16 | 205 | #define HH_DATA_MOD 16 | 
| 206 | #define HH_DATA_OFF(__len) \ | 206 | #define HH_DATA_OFF(__len) \ | 
| 207 | (HH_DATA_MOD - ((__len) & (HH_DATA_MOD - 1))) | 207 | (HH_DATA_MOD - (((__len - 1) & (HH_DATA_MOD - 1)) + 1)) | 
| 208 | #define HH_DATA_ALIGN(__len) \ | 208 | #define HH_DATA_ALIGN(__len) \ | 
| 209 | (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1)) | 209 | (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1)) | 
| 210 | unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; | 210 | unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; | 
| diff --git a/net/ipv4/ipvs/Makefile b/net/ipv4/ipvs/Makefile index a788461a40c9..30e85de9ffff 100644 --- a/net/ipv4/ipvs/Makefile +++ b/net/ipv4/ipvs/Makefile | |||
| @@ -11,7 +11,7 @@ ip_vs_proto-objs-$(CONFIG_IP_VS_PROTO_AH) += ip_vs_proto_ah.o | |||
| 11 | 11 | ||
| 12 | ip_vs-objs := ip_vs_conn.o ip_vs_core.o ip_vs_ctl.o ip_vs_sched.o \ | 12 | ip_vs-objs := ip_vs_conn.o ip_vs_core.o ip_vs_ctl.o ip_vs_sched.o \ | 
| 13 | ip_vs_xmit.o ip_vs_app.o ip_vs_sync.o \ | 13 | ip_vs_xmit.o ip_vs_app.o ip_vs_sync.o \ | 
| 14 | ip_vs_est.o ip_vs_proto.o ip_vs_proto_icmp.o \ | 14 | ip_vs_est.o ip_vs_proto.o \ | 
| 15 | $(ip_vs_proto-objs-y) | 15 | $(ip_vs_proto-objs-y) | 
| 16 | 16 | ||
| 17 | 17 | ||
| diff --git a/net/ipv4/ipvs/ip_vs_proto.c b/net/ipv4/ipvs/ip_vs_proto.c index 253c46252bd5..867d4e9c6594 100644 --- a/net/ipv4/ipvs/ip_vs_proto.c +++ b/net/ipv4/ipvs/ip_vs_proto.c | |||
| @@ -216,9 +216,6 @@ int ip_vs_protocol_init(void) | |||
| 216 | #ifdef CONFIG_IP_VS_PROTO_UDP | 216 | #ifdef CONFIG_IP_VS_PROTO_UDP | 
| 217 | REGISTER_PROTOCOL(&ip_vs_protocol_udp); | 217 | REGISTER_PROTOCOL(&ip_vs_protocol_udp); | 
| 218 | #endif | 218 | #endif | 
| 219 | #ifdef CONFIG_IP_VS_PROTO_ICMP | ||
| 220 | REGISTER_PROTOCOL(&ip_vs_protocol_icmp); | ||
| 221 | #endif | ||
| 222 | #ifdef CONFIG_IP_VS_PROTO_AH | 219 | #ifdef CONFIG_IP_VS_PROTO_AH | 
| 223 | REGISTER_PROTOCOL(&ip_vs_protocol_ah); | 220 | REGISTER_PROTOCOL(&ip_vs_protocol_ah); | 
| 224 | #endif | 221 | #endif | 
| diff --git a/net/ipv4/ipvs/ip_vs_proto_icmp.c b/net/ipv4/ipvs/ip_vs_proto_icmp.c deleted file mode 100644 index 191e94aa1c1f..000000000000 --- a/net/ipv4/ipvs/ip_vs_proto_icmp.c +++ /dev/null | |||
| @@ -1,182 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * ip_vs_proto_icmp.c: ICMP load balancing support for IP Virtual Server | ||
| 3 | * | ||
| 4 | * Authors: Julian Anastasov <ja@ssi.bg>, March 2002 | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU General Public License | ||
| 8 | * version 2 as published by the Free Software Foundation; | ||
| 9 | * | ||
| 10 | */ | ||
| 11 | |||
| 12 | #include <linux/module.h> | ||
| 13 | #include <linux/kernel.h> | ||
| 14 | #include <linux/icmp.h> | ||
| 15 | #include <linux/netfilter.h> | ||
| 16 | #include <linux/netfilter_ipv4.h> | ||
| 17 | |||
| 18 | #include <net/ip_vs.h> | ||
| 19 | |||
| 20 | |||
| 21 | static int icmp_timeouts[1] = { 1*60*HZ }; | ||
| 22 | |||
| 23 | static char * icmp_state_name_table[1] = { "ICMP" }; | ||
| 24 | |||
| 25 | static struct ip_vs_conn * | ||
| 26 | icmp_conn_in_get(const struct sk_buff *skb, | ||
| 27 | struct ip_vs_protocol *pp, | ||
| 28 | const struct iphdr *iph, | ||
| 29 | unsigned int proto_off, | ||
| 30 | int inverse) | ||
| 31 | { | ||
| 32 | #if 0 | ||
| 33 | struct ip_vs_conn *cp; | ||
| 34 | |||
| 35 | if (likely(!inverse)) { | ||
| 36 | cp = ip_vs_conn_in_get(iph->protocol, | ||
| 37 | iph->saddr, 0, | ||
| 38 | iph->daddr, 0); | ||
| 39 | } else { | ||
| 40 | cp = ip_vs_conn_in_get(iph->protocol, | ||
| 41 | iph->daddr, 0, | ||
| 42 | iph->saddr, 0); | ||
| 43 | } | ||
| 44 | |||
| 45 | return cp; | ||
| 46 | |||
| 47 | #else | ||
| 48 | return NULL; | ||
| 49 | #endif | ||
| 50 | } | ||
| 51 | |||
| 52 | static struct ip_vs_conn * | ||
| 53 | icmp_conn_out_get(const struct sk_buff *skb, | ||
| 54 | struct ip_vs_protocol *pp, | ||
| 55 | const struct iphdr *iph, | ||
| 56 | unsigned int proto_off, | ||
| 57 | int inverse) | ||
| 58 | { | ||
| 59 | #if 0 | ||
| 60 | struct ip_vs_conn *cp; | ||
| 61 | |||
| 62 | if (likely(!inverse)) { | ||
| 63 | cp = ip_vs_conn_out_get(iph->protocol, | ||
| 64 | iph->saddr, 0, | ||
| 65 | iph->daddr, 0); | ||
| 66 | } else { | ||
| 67 | cp = ip_vs_conn_out_get(IPPROTO_UDP, | ||
| 68 | iph->daddr, 0, | ||
| 69 | iph->saddr, 0); | ||
| 70 | } | ||
| 71 | |||
| 72 | return cp; | ||
| 73 | #else | ||
| 74 | return NULL; | ||
| 75 | #endif | ||
| 76 | } | ||
| 77 | |||
| 78 | static int | ||
| 79 | icmp_conn_schedule(struct sk_buff *skb, struct ip_vs_protocol *pp, | ||
| 80 | int *verdict, struct ip_vs_conn **cpp) | ||
| 81 | { | ||
| 82 | *verdict = NF_ACCEPT; | ||
| 83 | return 0; | ||
| 84 | } | ||
| 85 | |||
| 86 | static int | ||
| 87 | icmp_csum_check(struct sk_buff *skb, struct ip_vs_protocol *pp) | ||
| 88 | { | ||
| 89 | if (!(skb->nh.iph->frag_off & __constant_htons(IP_OFFSET))) { | ||
| 90 | if (skb->ip_summed != CHECKSUM_UNNECESSARY) { | ||
| 91 | if (ip_vs_checksum_complete(skb, skb->nh.iph->ihl * 4)) { | ||
| 92 | IP_VS_DBG_RL_PKT(0, pp, skb, 0, "Failed checksum for"); | ||
| 93 | return 0; | ||
| 94 | } | ||
| 95 | } | ||
| 96 | } | ||
| 97 | return 1; | ||
| 98 | } | ||
| 99 | |||
| 100 | static void | ||
| 101 | icmp_debug_packet(struct ip_vs_protocol *pp, | ||
| 102 | const struct sk_buff *skb, | ||
| 103 | int offset, | ||
| 104 | const char *msg) | ||
| 105 | { | ||
| 106 | char buf[256]; | ||
| 107 | struct iphdr _iph, *ih; | ||
| 108 | |||
| 109 | ih = skb_header_pointer(skb, offset, sizeof(_iph), &_iph); | ||
| 110 | if (ih == NULL) | ||
| 111 | sprintf(buf, "%s TRUNCATED", pp->name); | ||
| 112 | else if (ih->frag_off & __constant_htons(IP_OFFSET)) | ||
| 113 | sprintf(buf, "%s %u.%u.%u.%u->%u.%u.%u.%u frag", | ||
| 114 | pp->name, NIPQUAD(ih->saddr), | ||
| 115 | NIPQUAD(ih->daddr)); | ||
| 116 | else { | ||
| 117 | struct icmphdr _icmph, *ic; | ||
| 118 | |||
| 119 | ic = skb_header_pointer(skb, offset + ih->ihl*4, | ||
| 120 | sizeof(_icmph), &_icmph); | ||
| 121 | if (ic == NULL) | ||
| 122 | sprintf(buf, "%s TRUNCATED to %u bytes\n", | ||
| 123 | pp->name, skb->len - offset); | ||
| 124 | else | ||
| 125 | sprintf(buf, "%s %u.%u.%u.%u->%u.%u.%u.%u T:%d C:%d", | ||
| 126 | pp->name, NIPQUAD(ih->saddr), | ||
| 127 | NIPQUAD(ih->daddr), | ||
| 128 | ic->type, ic->code); | ||
| 129 | } | ||
| 130 | printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf); | ||
| 131 | } | ||
| 132 | |||
| 133 | static int | ||
| 134 | icmp_state_transition(struct ip_vs_conn *cp, int direction, | ||
| 135 | const struct sk_buff *skb, | ||
| 136 | struct ip_vs_protocol *pp) | ||
| 137 | { | ||
| 138 | cp->timeout = pp->timeout_table[IP_VS_ICMP_S_NORMAL]; | ||
| 139 | return 1; | ||
| 140 | } | ||
| 141 | |||
| 142 | static int | ||
| 143 | icmp_set_state_timeout(struct ip_vs_protocol *pp, char *sname, int to) | ||
| 144 | { | ||
| 145 | int num; | ||
| 146 | char **names; | ||
| 147 | |||
| 148 | num = IP_VS_ICMP_S_LAST; | ||
| 149 | names = icmp_state_name_table; | ||
| 150 | return ip_vs_set_state_timeout(pp->timeout_table, num, names, sname, to); | ||
| 151 | } | ||
| 152 | |||
| 153 | |||
| 154 | static void icmp_init(struct ip_vs_protocol *pp) | ||
| 155 | { | ||
| 156 | pp->timeout_table = icmp_timeouts; | ||
| 157 | } | ||
| 158 | |||
| 159 | static void icmp_exit(struct ip_vs_protocol *pp) | ||
| 160 | { | ||
| 161 | } | ||
| 162 | |||
| 163 | struct ip_vs_protocol ip_vs_protocol_icmp = { | ||
| 164 | .name = "ICMP", | ||
| 165 | .protocol = IPPROTO_ICMP, | ||
| 166 | .dont_defrag = 0, | ||
| 167 | .init = icmp_init, | ||
| 168 | .exit = icmp_exit, | ||
| 169 | .conn_schedule = icmp_conn_schedule, | ||
| 170 | .conn_in_get = icmp_conn_in_get, | ||
| 171 | .conn_out_get = icmp_conn_out_get, | ||
| 172 | .snat_handler = NULL, | ||
| 173 | .dnat_handler = NULL, | ||
| 174 | .csum_check = icmp_csum_check, | ||
| 175 | .state_transition = icmp_state_transition, | ||
| 176 | .register_app = NULL, | ||
| 177 | .unregister_app = NULL, | ||
| 178 | .app_conn_bind = NULL, | ||
| 179 | .debug_packet = icmp_debug_packet, | ||
| 180 | .timeout_change = NULL, | ||
| 181 | .set_state_timeout = icmp_set_state_timeout, | ||
| 182 | }; | ||
| diff --git a/net/ipv6/ipv6_syms.c b/net/ipv6/ipv6_syms.c index 2f4c91ddc9a3..5ade5a5d1990 100644 --- a/net/ipv6/ipv6_syms.c +++ b/net/ipv6/ipv6_syms.c | |||
| @@ -37,5 +37,4 @@ EXPORT_SYMBOL(in6_dev_finish_destroy); | |||
| 37 | EXPORT_SYMBOL(xfrm6_rcv); | 37 | EXPORT_SYMBOL(xfrm6_rcv); | 
| 38 | #endif | 38 | #endif | 
| 39 | EXPORT_SYMBOL(rt6_lookup); | 39 | EXPORT_SYMBOL(rt6_lookup); | 
| 40 | EXPORT_SYMBOL(fl6_sock_lookup); | ||
| 41 | EXPORT_SYMBOL(ipv6_push_nfrag_opts); | 40 | EXPORT_SYMBOL(ipv6_push_nfrag_opts); | 
