Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

+131 -37
+18 -1
drivers/bluetooth/hci_usb.c
··· 65 65 #endif 66 66 67 67 static int ignore = 0; 68 + static int ignore_csr = 0; 69 + static int ignore_sniffer = 0; 68 70 static int reset = 0; 69 71 70 72 #ifdef CONFIG_BT_HCIUSB_SCO 71 73 static int isoc = 2; 72 74 #endif 73 75 74 - #define VERSION "2.8" 76 + #define VERSION "2.9" 75 77 76 78 static struct usb_driver hci_usb_driver; 77 79 ··· 100 98 MODULE_DEVICE_TABLE (usb, bluetooth_ids); 101 99 102 100 static struct usb_device_id blacklist_ids[] = { 101 + /* CSR BlueCore devices */ 102 + { USB_DEVICE(0x0a12, 0x0001), .driver_info = HCI_CSR }, 103 + 103 104 /* Broadcom BCM2033 without firmware */ 104 105 { USB_DEVICE(0x0a5c, 0x2033), .driver_info = HCI_IGNORE }, 105 106 ··· 841 836 if (ignore || id->driver_info & HCI_IGNORE) 842 837 return -ENODEV; 843 838 839 + if (ignore_csr && id->driver_info & HCI_CSR) 840 + return -ENODEV; 841 + 842 + if (ignore_sniffer && id->driver_info & HCI_SNIFFER) 843 + return -ENODEV; 844 + 844 845 if (intf->cur_altsetting->desc.bInterfaceNumber > 0) 845 846 return -ENODEV; 846 847 ··· 1071 1060 1072 1061 module_param(ignore, bool, 0644); 1073 1062 MODULE_PARM_DESC(ignore, "Ignore devices from the matching table"); 1063 + 1064 + module_param(ignore_csr, bool, 0644); 1065 + MODULE_PARM_DESC(ignore_csr, "Ignore devices with id 0a12:0001"); 1066 + 1067 + module_param(ignore_sniffer, bool, 0644); 1068 + MODULE_PARM_DESC(ignore_sniffer, "Ignore devices with id 0a12:0002"); 1074 1069 1075 1070 module_param(reset, bool, 0644); 1076 1071 MODULE_PARM_DESC(reset, "Send HCI reset command on initialization");
+3 -2
drivers/bluetooth/hci_usb.h
··· 31 31 #define HCI_IGNORE 0x01 32 32 #define HCI_RESET 0x02 33 33 #define HCI_DIGIANSWER 0x04 34 - #define HCI_SNIFFER 0x08 35 - #define HCI_BROKEN_ISOC 0x10 34 + #define HCI_CSR 0x08 35 + #define HCI_SNIFFER 0x10 36 36 #define HCI_BCM92035 0x20 37 + #define HCI_BROKEN_ISOC 0x40 37 38 38 39 #define HCI_MAX_IFACE_NUM 3 39 40
+11
include/net/bluetooth/hci.h
··· 463 463 __s8 rssi; 464 464 } __attribute__ ((packed)); 465 465 466 + #define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2F 467 + struct extended_inquiry_info { 468 + bdaddr_t bdaddr; 469 + __u8 pscan_rep_mode; 470 + __u8 pscan_period_mode; 471 + __u8 dev_class[3]; 472 + __u16 clock_offset; 473 + __s8 rssi; 474 + __u8 data[240]; 475 + } __attribute__ ((packed)); 476 + 466 477 #define HCI_EV_CONN_COMPLETE 0x03 467 478 struct hci_ev_conn_complete { 468 479 __u8 status;
+33
net/bluetooth/hci_event.c
··· 558 558 hci_dev_unlock(hdev); 559 559 } 560 560 561 + /* Extended Inquiry Result */ 562 + static inline void hci_extended_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff *skb) 563 + { 564 + struct inquiry_data data; 565 + struct extended_inquiry_info *info = (struct extended_inquiry_info *) (skb->data + 1); 566 + int num_rsp = *((__u8 *) skb->data); 567 + 568 + BT_DBG("%s num_rsp %d", hdev->name, num_rsp); 569 + 570 + if (!num_rsp) 571 + return; 572 + 573 + hci_dev_lock(hdev); 574 + 575 + for (; num_rsp; num_rsp--) { 576 + bacpy(&data.bdaddr, &info->bdaddr); 577 + data.pscan_rep_mode = info->pscan_rep_mode; 578 + data.pscan_period_mode = info->pscan_period_mode; 579 + data.pscan_mode = 0x00; 580 + memcpy(data.dev_class, info->dev_class, 3); 581 + data.clock_offset = info->clock_offset; 582 + data.rssi = info->rssi; 583 + info++; 584 + hci_inquiry_cache_update(hdev, &data); 585 + } 586 + 587 + hci_dev_unlock(hdev); 588 + } 589 + 561 590 /* Connect Request */ 562 591 static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb) 563 592 { ··· 967 938 968 939 case HCI_EV_INQUIRY_RESULT_WITH_RSSI: 969 940 hci_inquiry_result_with_rssi_evt(hdev, skb); 941 + break; 942 + 943 + case HCI_EV_EXTENDED_INQUIRY_RESULT: 944 + hci_extended_inquiry_result_evt(hdev, skb); 970 945 break; 971 946 972 947 case HCI_EV_CONN_REQUEST:
+26 -6
net/bluetooth/rfcomm/sock.c
··· 363 363 goto done; 364 364 } 365 365 366 + if (sk->sk_type != SOCK_STREAM) { 367 + err = -EINVAL; 368 + goto done; 369 + } 370 + 366 371 write_lock_bh(&rfcomm_sk_list.lock); 367 372 368 373 if (sa->rc_channel && __rfcomm_get_sock_by_addr(sa->rc_channel, &sa->rc_bdaddr)) { ··· 398 393 if (addr->sa_family != AF_BLUETOOTH || alen < sizeof(struct sockaddr_rc)) 399 394 return -EINVAL; 400 395 401 - if (sk->sk_state != BT_OPEN && sk->sk_state != BT_BOUND) 402 - return -EBADFD; 403 - 404 - if (sk->sk_type != SOCK_STREAM) 405 - return -EINVAL; 406 - 407 396 lock_sock(sk); 397 + 398 + if (sk->sk_state != BT_OPEN && sk->sk_state != BT_BOUND) { 399 + err = -EBADFD; 400 + goto done; 401 + } 402 + 403 + if (sk->sk_type != SOCK_STREAM) { 404 + err = -EINVAL; 405 + goto done; 406 + } 408 407 409 408 sk->sk_state = BT_CONNECT; 410 409 bacpy(&bt_sk(sk)->dst, &sa->rc_bdaddr); ··· 419 410 err = bt_sock_wait_state(sk, BT_CONNECTED, 420 411 sock_sndtimeo(sk, flags & O_NONBLOCK)); 421 412 413 + done: 422 414 release_sock(sk); 423 415 return err; 424 416 } ··· 435 425 436 426 if (sk->sk_state != BT_BOUND) { 437 427 err = -EBADFD; 428 + goto done; 429 + } 430 + 431 + if (sk->sk_type != SOCK_STREAM) { 432 + err = -EINVAL; 438 433 goto done; 439 434 } 440 435 ··· 484 469 485 470 if (sk->sk_state != BT_LISTEN) { 486 471 err = -EBADFD; 472 + goto done; 473 + } 474 + 475 + if (sk->sk_type != SOCK_STREAM) { 476 + err = -EINVAL; 487 477 goto done; 488 478 } 489 479
+8 -1
net/dccp/input.c
··· 50 50 return; 51 51 } 52 52 53 - dccp_set_state(sk, DCCP_CLOSING); 53 + if (sk->sk_state != DCCP_CLOSING) 54 + dccp_set_state(sk, DCCP_CLOSING); 54 55 dccp_send_close(sk, 0); 55 56 } 56 57 ··· 560 559 } else if (dh->dccph_type == DCCP_PKT_CLOSE) { 561 560 dccp_rcv_close(sk, skb); 562 561 return 0; 562 + } 563 + 564 + if (unlikely(dh->dccph_type == DCCP_PKT_SYNC)) { 565 + dccp_send_sync(sk, DCCP_SKB_CB(skb)->dccpd_seq, 566 + DCCP_PKT_SYNCACK); 567 + goto discard; 563 568 } 564 569 565 570 switch (sk->sk_state) {
+3 -3
net/ipv4/netfilter/ip_conntrack_ftp.c
··· 29 29 static DEFINE_SPINLOCK(ip_ftp_lock); 30 30 31 31 #define MAX_PORTS 8 32 - static int ports[MAX_PORTS]; 32 + static short ports[MAX_PORTS]; 33 33 static int ports_c; 34 - module_param_array(ports, int, &ports_c, 0400); 34 + module_param_array(ports, short, &ports_c, 0400); 35 35 36 36 static int loose; 37 37 module_param(loose, int, 0600); ··· 450 450 } 451 451 452 452 static struct ip_conntrack_helper ftp[MAX_PORTS]; 453 - static char ftp_names[MAX_PORTS][10]; 453 + static char ftp_names[MAX_PORTS][sizeof("ftp-65535")]; 454 454 455 455 /* Not __exit: called from init() */ 456 456 static void fini(void)
+3 -3
net/ipv4/netfilter/ip_conntrack_irc.c
··· 34 34 #include <linux/moduleparam.h> 35 35 36 36 #define MAX_PORTS 8 37 - static int ports[MAX_PORTS]; 37 + static short ports[MAX_PORTS]; 38 38 static int ports_c; 39 39 static int max_dcc_channels = 8; 40 40 static unsigned int dcc_timeout = 300; ··· 52 52 MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>"); 53 53 MODULE_DESCRIPTION("IRC (DCC) connection tracking helper"); 54 54 MODULE_LICENSE("GPL"); 55 - module_param_array(ports, int, &ports_c, 0400); 55 + module_param_array(ports, short, &ports_c, 0400); 56 56 MODULE_PARM_DESC(ports, "port numbers of IRC servers"); 57 57 module_param(max_dcc_channels, int, 0400); 58 58 MODULE_PARM_DESC(max_dcc_channels, "max number of expected DCC channels per IRC session"); ··· 240 240 } 241 241 242 242 static struct ip_conntrack_helper irc_helpers[MAX_PORTS]; 243 - static char irc_names[MAX_PORTS][10]; 243 + static char irc_names[MAX_PORTS][sizeof("irc-65535")]; 244 244 245 245 static void fini(void); 246 246
+7 -12
net/ipv4/netfilter/ip_conntrack_netbios_ns.c
··· 23 23 #include <linux/inetdevice.h> 24 24 #include <linux/in.h> 25 25 #include <linux/ip.h> 26 - #include <linux/udp.h> 27 26 #include <net/route.h> 28 27 29 28 #include <linux/netfilter.h> 30 29 #include <linux/netfilter_ipv4.h> 31 30 #include <linux/netfilter_ipv4/ip_conntrack.h> 32 31 #include <linux/netfilter_ipv4/ip_conntrack_helper.h> 32 + 33 + #define NMBD_PORT 137 33 34 34 35 MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>"); 35 36 MODULE_DESCRIPTION("NetBIOS name service broadcast connection tracking helper"); ··· 45 44 { 46 45 struct ip_conntrack_expect *exp; 47 46 struct iphdr *iph = (*pskb)->nh.iph; 48 - struct udphdr _uh, *uh; 49 47 struct rtable *rt = (struct rtable *)(*pskb)->dst; 50 48 struct in_device *in_dev; 51 49 u_int32_t mask = 0; ··· 72 72 if (mask == 0) 73 73 goto out; 74 74 75 - uh = skb_header_pointer(*pskb, iph->ihl * 4, sizeof(_uh), &_uh); 76 - BUG_ON(uh == NULL); 77 - 78 75 exp = ip_conntrack_expect_alloc(ct); 79 76 if (exp == NULL) 80 77 goto out; 81 - memset(&exp->tuple, 0, sizeof(exp->tuple)); 82 - exp->tuple.src.ip = iph->daddr & mask; 83 - exp->tuple.dst.ip = iph->saddr; 84 - exp->tuple.dst.u.udp.port = uh->source; 85 - exp->tuple.dst.protonum = IPPROTO_UDP; 86 78 87 - memset(&exp->mask, 0, sizeof(exp->mask)); 79 + exp->tuple = ct->tuplehash[IP_CT_DIR_REPLY].tuple; 80 + exp->tuple.src.u.udp.port = ntohs(NMBD_PORT); 81 + 88 82 exp->mask.src.ip = mask; 83 + exp->mask.src.u.udp.port = 0xFFFF; 89 84 exp->mask.dst.ip = 0xFFFFFFFF; 90 85 exp->mask.dst.u.udp.port = 0xFFFF; 91 86 exp->mask.dst.protonum = 0xFF; ··· 102 107 .src = { 103 108 .u = { 104 109 .udp = { 105 - .port = __constant_htons(137), 110 + .port = __constant_htons(NMBD_PORT), 106 111 } 107 112 } 108 113 },
+3 -3
net/ipv4/netfilter/ip_conntrack_tftp.c
··· 26 26 MODULE_LICENSE("GPL"); 27 27 28 28 #define MAX_PORTS 8 29 - static int ports[MAX_PORTS]; 29 + static short ports[MAX_PORTS]; 30 30 static int ports_c; 31 - module_param_array(ports, int, &ports_c, 0400); 31 + module_param_array(ports, short, &ports_c, 0400); 32 32 MODULE_PARM_DESC(ports, "port numbers of tftp servers"); 33 33 34 34 #if 0 ··· 100 100 } 101 101 102 102 static struct ip_conntrack_helper tftp[MAX_PORTS]; 103 - static char tftp_names[MAX_PORTS][10]; 103 + static char tftp_names[MAX_PORTS][sizeof("tftp-65535")]; 104 104 105 105 static void fini(void) 106 106 {
+6
net/ipv4/netfilter/ipt_MASQUERADE.c
··· 90 90 IP_NF_ASSERT(ct && (ctinfo == IP_CT_NEW || ctinfo == IP_CT_RELATED 91 91 || ctinfo == IP_CT_RELATED + IP_CT_IS_REPLY)); 92 92 93 + /* Source address is 0.0.0.0 - locally generated packet that is 94 + * probably not supposed to be masqueraded. 95 + */ 96 + if (ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.ip == 0) 97 + return NF_ACCEPT; 98 + 93 99 mr = targinfo; 94 100 rt = (struct rtable *)(*pskb)->dst; 95 101 newsrc = inet_select_addr(out, rt->rt_gateway, RT_SCOPE_UNIVERSE);
+10 -6
net/ipv4/netfilter/ipt_REDIRECT.c
··· 88 88 newdst = htonl(0x7F000001); 89 89 else { 90 90 struct in_device *indev; 91 + struct in_ifaddr *ifa; 91 92 92 - /* Device might not have an associated in_device. */ 93 - indev = (struct in_device *)(*pskb)->dev->ip_ptr; 94 - if (indev == NULL || indev->ifa_list == NULL) 93 + newdst = 0; 94 + 95 + rcu_read_lock(); 96 + indev = __in_dev_get((*pskb)->dev); 97 + if (indev && (ifa = indev->ifa_list)) 98 + newdst = ifa->ifa_local; 99 + rcu_read_unlock(); 100 + 101 + if (!newdst) 95 102 return NF_DROP; 96 - 97 - /* Grab first address on interface. */ 98 - newdst = indev->ifa_list->ifa_local; 99 103 } 100 104 101 105 /* Transfer from original range. */