Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Auto-update from upstream

Len Brown db9ace70 d8bcd8e4

+338 -79
+3 -18
arch/powerpc/platforms/pseries/xics.c
··· 48 48 .set_affinity = xics_set_affinity 49 49 }; 50 50 51 - static struct hw_interrupt_type xics_8259_pic = { 52 - .typename = " XICS/8259", 53 - .ack = xics_mask_and_ack_irq, 54 - }; 55 - 56 51 /* This is used to map real irq numbers to virtual */ 57 52 static struct radix_tree_root irq_map = RADIX_TREE_INIT(GFP_ATOMIC); 58 53 ··· 362 367 /* for sanity, this had better be < NR_IRQS - 16 */ 363 368 if (vec == xics_irq_8259_cascade_real) { 364 369 irq = i8259_irq(regs); 365 - if (irq == -1) { 366 - /* Spurious cascaded interrupt. Still must ack xics */ 367 - xics_end_irq(irq_offset_up(xics_irq_8259_cascade)); 368 - 369 - irq = -1; 370 - } 370 + xics_end_irq(irq_offset_up(xics_irq_8259_cascade)); 371 371 } else if (vec == XICS_IRQ_SPURIOUS) { 372 372 irq = -1; 373 373 } else { ··· 532 542 xics_irq_8259_cascade_real = *ireg; 533 543 xics_irq_8259_cascade 534 544 = virt_irq_create_mapping(xics_irq_8259_cascade_real); 545 + i8259_init(0, 0); 535 546 of_node_put(np); 536 547 } 537 548 ··· 556 565 #endif /* CONFIG_SMP */ 557 566 } 558 567 559 - xics_8259_pic.enable = i8259_pic.enable; 560 - xics_8259_pic.disable = i8259_pic.disable; 561 - xics_8259_pic.end = i8259_pic.end; 562 - for (i = 0; i < 16; ++i) 563 - get_irq_desc(i)->handler = &xics_8259_pic; 564 - for (; i < NR_IRQS; ++i) 568 + for (i = irq_offset_value(); i < NR_IRQS; ++i) 565 569 get_irq_desc(i)->handler = &xics_pic; 566 570 567 571 xics_setup_cpu(); ··· 576 590 no_action, 0, "8259 cascade", NULL)) 577 591 printk(KERN_ERR "xics_setup_i8259: couldn't get 8259 " 578 592 "cascade\n"); 579 - i8259_init(0, 0); 580 593 } 581 594 return 0; 582 595 }
+3 -3
drivers/media/video/saa7127.c
··· 389 389 static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data *data) 390 390 { 391 391 struct saa7127_state *state = i2c_get_clientdata(client); 392 - u16 cc = data->data[0] << 8 | data->data[1]; 392 + u16 cc = data->data[1] << 8 | data->data[0]; 393 393 int enable = (data->line != 0); 394 394 395 395 if (enable && (data->field != 0 || data->line != 21)) ··· 397 397 if (state->cc_enable != enable) { 398 398 saa7127_dbg("Turn CC %s\n", enable ? "on" : "off"); 399 399 saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, 400 - (enable << 6) | 0x11); 400 + (state->xds_enable << 7) | (enable << 6) | 0x11); 401 401 state->cc_enable = enable; 402 402 } 403 403 if (!enable) ··· 423 423 if (state->xds_enable != enable) { 424 424 saa7127_dbg("Turn XDS %s\n", enable ? "on" : "off"); 425 425 saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, 426 - (enable << 7) | 0x11); 426 + (enable << 7) | (state->cc_enable << 6) | 0x11); 427 427 state->xds_enable = enable; 428 428 } 429 429 if (!enable)
+24 -2
drivers/media/video/saa7134/Kconfig
··· 1 1 config VIDEO_SAA7134 2 2 tristate "Philips SAA7134 support" 3 - depends on VIDEO_DEV && PCI && I2C && SOUND && SND 3 + depends on VIDEO_DEV && PCI && I2C 4 4 select VIDEO_BUF 5 5 select VIDEO_IR 6 6 select VIDEO_TUNER 7 7 select CRC32 8 - select SND_PCM_OSS 9 8 ---help--- 10 9 This is a video4linux driver for Philips SAA713x based 11 10 TV cards. 12 11 13 12 To compile this driver as a module, choose M here: the 14 13 module will be called saa7134. 14 + 15 + config VIDEO_SAA7134_ALSA 16 + tristate "Philips SAA7134 DMA audio support" 17 + depends on VIDEO_SAA7134 && SOUND && SND && (!VIDEO_SAA7134_OSS || VIDEO_SAA7134_OSS = m) 18 + select SND_PCM_OSS 19 + ---help--- 20 + This is a video4linux driver for direct (DMA) audio in 21 + Philips SAA713x based TV cards using ALSA 22 + 23 + To compile this driver as a module, choose M here: the 24 + module will be called saa7134-alsa. 25 + 26 + config VIDEO_SAA7134_OSS 27 + tristate "Philips SAA7134 DMA audio support (OSS, DEPRECATED)" 28 + depends on VIDEO_SAA7134 && SOUND_PRIME && (!VIDEO_SAA7134_ALSA || VIDEO_SAA7134_ALSA = m) 29 + ---help--- 30 + This is a video4linux driver for direct (DMA) audio in 31 + Philips SAA713x based TV cards using OSS 32 + 33 + This is deprecated in favor of the ALSA module 34 + 35 + To compile this driver as a module, choose M here: the 36 + module will be called saa7134-oss. 15 37 16 38 config VIDEO_SAA7134_DVB 17 39 tristate "DVB/ATSC Support for saa7134 based TV cards"
+5 -2
drivers/media/video/saa7134/Makefile
··· 4 4 saa7134-video.o saa7134-input.o 5 5 6 6 obj-$(CONFIG_VIDEO_SAA7134) += saa7134.o saa7134-empress.o \ 7 - saa6752hs.o saa7134-alsa.o \ 8 - saa7134-oss.o 7 + saa6752hs.o 8 + 9 + obj-$(CONFIG_VIDEO_SAA7134_ALSA) += saa7134-alsa.o 10 + obj-$(CONFIG_VIDEO_SAA7134_OSS) += saa7134-oss.o 11 + 9 12 obj-$(CONFIG_VIDEO_SAA7134_DVB) += saa7134-dvb.o 10 13 11 14 EXTRA_CFLAGS += -I$(src)/..
+12 -4
drivers/media/video/saa7134/saa7134-alsa.c
··· 989 989 struct saa7134_dev *dev = NULL; 990 990 struct list_head *list; 991 991 992 + if (!dmasound_init && !dmasound_exit) { 993 + dmasound_init = alsa_device_init; 994 + dmasound_exit = alsa_device_exit; 995 + } else { 996 + printk(KERN_WARNING "saa7134 ALSA: can't load, DMA sound handler already assigned (probably to OSS)\n"); 997 + return -EBUSY; 998 + } 999 + 992 1000 printk(KERN_INFO "saa7134 ALSA driver for DMA sound loaded\n"); 993 1001 994 1002 list_for_each(list,&saa7134_devlist) { ··· 1008 1000 return -EBUSY; 1009 1001 } 1010 1002 } 1011 - 1012 - dmasound_init = alsa_device_init; 1013 - dmasound_exit = alsa_device_exit; 1014 1003 1015 1004 if (dev == NULL) 1016 1005 printk(KERN_INFO "saa7134 ALSA: no saa7134 cards found\n"); ··· 1028 1023 snd_card_free(snd_saa7134_cards[idx]); 1029 1024 } 1030 1025 1026 + dmasound_init = NULL; 1027 + dmasound_exit = NULL; 1031 1028 printk(KERN_INFO "saa7134 ALSA driver for DMA sound unloaded\n"); 1032 1029 1033 1030 return; 1034 1031 } 1035 1032 1036 - module_init(saa7134_alsa_init); 1033 + /* We initialize this late, to make sure the sound system is up and running */ 1034 + late_initcall(saa7134_alsa_init); 1037 1035 module_exit(saa7134_alsa_exit); 1038 1036 MODULE_LICENSE("GPL"); 1039 1037 MODULE_AUTHOR("Ricardo Cerqueira");
+14 -4
drivers/media/video/saa7134/saa7134-oss.c
··· 959 959 struct saa7134_dev *dev = NULL; 960 960 struct list_head *list; 961 961 962 + if (!dmasound_init && !dmasound_exit) { 963 + dmasound_init = oss_device_init; 964 + dmasound_exit = oss_device_exit; 965 + } else { 966 + printk(KERN_WARNING "saa7134 OSS: can't load, DMA sound handler already assigned (probably to ALSA)\n"); 967 + return -EBUSY; 968 + } 969 + 962 970 printk(KERN_INFO "saa7134 OSS driver for DMA sound loaded\n"); 971 + 963 972 964 973 list_for_each(list,&saa7134_devlist) { 965 974 dev = list_entry(list, struct saa7134_dev, devlist); ··· 982 973 983 974 if (dev == NULL) 984 975 printk(KERN_INFO "saa7134 OSS: no saa7134 cards found\n"); 985 - 986 - dmasound_init = oss_device_init; 987 - dmasound_exit = oss_device_exit; 988 976 989 977 return 0; 990 978 ··· 1003 997 1004 998 } 1005 999 1000 + dmasound_init = NULL; 1001 + dmasound_exit = NULL; 1002 + 1006 1003 printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n"); 1007 1004 1008 1005 return; 1009 1006 } 1010 1007 1011 - module_init(saa7134_oss_init); 1008 + /* We initialize this late, to make sure the sound system is up and running */ 1009 + late_initcall(saa7134_oss_init); 1012 1010 module_exit(saa7134_oss_exit); 1013 1011 MODULE_LICENSE("GPL"); 1014 1012 MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
+38 -10
drivers/scsi/scsi_scan.c
··· 400 400 return found_target; 401 401 } 402 402 403 + struct work_queue_wrapper { 404 + struct work_struct work; 405 + struct scsi_target *starget; 406 + }; 407 + 408 + static void scsi_target_reap_work(void *data) { 409 + struct work_queue_wrapper *wqw = (struct work_queue_wrapper *)data; 410 + struct scsi_target *starget = wqw->starget; 411 + struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 412 + unsigned long flags; 413 + 414 + kfree(wqw); 415 + 416 + spin_lock_irqsave(shost->host_lock, flags); 417 + 418 + if (--starget->reap_ref == 0 && list_empty(&starget->devices)) { 419 + list_del_init(&starget->siblings); 420 + spin_unlock_irqrestore(shost->host_lock, flags); 421 + device_del(&starget->dev); 422 + transport_unregister_device(&starget->dev); 423 + put_device(&starget->dev); 424 + return; 425 + 426 + } 427 + spin_unlock_irqrestore(shost->host_lock, flags); 428 + 429 + return; 430 + } 431 + 403 432 /** 404 433 * scsi_target_reap - check to see if target is in use and destroy if not 405 434 * ··· 440 411 */ 441 412 void scsi_target_reap(struct scsi_target *starget) 442 413 { 443 - struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 444 - unsigned long flags; 445 - spin_lock_irqsave(shost->host_lock, flags); 414 + struct work_queue_wrapper *wqw = 415 + kzalloc(sizeof(struct work_queue_wrapper), GFP_ATOMIC); 446 416 447 - if (--starget->reap_ref == 0 && list_empty(&starget->devices)) { 448 - list_del_init(&starget->siblings); 449 - spin_unlock_irqrestore(shost->host_lock, flags); 450 - device_del(&starget->dev); 451 - transport_unregister_device(&starget->dev); 452 - put_device(&starget->dev); 417 + if (!wqw) { 418 + starget_printk(KERN_ERR, starget, 419 + "Failed to allocate memory in scsi_reap_target()\n"); 453 420 return; 454 421 } 455 - spin_unlock_irqrestore(shost->host_lock, flags); 422 + 423 + INIT_WORK(&wqw->work, scsi_target_reap_work, wqw); 424 + wqw->starget = starget; 425 + schedule_work(&wqw->work); 456 426 } 457 427 458 428 /**
+55 -4
drivers/scsi/scsi_transport_fc.c
··· 105 105 { FC_PORTSTATE_LINKDOWN, "Linkdown" }, 106 106 { FC_PORTSTATE_ERROR, "Error" }, 107 107 { FC_PORTSTATE_LOOPBACK, "Loopback" }, 108 + { FC_PORTSTATE_DELETED, "Deleted" }, 108 109 }; 109 110 fc_enum_name_search(port_state, fc_port_state, fc_port_state_names) 110 111 #define FC_PORTSTATE_MAX_NAMELEN 20 ··· 212 211 #define FC_MGMTSRVR_PORTID 0x00000a 213 212 214 213 214 + static void fc_shost_remove_rports(void *data); 215 215 static void fc_timeout_deleted_rport(void *data); 216 216 static void fc_scsi_scan_rport(void *data); 217 217 static void fc_rport_terminate(struct fc_rport *rport); ··· 320 318 fc_host_next_rport_number(shost) = 0; 321 319 fc_host_next_target_id(shost) = 0; 322 320 321 + fc_host_flags(shost) = 0; 322 + INIT_WORK(&fc_host_rport_del_work(shost), fc_shost_remove_rports, shost); 323 323 return 0; 324 324 } 325 325 ··· 391 387 struct fc_internal *i = to_fc_internal(shost->transportt); \ 392 388 if ((i->f->get_rport_##field) && \ 393 389 !((rport->port_state == FC_PORTSTATE_BLOCKED) || \ 390 + (rport->port_state == FC_PORTSTATE_DELETED) || \ 394 391 (rport->port_state == FC_PORTSTATE_NOTPRESENT))) \ 395 392 i->f->get_rport_##field(rport); \ 396 393 return snprintf(buf, sz, format_string, cast rport->field); \ ··· 407 402 struct Scsi_Host *shost = rport_to_shost(rport); \ 408 403 struct fc_internal *i = to_fc_internal(shost->transportt); \ 409 404 if ((rport->port_state == FC_PORTSTATE_BLOCKED) || \ 405 + (rport->port_state == FC_PORTSTATE_DELETED) || \ 410 406 (rport->port_state == FC_PORTSTATE_NOTPRESENT)) \ 411 407 return -EBUSY; \ 412 408 val = simple_strtoul(buf, NULL, 0); \ ··· 525 519 struct Scsi_Host *shost = rport_to_shost(rport); 526 520 struct fc_internal *i = to_fc_internal(shost->transportt); 527 521 if ((rport->port_state == FC_PORTSTATE_BLOCKED) || 522 + (rport->port_state == FC_PORTSTATE_DELETED) || 528 523 (rport->port_state == FC_PORTSTATE_NOTPRESENT)) 529 524 return -EBUSY; 530 525 val = simple_strtoul(buf, NULL, 0); ··· 1776 1769 rport->maxframe_size = -1; 1777 1770 rport->supported_classes = FC_COS_UNSPECIFIED; 1778 1771 rport->roles = FC_RPORT_ROLE_UNKNOWN; 1779 - rport->port_state = FC_PORTSTATE_NOTPRESENT; 1772 + rport->port_state = FC_PORTSTATE_DELETED; 1780 1773 1781 1774 /* remove the identifiers that aren't used in the consisting binding */ 1782 1775 switch (fc_host_tgtid_bind_type(shost)) { ··· 1796 1789 break; 1797 1790 } 1798 1791 1799 - spin_unlock_irqrestore(shost->host_lock, flags); 1800 - 1801 1792 /* 1802 1793 * As this only occurs if the remote port (scsi target) 1803 1794 * went away and didn't come back - we'll remove 1804 1795 * all attached scsi devices. 1796 + * 1797 + * We'll schedule the shost work item to perform the actual removal 1798 + * to avoid recursion in the different flush calls if we perform 1799 + * the removal in each target - and there are lots of targets 1800 + * whose timeouts fire at the same time. 1805 1801 */ 1806 - fc_rport_tgt_remove(rport); 1802 + 1803 + if ( !(fc_host_flags(shost) & FC_SHOST_RPORT_DEL_SCHEDULED)) { 1804 + fc_host_flags(shost) |= FC_SHOST_RPORT_DEL_SCHEDULED; 1805 + scsi_queue_work(shost, &fc_host_rport_del_work(shost)); 1806 + } 1807 + 1808 + spin_unlock_irqrestore(shost->host_lock, flags); 1807 1809 } 1808 1810 1809 1811 /** ··· 1831 1815 scsi_target_unblock(&rport->dev); 1832 1816 scsi_scan_target(&rport->dev, rport->channel, rport->scsi_target_id, 1833 1817 SCAN_WILD_CARD, 1); 1818 + } 1819 + 1820 + 1821 + /** 1822 + * fc_shost_remove_rports - called to remove all rports that are marked 1823 + * as in a deleted (not connected) state. 1824 + * 1825 + * @data: shost whose rports are to be looked at 1826 + **/ 1827 + static void 1828 + fc_shost_remove_rports(void *data) 1829 + { 1830 + struct Scsi_Host *shost = (struct Scsi_Host *)data; 1831 + struct fc_rport *rport, *next_rport; 1832 + unsigned long flags; 1833 + 1834 + spin_lock_irqsave(shost->host_lock, flags); 1835 + while (fc_host_flags(shost) & FC_SHOST_RPORT_DEL_SCHEDULED) { 1836 + 1837 + fc_host_flags(shost) &= ~FC_SHOST_RPORT_DEL_SCHEDULED; 1838 + 1839 + restart_search: 1840 + list_for_each_entry_safe(rport, next_rport, 1841 + &fc_host_rport_bindings(shost), peers) { 1842 + if (rport->port_state == FC_PORTSTATE_DELETED) { 1843 + rport->port_state = FC_PORTSTATE_NOTPRESENT; 1844 + spin_unlock_irqrestore(shost->host_lock, flags); 1845 + fc_rport_tgt_remove(rport); 1846 + spin_lock_irqsave(shost->host_lock, flags); 1847 + goto restart_search; 1848 + } 1849 + } 1850 + 1851 + } 1852 + spin_unlock_irqrestore(shost->host_lock, flags); 1834 1853 } 1835 1854 1836 1855
+6 -3
drivers/usb/core/usb.c
··· 1432 1432 mark_quiesced(intf); 1433 1433 } else { 1434 1434 // FIXME else if there's no suspend method, disconnect... 1435 - dev_warn(dev, "no %s?\n", "suspend"); 1435 + dev_warn(dev, "no suspend for driver %s?\n", driver->name); 1436 + mark_quiesced(intf); 1436 1437 status = 0; 1437 1438 } 1438 1439 return status; ··· 1461 1460 } 1462 1461 1463 1462 if ((dev->driver == NULL) || 1464 - (dev->driver_data == &usb_generic_driver_data)) 1463 + (dev->driver_data == &usb_generic_driver_data)) { 1464 + dev->power.power_state.event = PM_EVENT_FREEZE; 1465 1465 return 0; 1466 + } 1466 1467 1467 1468 intf = to_usb_interface(dev); 1468 1469 driver = to_usb_driver(dev->driver); ··· 1484 1481 mark_quiesced(intf); 1485 1482 } 1486 1483 } else 1487 - dev_warn(dev, "no %s?\n", "resume"); 1484 + dev_warn(dev, "no resume for driver %s?\n", driver->name); 1488 1485 return 0; 1489 1486 } 1490 1487
+2 -2
drivers/usb/storage/scsiglue.c
··· 109 109 * data comes from. 110 110 */ 111 111 if (sdev->scsi_level < SCSI_2) 112 - sdev->scsi_level = SCSI_2; 112 + sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2; 113 113 114 114 /* According to the technical support people at Genesys Logic, 115 115 * devices using their chips have problems transferring more than ··· 162 162 * a Get-Max-LUN request, we won't lose much by setting the 163 163 * revision level down to 2. The only devices that would be 164 164 * affected are those with sparse LUNs. */ 165 - sdev->scsi_level = SCSI_2; 165 + sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2; 166 166 167 167 /* USB-IDE bridges tend to report SK = 0x04 (Non-recoverable 168 168 * Hardware Error) when any low-level error occurs,
+2 -1
fs/nfs/file.c
··· 509 509 return -EINVAL; 510 510 511 511 /* No mandatory locks over NFS */ 512 - if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID) 512 + if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID && 513 + fl->fl_type != F_UNLCK) 513 514 return -ENOLCK; 514 515 515 516 if (IS_GETLK(cmd))
+1
include/linux/ipv6_route.h
··· 18 18 fallback, no routers on link */ 19 19 #define RTF_ADDRCONF 0x00040000 /* addrconf route - RA */ 20 20 #define RTF_PREFIX_RT 0x00080000 /* A prefix only route - RA */ 21 + #define RTF_ANYCAST 0x00100000 /* Anycast */ 21 22 22 23 #define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */ 23 24 #define RTF_EXPIRES 0x00400000
+1 -1
include/linux/irq.h
··· 10 10 */ 11 11 12 12 #include <linux/config.h> 13 - #include <asm/smp.h> /* cpu_online_map */ 13 + #include <linux/smp.h> 14 14 15 15 #if !defined(CONFIG_ARCH_S390) 16 16
+1
include/linux/preempt.h
··· 48 48 #define preempt_enable() \ 49 49 do { \ 50 50 preempt_enable_no_resched(); \ 51 + barrier(); \ 51 52 preempt_check_resched(); \ 52 53 } while (0) 53 54
+1
include/net/if_inet6.h
··· 24 24 #define IF_RA_MANAGED 0x40 25 25 #define IF_RA_RCVD 0x20 26 26 #define IF_RS_SENT 0x10 27 + #define IF_READY 0x80000000 27 28 28 29 /* prefix flags */ 29 30 #define IF_PREFIX_ONLINK 0x01
+11
include/scsi/scsi_transport_fc.h
··· 79 79 FC_PORTSTATE_LINKDOWN, 80 80 FC_PORTSTATE_ERROR, 81 81 FC_PORTSTATE_LOOPBACK, 82 + FC_PORTSTATE_DELETED, 82 83 }; 83 84 84 85 ··· 326 325 struct list_head rport_bindings; 327 326 u32 next_rport_number; 328 327 u32 next_target_id; 328 + u8 flags; 329 + struct work_struct rport_del_work; 329 330 }; 331 + 332 + /* values for struct fc_host_attrs "flags" field: */ 333 + #define FC_SHOST_RPORT_DEL_SCHEDULED 0x01 334 + 330 335 331 336 #define fc_host_node_name(x) \ 332 337 (((struct fc_host_attrs *)(x)->shost_data)->node_name) ··· 372 365 (((struct fc_host_attrs *)(x)->shost_data)->next_rport_number) 373 366 #define fc_host_next_target_id(x) \ 374 367 (((struct fc_host_attrs *)(x)->shost_data)->next_target_id) 368 + #define fc_host_flags(x) \ 369 + (((struct fc_host_attrs *)(x)->shost_data)->flags) 370 + #define fc_host_rport_del_work(x) \ 371 + (((struct fc_host_attrs *)(x)->shost_data)->rport_del_work) 375 372 376 373 377 374 /* The functions by which the transport class and the driver communicate */
+5 -1
net/8021q/vlan.c
··· 753 753 break; 754 754 case GET_VLAN_REALDEV_NAME_CMD: 755 755 err = vlan_dev_get_realdev_name(args.device1, args.u.device2); 756 + if (err) 757 + goto out; 756 758 if (copy_to_user(arg, &args, 757 759 sizeof(struct vlan_ioctl_args))) { 758 760 err = -EFAULT; ··· 763 761 764 762 case GET_VLAN_VID_CMD: 765 763 err = vlan_dev_get_vid(args.device1, &vid); 764 + if (err) 765 + goto out; 766 766 args.u.VID = vid; 767 767 if (copy_to_user(arg, &args, 768 768 sizeof(struct vlan_ioctl_args))) { ··· 778 774 __FUNCTION__, args.cmd); 779 775 return -EINVAL; 780 776 }; 781 - 777 + out: 782 778 return err; 783 779 } 784 780
+1 -1
net/dccp/ipv4.c
··· 1251 1251 struct dccp_sock *dp = dccp_sk(sk); 1252 1252 1253 1253 /* 1254 - * DCCP doesn't use sk_qrite_queue, just sk_send_head 1254 + * DCCP doesn't use sk_write_queue, just sk_send_head 1255 1255 * for retransmissions 1256 1256 */ 1257 1257 if (sk->sk_send_head != NULL) {
+98 -13
net/ipv6/addrconf.c
··· 137 137 static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags); 138 138 static void addrconf_dad_timer(unsigned long data); 139 139 static void addrconf_dad_completed(struct inet6_ifaddr *ifp); 140 + static void addrconf_dad_run(struct inet6_dev *idev); 140 141 static void addrconf_rs_timer(unsigned long data); 141 142 static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); 142 143 static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifa); ··· 389 388 } 390 389 #endif 391 390 391 + if (netif_carrier_ok(dev)) 392 + ndev->if_flags |= IF_READY; 393 + 392 394 write_lock_bh(&addrconf_lock); 393 395 dev->ip6_ptr = ndev; 394 396 write_unlock_bh(&addrconf_lock); ··· 419 415 if ((idev = ipv6_add_dev(dev)) == NULL) 420 416 return NULL; 421 417 } 418 + 422 419 if (dev->flags&IFF_UP) 423 420 ipv6_mc_up(idev); 424 421 return idev; ··· 639 634 } 640 635 #endif 641 636 642 - for (ifap = &idev->addr_list; (ifa=*ifap) != NULL; 643 - ifap = &ifa->if_next) { 637 + for (ifap = &idev->addr_list; (ifa=*ifap) != NULL;) { 644 638 if (ifa == ifp) { 645 639 *ifap = ifa->if_next; 646 640 __in6_ifa_put(ifp); ··· 647 643 if (!(ifp->flags & IFA_F_PERMANENT) || onlink > 0) 648 644 break; 649 645 deleted = 1; 646 + continue; 650 647 } else if (ifp->flags & IFA_F_PERMANENT) { 651 648 if (ipv6_prefix_equal(&ifa->addr, &ifp->addr, 652 649 ifp->prefix_len)) { ··· 671 666 } 672 667 } 673 668 } 669 + ifap = &ifa->if_next; 674 670 } 675 671 write_unlock_bh(&idev->lock); 676 672 ··· 909 903 910 904 score.addr_type = __ipv6_addr_type(&ifa->addr); 911 905 912 - /* Rule 0: Candidate Source Address (section 4) 906 + /* Rule 0: 907 + * - Tentative Address (RFC2462 section 5.4) 908 + * - A tentative address is not considered 909 + * "assigned to an interface" in the traditional 910 + * sense. 911 + * - Candidate Source Address (section 4) 913 912 * - In any case, anycast addresses, multicast 914 913 * addresses, and the unspecified address MUST 915 914 * NOT be included in a candidate set. 916 915 */ 916 + if (ifa->flags & IFA_F_TENTATIVE) 917 + continue; 917 918 if (unlikely(score.addr_type == IPV6_ADDR_ANY || 918 919 score.addr_type & IPV6_ADDR_MULTICAST)) { 919 920 LIMIT_NETDEBUG(KERN_DEBUG ··· 1228 1215 1229 1216 /* Gets referenced address, destroys ifaddr */ 1230 1217 1231 - void addrconf_dad_failure(struct inet6_ifaddr *ifp) 1218 + void addrconf_dad_stop(struct inet6_ifaddr *ifp) 1232 1219 { 1233 - if (net_ratelimit()) 1234 - printk(KERN_INFO "%s: duplicate address detected!\n", ifp->idev->dev->name); 1235 1220 if (ifp->flags&IFA_F_PERMANENT) { 1236 1221 spin_lock_bh(&ifp->lock); 1237 1222 addrconf_del_timer(ifp); ··· 1255 1244 ipv6_del_addr(ifp); 1256 1245 } 1257 1246 1247 + void addrconf_dad_failure(struct inet6_ifaddr *ifp) 1248 + { 1249 + if (net_ratelimit()) 1250 + printk(KERN_INFO "%s: duplicate address detected!\n", ifp->idev->dev->name); 1251 + addrconf_dad_stop(ifp); 1252 + } 1258 1253 1259 1254 /* Join to solicited addr multicast group. */ 1260 1255 ··· 2150 2133 { 2151 2134 struct net_device *dev = (struct net_device *) data; 2152 2135 struct inet6_dev *idev = __in6_dev_get(dev); 2136 + int run_pending = 0; 2153 2137 2154 2138 switch(event) { 2155 2139 case NETDEV_UP: 2140 + case NETDEV_CHANGE: 2141 + if (event == NETDEV_UP) { 2142 + if (!netif_carrier_ok(dev)) { 2143 + /* device is not ready yet. */ 2144 + printk(KERN_INFO 2145 + "ADDRCONF(NETDEV_UP): %s: " 2146 + "link is not ready\n", 2147 + dev->name); 2148 + break; 2149 + } 2150 + } else { 2151 + if (!netif_carrier_ok(dev)) { 2152 + /* device is still not ready. */ 2153 + break; 2154 + } 2155 + 2156 + if (idev) { 2157 + if (idev->if_flags & IF_READY) { 2158 + /* device is already configured. */ 2159 + break; 2160 + } 2161 + idev->if_flags |= IF_READY; 2162 + } 2163 + 2164 + printk(KERN_INFO 2165 + "ADDRCONF(NETDEV_CHANGE): %s: " 2166 + "link becomes ready\n", 2167 + dev->name); 2168 + 2169 + run_pending = 1; 2170 + } 2171 + 2156 2172 switch(dev->type) { 2157 2173 case ARPHRD_SIT: 2158 2174 addrconf_sit_config(dev); ··· 2202 2152 break; 2203 2153 }; 2204 2154 if (idev) { 2155 + if (run_pending) 2156 + addrconf_dad_run(idev); 2157 + 2205 2158 /* If the MTU changed during the interface down, when the 2206 2159 interface up, the changed MTU must be reflected in the 2207 2160 idev as well as routers. ··· 2239 2186 */ 2240 2187 addrconf_ifdown(dev, event != NETDEV_DOWN); 2241 2188 break; 2242 - case NETDEV_CHANGE: 2243 - break; 2189 + 2244 2190 case NETDEV_CHANGENAME: 2245 2191 #ifdef CONFIG_SYSCTL 2246 2192 if (idev) { ··· 2320 2268 2321 2269 /* Step 3: clear flags for stateless addrconf */ 2322 2270 if (how != 1) 2323 - idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD); 2271 + idev->if_flags &= ~(IF_RS_SENT|IF_RA_RCVD|IF_READY); 2324 2272 2325 2273 /* Step 4: clear address list */ 2326 2274 #ifdef CONFIG_IPV6_PRIVACY ··· 2429 2377 /* 2430 2378 * Duplicate Address Detection 2431 2379 */ 2380 + static void addrconf_dad_kick(struct inet6_ifaddr *ifp) 2381 + { 2382 + unsigned long rand_num; 2383 + struct inet6_dev *idev = ifp->idev; 2384 + 2385 + rand_num = net_random() % (idev->cnf.rtr_solicit_delay ? : 1); 2386 + ifp->probes = idev->cnf.dad_transmits; 2387 + addrconf_mod_timer(ifp, AC_DAD, rand_num); 2388 + } 2389 + 2432 2390 static void addrconf_dad_start(struct inet6_ifaddr *ifp, u32 flags) 2433 2391 { 2434 2392 struct inet6_dev *idev = ifp->idev; 2435 2393 struct net_device *dev = idev->dev; 2436 - unsigned long rand_num; 2437 2394 2438 2395 addrconf_join_solict(dev, &ifp->addr); 2439 2396 ··· 2451 2390 flags); 2452 2391 2453 2392 net_srandom(ifp->addr.s6_addr32[3]); 2454 - rand_num = net_random() % (idev->cnf.rtr_solicit_delay ? : 1); 2455 2393 2456 2394 read_lock_bh(&idev->lock); 2457 2395 if (ifp->dead) ··· 2467 2407 return; 2468 2408 } 2469 2409 2470 - ifp->probes = idev->cnf.dad_transmits; 2471 - addrconf_mod_timer(ifp, AC_DAD, rand_num); 2410 + if (idev->if_flags & IF_READY) 2411 + addrconf_dad_kick(ifp); 2412 + else { 2413 + /* 2414 + * If the defice is not ready: 2415 + * - keep it tentative if it is a permanent address. 2416 + * - otherwise, kill it. 2417 + */ 2418 + in6_ifa_hold(ifp); 2419 + addrconf_dad_stop(ifp); 2420 + } 2472 2421 2473 2422 spin_unlock_bh(&ifp->lock); 2474 2423 out: ··· 2559 2490 addrconf_mod_timer(ifp, AC_RS, ifp->idev->cnf.rtr_solicit_interval); 2560 2491 spin_unlock_bh(&ifp->lock); 2561 2492 } 2493 + } 2494 + 2495 + static void addrconf_dad_run(struct inet6_dev *idev) { 2496 + struct inet6_ifaddr *ifp; 2497 + 2498 + read_lock_bh(&idev->lock); 2499 + for (ifp = idev->addr_list; ifp; ifp = ifp->if_next) { 2500 + spin_lock_bh(&ifp->lock); 2501 + if (!(ifp->flags & IFA_F_TENTATIVE)) { 2502 + spin_unlock_bh(&ifp->lock); 2503 + continue; 2504 + } 2505 + spin_unlock_bh(&ifp->lock); 2506 + addrconf_dad_kick(ifp); 2507 + } 2508 + read_unlock_bh(&idev->lock); 2562 2509 } 2563 2510 2564 2511 #ifdef CONFIG_PROC_FS
+14 -2
net/ipv6/icmp.c
··· 328 328 iif = skb->dev->ifindex; 329 329 330 330 /* 331 - * Must not send if we know that source is Anycast also. 332 - * for now we don't know that. 331 + * Must not send error if the source does not uniquely 332 + * identify a single node (RFC2463 Section 2.4). 333 + * We check unspecified / multicast addresses here, 334 + * and anycast addresses will be checked later. 333 335 */ 334 336 if ((addr_type == IPV6_ADDR_ANY) || (addr_type & IPV6_ADDR_MULTICAST)) { 335 337 LIMIT_NETDEBUG(KERN_DEBUG "icmpv6_send: addr_any/mcast source\n"); ··· 375 373 err = ip6_dst_lookup(sk, &dst, &fl); 376 374 if (err) 377 375 goto out; 376 + 377 + /* 378 + * We won't send icmp if the destination is known 379 + * anycast. 380 + */ 381 + if (((struct rt6_info *)dst)->rt6i_flags & RTF_ANYCAST) { 382 + LIMIT_NETDEBUG(KERN_DEBUG "icmpv6_send: acast source\n"); 383 + goto out_dst_release; 384 + } 385 + 378 386 if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) 379 387 goto out; 380 388
+9 -4
net/ipv6/route.c
··· 413 413 rt = ip6_rt_copy(ort); 414 414 415 415 if (rt) { 416 - ipv6_addr_copy(&rt->rt6i_dst.addr, daddr); 417 - 418 - if (!(rt->rt6i_flags&RTF_GATEWAY)) 416 + if (!(rt->rt6i_flags&RTF_GATEWAY)) { 417 + if (rt->rt6i_dst.plen != 128 && 418 + ipv6_addr_equal(&rt->rt6i_dst.addr, daddr)) 419 + rt->rt6i_flags |= RTF_ANYCAST; 419 420 ipv6_addr_copy(&rt->rt6i_gateway, daddr); 421 + } 420 422 423 + ipv6_addr_copy(&rt->rt6i_dst.addr, daddr); 421 424 rt->rt6i_dst.plen = 128; 422 425 rt->rt6i_flags |= RTF_CACHE; 423 426 rt->u.dst.flags |= DST_HOST; ··· 1416 1413 rt->u.dst.obsolete = -1; 1417 1414 1418 1415 rt->rt6i_flags = RTF_UP | RTF_NONEXTHOP; 1419 - if (!anycast) 1416 + if (anycast) 1417 + rt->rt6i_flags |= RTF_ANYCAST; 1418 + else 1420 1419 rt->rt6i_flags |= RTF_LOCAL; 1421 1420 rt->rt6i_nexthop = ndisc_get_neigh(rt->rt6i_dev, &rt->rt6i_gateway); 1422 1421 if (rt->rt6i_nexthop == NULL) {
+3 -3
net/netrom/nr_in.c
··· 99 99 break; 100 100 101 101 case NR_RESET: 102 - if (sysctl_netrom_reset_circuit); 102 + if (sysctl_netrom_reset_circuit) 103 103 nr_disconnect(sk, ECONNRESET); 104 104 break; 105 105 ··· 130 130 break; 131 131 132 132 case NR_RESET: 133 - if (sysctl_netrom_reset_circuit); 133 + if (sysctl_netrom_reset_circuit) 134 134 nr_disconnect(sk, ECONNRESET); 135 135 break; 136 136 ··· 265 265 break; 266 266 267 267 case NR_RESET: 268 - if (sysctl_netrom_reset_circuit); 268 + if (sysctl_netrom_reset_circuit) 269 269 nr_disconnect(sk, ECONNRESET); 270 270 break; 271 271
+29 -1
net/xfrm/xfrm_policy.c
··· 346 346 struct xfrm_policy *pol, **p; 347 347 struct xfrm_policy *delpol = NULL; 348 348 struct xfrm_policy **newpos = NULL; 349 + struct dst_entry *gc_list; 349 350 350 351 write_lock_bh(&xfrm_policy_lock); 351 352 for (p = &xfrm_policy_list[dir]; (pol=*p)!=NULL;) { ··· 382 381 xfrm_pol_hold(policy); 383 382 write_unlock_bh(&xfrm_policy_lock); 384 383 385 - if (delpol) { 384 + if (delpol) 386 385 xfrm_policy_kill(delpol); 386 + 387 + read_lock_bh(&xfrm_policy_lock); 388 + gc_list = NULL; 389 + for (policy = policy->next; policy; policy = policy->next) { 390 + struct dst_entry *dst; 391 + 392 + write_lock(&policy->lock); 393 + dst = policy->bundles; 394 + if (dst) { 395 + struct dst_entry *tail = dst; 396 + while (tail->next) 397 + tail = tail->next; 398 + tail->next = gc_list; 399 + gc_list = dst; 400 + 401 + policy->bundles = NULL; 402 + } 403 + write_unlock(&policy->lock); 387 404 } 405 + read_unlock_bh(&xfrm_policy_lock); 406 + 407 + while (gc_list) { 408 + struct dst_entry *dst = gc_list; 409 + 410 + gc_list = dst->next; 411 + dst_free(dst); 412 + } 413 + 388 414 return 0; 389 415 } 390 416 EXPORT_SYMBOL(xfrm_policy_insert);