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

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