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

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (21 commits)
[PKT_SCHED]: vlan tag match
[NET]: Add if_addrlabel.h to sanitized headers.
[NET] rtnetlink.c: remove no longer used functions
[ICMP]: Restore pskb_pull calls in receive function
[INET]: Fix accidentally broken inet(6)_hash_connect's port offset calculations.
[NET]: Remove further references to net-modules.txt
bluetooth rfcomm tty: destroy before tty_close()
bluetooth: blacklist another Broadcom BCM2035 device
drivers/bluetooth/btsdio.c: fix double-free
drivers/bluetooth/bpa10x.c: fix memleak
bluetooth: uninlining
bluetooth: hidp_process_hid_control remove unnecessary parameter dealing
tun: impossible to deassert IFF_ONE_QUEUE or IFF_NO_PI
hamradio: fix dmascc section mismatch
[SCTP]: Fix kernel panic while received AUTH chunk with BAD shared key identifier
[SCTP]: Fix kernel panic while received AUTH chunk while enabled auth
[IPV4]: Formatting fix for /proc/net/fib_trie.
[IPV6]: Fix sysctl compilation error.
[NET_SCHED]: Add #ifdef CONFIG_NET_EMATCH in net/sched/cls_flow.c (latest git broken build)
[IPV4]: Fix compile error building without CONFIG_FS_PROC
...

+84 -115
+1
drivers/bluetooth/bpa10x.c
··· 423 423 break; 424 424 425 425 default: 426 + usb_free_urb(urb); 426 427 return -EILSEQ; 427 428 } 428 429
+1 -3
drivers/bluetooth/btsdio.c
··· 162 162 bt_cb(skb)->pkt_type = hdr[3]; 163 163 164 164 err = hci_recv_frame(skb); 165 - if (err < 0) { 166 - kfree(skb); 165 + if (err < 0) 167 166 return err; 168 - } 169 167 170 168 sdio_writeb(data->func, 0x00, REG_PC_RRT, NULL); 171 169
+1
drivers/bluetooth/hci_usb.c
··· 111 111 { USB_DEVICE(0x0a5c, 0x2033), .driver_info = HCI_IGNORE }, 112 112 113 113 /* Broadcom BCM2035 */ 114 + { USB_DEVICE(0x0a5c, 0x2035), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU }, 114 115 { USB_DEVICE(0x0a5c, 0x200a), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU }, 115 116 { USB_DEVICE(0x0a5c, 0x2009), .driver_info = HCI_BCM92035 }, 116 117
+2 -4
drivers/net/Kconfig
··· 920 920 ---help--- 921 921 Support for the Microchip EN28J60 ethernet chip. 922 922 923 - To compile this driver as a module, choose M here and read 924 - <file:Documentation/networking/net-modules.txt>. The module will be 923 + To compile this driver as a module, choose M here. The module will be 925 924 called enc28j60. 926 925 927 926 config ENC28J60_WRITEVERIFY ··· 2040 2041 More specific information on configuring the driver is in 2041 2042 <file:Documentation/networking/e1000.txt>. 2042 2043 2043 - To compile this driver as a module, choose M here and read 2044 - <file:Documentation/networking/net-modules.txt>. The module 2044 + To compile this driver as a module, choose M here. The module 2045 2045 will be called igb. 2046 2046 2047 2047 source "drivers/net/ixp2000/Kconfig"
+2 -2
drivers/net/hamradio/dmascc.c
··· 262 262 263 263 static int io[MAX_NUM_DEVS] __initdata = { 0, }; 264 264 265 - /* Beware! hw[] is also used in cleanup_module(). */ 266 - static struct scc_hardware hw[NUM_TYPES] __initdata_or_module = HARDWARE; 265 + /* Beware! hw[] is also used in dmascc_exit(). */ 266 + static struct scc_hardware hw[NUM_TYPES] = HARDWARE; 267 267 268 268 269 269 /* Global variables */
+4
drivers/net/tun.c
··· 529 529 530 530 if (ifr->ifr_flags & IFF_NO_PI) 531 531 tun->flags |= TUN_NO_PI; 532 + else 533 + tun->flags &= ~TUN_NO_PI; 532 534 533 535 if (ifr->ifr_flags & IFF_ONE_QUEUE) 534 536 tun->flags |= TUN_ONE_QUEUE; 537 + else 538 + tun->flags &= ~TUN_ONE_QUEUE; 535 539 536 540 file->private_data = tun; 537 541 tun->attached = 1;
+1
include/linux/Kbuild
··· 219 219 unifdef-y += icmp.h 220 220 unifdef-y += icmpv6.h 221 221 unifdef-y += if_addr.h 222 + unifdef-y += if_addrlabel.h 222 223 unifdef-y += if_arp.h 223 224 unifdef-y += if_bridge.h 224 225 unifdef-y += if_ec.h
+2 -1
include/linux/pkt_cls.h
··· 459 459 #define TCF_EM_U32 3 460 460 #define TCF_EM_META 4 461 461 #define TCF_EM_TEXT 5 462 - #define TCF_EM_MAX 5 462 + #define TCF_EM_VLAN 6 463 + #define TCF_EM_MAX 6 463 464 464 465 enum 465 466 {
-12
include/linux/rtnetlink.h
··· 602 602 603 603 #include <linux/mutex.h> 604 604 605 - extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size); 606 605 static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) 607 606 { 608 607 int len = strlen(str) + 1; 609 608 return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len); 610 609 } 611 - 612 - extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len); 613 - extern int __rtattr_parse_nested_compat(struct rtattr *tb[], int maxattr, 614 - struct rtattr *rta, int len); 615 - 616 - #define rtattr_parse_nested(tb, max, rta) \ 617 - rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta))) 618 - 619 - #define rtattr_parse_nested_compat(tb, max, rta, data, len) \ 620 - ({ data = RTA_PAYLOAD(rta) >= len ? RTA_DATA(rta) : NULL; \ 621 - __rtattr_parse_nested_compat(tb, max, rta, len); }) 622 610 623 611 extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo); 624 612 extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid);
+1
include/linux/tc_ematch/tc_em_meta.h
··· 81 81 TCF_META_ID_SK_SNDTIMEO, 82 82 TCF_META_ID_SK_SENDMSG_OFF, 83 83 TCF_META_ID_SK_WRITE_PENDING, 84 + TCF_META_ID_VLAN_TAG, 84 85 __TCF_META_ID_MAX 85 86 }; 86 87 #define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
+1 -1
include/net/inet_hashtables.h
··· 389 389 } 390 390 391 391 extern int __inet_hash_connect(struct inet_timewait_death_row *death_row, 392 - struct sock *sk, 392 + struct sock *sk, u32 port_offset, 393 393 int (*check_established)(struct inet_timewait_death_row *, 394 394 struct sock *, __u16, struct inet_timewait_sock **), 395 395 void (*hash)(struct sock *sk));
+8
include/net/ip_fib.h
··· 266 266 #ifdef CONFIG_PROC_FS 267 267 extern int __net_init fib_proc_init(struct net *net); 268 268 extern void __net_exit fib_proc_exit(struct net *net); 269 + #else 270 + static inline int fib_proc_init(struct net *net) 271 + { 272 + return 0; 273 + } 274 + static inline void fib_proc_exit(struct net *net) 275 + { 276 + } 269 277 #endif 270 278 271 279 #endif /* _NET_FIB_H */
+2 -4
include/net/ipv6.h
··· 110 110 111 111 /* sysctls */ 112 112 extern int sysctl_mld_max_msf; 113 - 114 113 extern struct ctl_path net_ipv6_ctl_path[]; 115 114 116 115 #define _DEVINC(statname, modifier, idev, field) \ ··· 585 586 int __user *optlen); 586 587 587 588 #ifdef CONFIG_PROC_FS 588 - extern struct ctl_table *ipv6_icmp_sysctl_init(struct net *net); 589 - extern struct ctl_table *ipv6_route_sysctl_init(struct net *net); 590 - 591 589 extern int ac6_proc_init(void); 592 590 extern void ac6_proc_exit(void); 593 591 extern int raw6_proc_init(void); ··· 617 621 extern ctl_table ipv6_route_table_template[]; 618 622 extern ctl_table ipv6_icmp_table_template[]; 619 623 624 + extern struct ctl_table *ipv6_icmp_sysctl_init(struct net *net); 625 + extern struct ctl_table *ipv6_route_sysctl_init(struct net *net); 620 626 extern int ipv6_sysctl_register(void); 621 627 extern void ipv6_sysctl_unregister(void); 622 628 #endif
+20 -29
net/bluetooth/hidp/core.c
··· 135 135 } 136 136 } 137 137 138 - static inline int hidp_queue_event(struct hidp_session *session, struct input_dev *dev, 139 - unsigned int type, unsigned int code, int value) 138 + static int hidp_queue_event(struct hidp_session *session, struct input_dev *dev, 139 + unsigned int type, unsigned int code, int value) 140 140 { 141 141 unsigned char newleds; 142 142 struct sk_buff *skb; ··· 243 243 input_sync(dev); 244 244 } 245 245 246 - static inline int hidp_queue_report(struct hidp_session *session, unsigned char *data, int size) 246 + static int hidp_queue_report(struct hidp_session *session, 247 + unsigned char *data, int size) 247 248 { 248 249 struct sk_buff *skb; 249 250 ··· 288 287 hidp_schedule(session); 289 288 } 290 289 291 - static inline void hidp_set_timer(struct hidp_session *session) 290 + static void hidp_set_timer(struct hidp_session *session) 292 291 { 293 292 if (session->idle_to > 0) 294 293 mod_timer(&session->timer, jiffies + HZ * session->idle_to); ··· 333 332 return err; 334 333 } 335 334 336 - static inline void hidp_process_handshake(struct hidp_session *session, unsigned char param) 335 + static void hidp_process_handshake(struct hidp_session *session, 336 + unsigned char param) 337 337 { 338 338 BT_DBG("session %p param 0x%02x", session, param); 339 339 ··· 367 365 } 368 366 } 369 367 370 - static inline void hidp_process_hid_control(struct hidp_session *session, unsigned char param) 368 + static void hidp_process_hid_control(struct hidp_session *session, 369 + unsigned char param) 371 370 { 372 371 BT_DBG("session %p param 0x%02x", session, param); 373 372 374 - switch (param) { 375 - case HIDP_CTRL_NOP: 376 - break; 377 - 378 - case HIDP_CTRL_VIRTUAL_CABLE_UNPLUG: 373 + if (param == HIDP_CTRL_VIRTUAL_CABLE_UNPLUG) { 379 374 /* Flush the transmit queues */ 380 375 skb_queue_purge(&session->ctrl_transmit); 381 376 skb_queue_purge(&session->intr_transmit); 382 377 383 378 /* Kill session thread */ 384 379 atomic_inc(&session->terminate); 385 - break; 386 - 387 - case HIDP_CTRL_HARD_RESET: 388 - case HIDP_CTRL_SOFT_RESET: 389 - case HIDP_CTRL_SUSPEND: 390 - case HIDP_CTRL_EXIT_SUSPEND: 391 - /* FIXME: We have to parse these and return no error */ 392 - break; 393 - 394 - default: 395 - __hidp_send_ctrl_message(session, 396 - HIDP_TRANS_HANDSHAKE | HIDP_HSHK_ERR_INVALID_PARAMETER, NULL, 0); 397 - break; 398 380 } 399 381 } 400 382 401 - static inline void hidp_process_data(struct hidp_session *session, struct sk_buff *skb, unsigned char param) 383 + static void hidp_process_data(struct hidp_session *session, struct sk_buff *skb, 384 + unsigned char param) 402 385 { 403 386 BT_DBG("session %p skb %p len %d param 0x%02x", session, skb, skb->len, param); 404 387 ··· 410 423 } 411 424 } 412 425 413 - static inline void hidp_recv_ctrl_frame(struct hidp_session *session, struct sk_buff *skb) 426 + static void hidp_recv_ctrl_frame(struct hidp_session *session, 427 + struct sk_buff *skb) 414 428 { 415 429 unsigned char hdr, type, param; 416 430 ··· 445 457 kfree_skb(skb); 446 458 } 447 459 448 - static inline void hidp_recv_intr_frame(struct hidp_session *session, struct sk_buff *skb) 460 + static void hidp_recv_intr_frame(struct hidp_session *session, 461 + struct sk_buff *skb) 449 462 { 450 463 unsigned char hdr; 451 464 ··· 614 625 return conn ? &conn->dev : NULL; 615 626 } 616 627 617 - static inline int hidp_setup_input(struct hidp_session *session, struct hidp_connadd_req *req) 628 + static int hidp_setup_input(struct hidp_session *session, 629 + struct hidp_connadd_req *req) 618 630 { 619 631 struct input_dev *input = session->input; 620 632 int i; ··· 692 702 hid->quirks = hidp_blacklist[n].quirks; 693 703 } 694 704 695 - static inline void hidp_setup_hid(struct hidp_session *session, struct hidp_connadd_req *req) 705 + static void hidp_setup_hid(struct hidp_session *session, 706 + struct hidp_connadd_req *req) 696 707 { 697 708 struct hid_device *hid = session->hid; 698 709 struct hid_report *report;
+2 -1
net/bluetooth/rfcomm/tty.c
··· 429 429 if (dev->tty) 430 430 tty_vhangup(dev->tty); 431 431 432 - rfcomm_dev_del(dev); 432 + if (!test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags)) 433 + rfcomm_dev_del(dev); 433 434 rfcomm_dev_put(dev); 434 435 return 0; 435 436 }
-44
net/core/rtnetlink.c
··· 82 82 return mutex_trylock(&rtnl_mutex); 83 83 } 84 84 85 - int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len) 86 - { 87 - memset(tb, 0, sizeof(struct rtattr*)*maxattr); 88 - 89 - while (RTA_OK(rta, len)) { 90 - unsigned flavor = rta->rta_type; 91 - if (flavor && flavor <= maxattr) 92 - tb[flavor-1] = rta; 93 - rta = RTA_NEXT(rta, len); 94 - } 95 - return 0; 96 - } 97 - 98 - int __rtattr_parse_nested_compat(struct rtattr *tb[], int maxattr, 99 - struct rtattr *rta, int len) 100 - { 101 - if (RTA_PAYLOAD(rta) < len) 102 - return -1; 103 - if (RTA_PAYLOAD(rta) >= RTA_ALIGN(len) + sizeof(struct rtattr)) { 104 - rta = RTA_DATA(rta) + RTA_ALIGN(len); 105 - return rtattr_parse_nested(tb, maxattr, rta); 106 - } 107 - memset(tb, 0, sizeof(struct rtattr *) * maxattr); 108 - return 0; 109 - } 110 - 111 85 static struct rtnl_link *rtnl_msg_handlers[NPROTO]; 112 86 113 87 static inline int rtm_msgindex(int msgtype) ··· 414 440 rta->rta_len = size; 415 441 memcpy(RTA_DATA(rta), data, attrlen); 416 442 memset(RTA_DATA(rta) + attrlen, 0, RTA_ALIGN(size) - size); 417 - } 418 - 419 - size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size) 420 - { 421 - size_t ret = RTA_PAYLOAD(rta); 422 - char *src = RTA_DATA(rta); 423 - 424 - if (ret > 0 && src[ret - 1] == '\0') 425 - ret--; 426 - if (size > 0) { 427 - size_t len = (ret >= size) ? size - 1 : ret; 428 - memset(dest, 0, size); 429 - memcpy(dest, src, len); 430 - } 431 - return ret; 432 443 } 433 444 434 445 int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned group, int echo) ··· 1370 1411 } 1371 1412 1372 1413 EXPORT_SYMBOL(__rta_fill); 1373 - EXPORT_SYMBOL(rtattr_strlcpy); 1374 - EXPORT_SYMBOL(rtattr_parse); 1375 - EXPORT_SYMBOL(__rtattr_parse_nested_compat); 1376 1414 EXPORT_SYMBOL(rtnetlink_put_metrics); 1377 1415 EXPORT_SYMBOL(rtnl_lock); 1378 1416 EXPORT_SYMBOL(rtnl_trylock);
+1 -2
net/ipv4/fib_trie.c
··· 2431 2431 rtn_type(buf2, sizeof(buf2), 2432 2432 fa->fa_type)); 2433 2433 if (fa->fa_tos) 2434 - seq_printf(seq, "tos =%d\n", 2435 - fa->fa_tos); 2434 + seq_printf(seq, " tos=%d", fa->fa_tos); 2436 2435 seq_putc(seq, '\n'); 2437 2436 } 2438 2437 }
+2 -1
net/ipv4/icmp.c
··· 1015 1015 goto error; 1016 1016 } 1017 1017 1018 - __skb_pull(skb, sizeof(*icmph)); 1018 + if (!pskb_pull(skb, sizeof(*icmph))) 1019 + goto error; 1019 1020 1020 1021 icmph = icmp_hdr(skb); 1021 1022
+3 -3
net/ipv4/inet_hashtables.c
··· 398 398 EXPORT_SYMBOL_GPL(inet_unhash); 399 399 400 400 int __inet_hash_connect(struct inet_timewait_death_row *death_row, 401 - struct sock *sk, 401 + struct sock *sk, u32 port_offset, 402 402 int (*check_established)(struct inet_timewait_death_row *, 403 403 struct sock *, __u16, struct inet_timewait_sock **), 404 404 void (*hash)(struct sock *sk)) ··· 413 413 if (!snum) { 414 414 int i, remaining, low, high, port; 415 415 static u32 hint; 416 - u32 offset = hint + inet_sk_port_offset(sk); 416 + u32 offset = hint + port_offset; 417 417 struct hlist_node *node; 418 418 struct inet_timewait_sock *tw = NULL; 419 419 ··· 502 502 int inet_hash_connect(struct inet_timewait_death_row *death_row, 503 503 struct sock *sk) 504 504 { 505 - return __inet_hash_connect(death_row, sk, 505 + return __inet_hash_connect(death_row, sk, inet_sk_port_offset(sk), 506 506 __inet_check_established, __inet_hash_nolisten); 507 507 } 508 508
+1 -1
net/ipv4/xfrm4_mode_beet.c
··· 102 102 103 103 XFRM_MODE_SKB_CB(skb)->protocol = ph->nexthdr; 104 104 105 - if (!pskb_may_pull(skb, phlen)); 105 + if (!pskb_may_pull(skb, phlen)) 106 106 goto out; 107 107 __skb_pull(skb, phlen); 108 108 }
+2 -1
net/ipv6/icmp.c
··· 683 683 } 684 684 } 685 685 686 - __skb_pull(skb, sizeof(*hdr)); 686 + if (!pskb_pull(skb, sizeof(*hdr))) 687 + goto discard_it; 687 688 688 689 hdr = icmp6_hdr(skb); 689 690
+1 -1
net/ipv6/inet6_hashtables.c
··· 236 236 int inet6_hash_connect(struct inet_timewait_death_row *death_row, 237 237 struct sock *sk) 238 238 { 239 - return __inet_hash_connect(death_row, sk, 239 + return __inet_hash_connect(death_row, sk, inet6_sk_port_offset(sk), 240 240 __inet6_check_established, __inet6_hash); 241 241 } 242 242
+2 -2
net/sched/cls_flow.c
··· 594 594 595 595 if (tcf_exts_dump(skb, &f->exts, &flow_ext_map) < 0) 596 596 goto nla_put_failure; 597 - 597 + #ifdef CONFIG_NET_EMATCH 598 598 if (f->ematches.hdr.nmatches && 599 599 tcf_em_tree_dump(skb, &f->ematches, TCA_FLOW_EMATCHES) < 0) 600 600 goto nla_put_failure; 601 - 601 + #endif 602 602 nla_nest_end(skb, nest); 603 603 604 604 if (tcf_exts_dump_stats(skb, &f->exts, &flow_ext_map) < 0)
+17
net/sched/em_meta.c
··· 65 65 #include <linux/string.h> 66 66 #include <linux/skbuff.h> 67 67 #include <linux/random.h> 68 + #include <linux/if_vlan.h> 68 69 #include <linux/tc_ematch/tc_em_meta.h> 69 70 #include <net/dst.h> 70 71 #include <net/route.h> ··· 169 168 { 170 169 *err = var_dev(skb->dev, dst); 171 170 } 171 + 172 + /************************************************************************** 173 + * vlan tag 174 + **************************************************************************/ 175 + 176 + META_COLLECTOR(int_vlan_tag) 177 + { 178 + unsigned short tag; 179 + if (vlan_get_tag(skb, &tag) < 0) 180 + *err = -1; 181 + else 182 + dst->value = tag; 183 + } 184 + 185 + 172 186 173 187 /************************************************************************** 174 188 * skb attributes ··· 536 520 [META_ID(SK_SNDTIMEO)] = META_FUNC(int_sk_sndtimeo), 537 521 [META_ID(SK_SENDMSG_OFF)] = META_FUNC(int_sk_sendmsg_off), 538 522 [META_ID(SK_WRITE_PENDING)] = META_FUNC(int_sk_write_pend), 523 + [META_ID(VLAN_TAG)] = META_FUNC(int_vlan_tag), 539 524 } 540 525 }; 541 526
+3 -3
net/sctp/auth.c
··· 420 420 const struct sctp_association *asoc, 421 421 __u16 key_id) 422 422 { 423 - struct sctp_shared_key *key = NULL; 423 + struct sctp_shared_key *key; 424 424 425 425 /* First search associations set of endpoint pair shared keys */ 426 426 key_for_each(key, &asoc->endpoint_shared_keys) { 427 427 if (key->key_id == key_id) 428 - break; 428 + return key; 429 429 } 430 430 431 - return key; 431 + return NULL; 432 432 } 433 433 434 434 /*
+4
net/sctp/sm_statefuns.c
··· 3865 3865 struct sctp_chunk *err_chunk; 3866 3866 sctp_ierror_t error; 3867 3867 3868 + /* Make sure that the peer has AUTH capable */ 3869 + if (!asoc->peer.auth_capable) 3870 + return sctp_sf_unk_chunk(ep, asoc, type, arg, commands); 3871 + 3868 3872 if (!sctp_vtag_verify(chunk, asoc)) { 3869 3873 sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG, 3870 3874 SCTP_NULL());