summaryrefslogtreecommitdiffstats
path: root/net/wimax/stack.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-19 18:50:47 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-19 18:50:47 -0500
commit1ee2dcc2245340cf4ac94b99c4d00efbeba61824 (patch)
tree5339e55add987379525177011dde6e3756b1430c /net/wimax/stack.c
parent4457e6f6c9f6052cd5f44a79037108b5ddeb0ce7 (diff)
parent091e0662ee2c37867ad918ce7b6ddd17f0e090e2 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "Mostly these are fixes for fallout due to merge window changes, as well as cures for problems that have been with us for a much longer period of time" 1) Johannes Berg noticed two major deficiencies in our genetlink registration. Some genetlink protocols we passing in constant counts for their ops array rather than something like ARRAY_SIZE(ops) or similar. Also, some genetlink protocols were using fixed IDs for their multicast groups. We have to retain these fixed IDs to keep existing userland tools working, but reserve them so that other multicast groups used by other protocols can not possibly conflict. In dealing with these two problems, we actually now use less state management for genetlink operations and multicast groups. 2) When configuring interface hardware timestamping, fix several drivers that simply do not validate that the hwtstamp_config value is one the driver actually supports. From Ben Hutchings. 3) Invalid memory references in mwifiex driver, from Amitkumar Karwar. 4) In dev_forward_skb(), set the skb->protocol in the right order relative to skb_scrub_packet(). From Alexei Starovoitov. 5) Bridge erroneously fails to use the proper wrapper functions to make calls to netdev_ops->ndo_vlan_rx_{add,kill}_vid. Fix from Toshiaki Makita. 6) When detaching a bridge port, make sure to flush all VLAN IDs to prevent them from leaking, also from Toshiaki Makita. 7) Put in a compromise for TCP Small Queues so that deep queued devices that delay TX reclaim non-trivially don't have such a performance decrease. One particularly problematic area is 802.11 AMPDU in wireless. From Eric Dumazet. 8) Fix crashes in tcp_fastopen_cache_get(), we can see NULL socket dsts here. Fix from Eric Dumzaet, reported by Dave Jones. 9) Fix use after free in ipv6 SIT driver, from Willem de Bruijn. 10) When computing mergeable buffer sizes, virtio-net fails to take the virtio-net header into account. From Michael Dalton. 11) Fix seqlock deadlock in ip4_datagram_connect() wrt. statistic bumping, this one has been with us for a while. From Eric Dumazet. 12) Fix NULL deref in the new TIPC fragmentation handling, from Erik Hugne. 13) 6lowpan bit used for traffic classification was wrong, from Jukka Rissanen. 14) macvlan has the same issue as normal vlans did wrt. propagating LRO disabling down to the real device, fix it the same way. From Michal Kubecek. 15) CPSW driver needs to soft reset all slaves during suspend, from Daniel Mack. 16) Fix small frame pacing in FQ packet scheduler, from Eric Dumazet. 17) The xen-netfront RX buffer refill timer isn't properly scheduled on partial RX allocation success, from Ma JieYue. 18) When ipv6 ping protocol support was added, the AF_INET6 protocol initialization cleanup path on failure was borked a little. Fix from Vlad Yasevich. 19) If a socket disconnects during a read/recvmsg/recvfrom/etc that blocks we can do the wrong thing with the msg_name we write back to userspace. From Hannes Frederic Sowa. There is another fix in the works from Hannes which will prevent future problems of this nature. 20) Fix route leak in VTI tunnel transmit, from Fan Du. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (106 commits) genetlink: make multicast groups const, prevent abuse genetlink: pass family to functions using groups genetlink: add and use genl_set_err() genetlink: remove family pointer from genl_multicast_group genetlink: remove genl_unregister_mc_group() hsr: don't call genl_unregister_mc_group() quota/genetlink: use proper genetlink multicast APIs drop_monitor/genetlink: use proper genetlink multicast APIs genetlink: only pass array to genl_register_family_with_ops() tcp: don't update snd_nxt, when a socket is switched from repair mode atm: idt77252: fix dev refcnt leak xfrm: Release dst if this dst is improper for vti tunnel netlink: fix documentation typo in netlink_set_err() be2net: Delete secondary unicast MAC addresses during be_close be2net: Fix unconditional enabling of Rx interface options net, virtio_net: replace the magic value ping: prevent NULL pointer dereference on write to msg_name bnx2x: Prevent "timeout waiting for state X" bnx2x: prevent CFC attention bnx2x: Prevent panic during DMAE timeout ...
Diffstat (limited to 'net/wimax/stack.c')
-rw-r--r--net/wimax/stack.c95
1 files changed, 47 insertions, 48 deletions
diff --git a/net/wimax/stack.c b/net/wimax/stack.c
index a6470ac39498..ef2191b969a7 100644
--- a/net/wimax/stack.c
+++ b/net/wimax/stack.c
@@ -116,8 +116,9 @@ struct sk_buff *wimax_gnl_re_state_change_alloc(
116 dev_err(dev, "RE_STCH: can't create message\n"); 116 dev_err(dev, "RE_STCH: can't create message\n");
117 goto error_new; 117 goto error_new;
118 } 118 }
119 data = genlmsg_put(report_skb, 0, wimax_gnl_mcg.id, &wimax_gnl_family, 119 /* FIXME: sending a group ID as the seq is wrong */
120 0, WIMAX_GNL_RE_STATE_CHANGE); 120 data = genlmsg_put(report_skb, 0, wimax_gnl_family.mcgrp_offset,
121 &wimax_gnl_family, 0, WIMAX_GNL_RE_STATE_CHANGE);
121 if (data == NULL) { 122 if (data == NULL) {
122 dev_err(dev, "RE_STCH: can't put data into message\n"); 123 dev_err(dev, "RE_STCH: can't put data into message\n");
123 goto error_put; 124 goto error_put;
@@ -177,7 +178,7 @@ int wimax_gnl_re_state_change_send(
177 goto out; 178 goto out;
178 } 179 }
179 genlmsg_end(report_skb, header); 180 genlmsg_end(report_skb, header);
180 genlmsg_multicast(report_skb, 0, wimax_gnl_mcg.id, GFP_KERNEL); 181 genlmsg_multicast(&wimax_gnl_family, report_skb, 0, 0, GFP_KERNEL);
181out: 182out:
182 d_fnend(3, dev, "(wimax_dev %p report_skb %p) = %d\n", 183 d_fnend(3, dev, "(wimax_dev %p report_skb %p) = %d\n",
183 wimax_dev, report_skb, result); 184 wimax_dev, report_skb, result);
@@ -402,22 +403,44 @@ void wimax_dev_init(struct wimax_dev *wimax_dev)
402} 403}
403EXPORT_SYMBOL_GPL(wimax_dev_init); 404EXPORT_SYMBOL_GPL(wimax_dev_init);
404 405
405/* 406static const struct nla_policy wimax_gnl_policy[WIMAX_GNL_ATTR_MAX + 1] = {
406 * This extern is declared here because it's easier to keep track -- 407 [WIMAX_GNL_RESET_IFIDX] = { .type = NLA_U32, },
407 * both declarations are a list of the same 408 [WIMAX_GNL_RFKILL_IFIDX] = { .type = NLA_U32, },
408 */ 409 [WIMAX_GNL_RFKILL_STATE] = {
409extern struct genl_ops 410 .type = NLA_U32 /* enum wimax_rf_state */
410 wimax_gnl_msg_from_user, 411 },
411 wimax_gnl_reset, 412 [WIMAX_GNL_STGET_IFIDX] = { .type = NLA_U32, },
412 wimax_gnl_rfkill, 413 [WIMAX_GNL_MSG_IFIDX] = { .type = NLA_U32, },
413 wimax_gnl_state_get; 414 [WIMAX_GNL_MSG_DATA] = {
415 .type = NLA_UNSPEC, /* libnl doesn't grok BINARY yet */
416 },
417};
414 418
415static 419static const struct genl_ops wimax_gnl_ops[] = {
416struct genl_ops *wimax_gnl_ops[] = { 420 {
417 &wimax_gnl_msg_from_user, 421 .cmd = WIMAX_GNL_OP_MSG_FROM_USER,
418 &wimax_gnl_reset, 422 .flags = GENL_ADMIN_PERM,
419 &wimax_gnl_rfkill, 423 .policy = wimax_gnl_policy,
420 &wimax_gnl_state_get, 424 .doit = wimax_gnl_doit_msg_from_user,
425 },
426 {
427 .cmd = WIMAX_GNL_OP_RESET,
428 .flags = GENL_ADMIN_PERM,
429 .policy = wimax_gnl_policy,
430 .doit = wimax_gnl_doit_reset,
431 },
432 {
433 .cmd = WIMAX_GNL_OP_RFKILL,
434 .flags = GENL_ADMIN_PERM,
435 .policy = wimax_gnl_policy,
436 .doit = wimax_gnl_doit_rfkill,
437 },
438 {
439 .cmd = WIMAX_GNL_OP_STATE_GET,
440 .flags = GENL_ADMIN_PERM,
441 .policy = wimax_gnl_policy,
442 .doit = wimax_gnl_doit_state_get,
443 },
421}; 444};
422 445
423 446
@@ -557,8 +580,8 @@ struct genl_family wimax_gnl_family = {
557 .maxattr = WIMAX_GNL_ATTR_MAX, 580 .maxattr = WIMAX_GNL_ATTR_MAX,
558}; 581};
559 582
560struct genl_multicast_group wimax_gnl_mcg = { 583static const struct genl_multicast_group wimax_gnl_mcgrps[] = {
561 .name = "msg", 584 { .name = "msg", },
562}; 585};
563 586
564 587
@@ -567,7 +590,7 @@ struct genl_multicast_group wimax_gnl_mcg = {
567static 590static
568int __init wimax_subsys_init(void) 591int __init wimax_subsys_init(void)
569{ 592{
570 int result, cnt; 593 int result;
571 594
572 d_fnstart(4, NULL, "()\n"); 595 d_fnstart(4, NULL, "()\n");
573 d_parse_params(D_LEVEL, D_LEVEL_SIZE, wimax_debug_params, 596 d_parse_params(D_LEVEL, D_LEVEL_SIZE, wimax_debug_params,
@@ -575,37 +598,18 @@ int __init wimax_subsys_init(void)
575 598
576 snprintf(wimax_gnl_family.name, sizeof(wimax_gnl_family.name), 599 snprintf(wimax_gnl_family.name, sizeof(wimax_gnl_family.name),
577 "WiMAX"); 600 "WiMAX");
578 result = genl_register_family(&wimax_gnl_family); 601 result = genl_register_family_with_ops_groups(&wimax_gnl_family,
602 wimax_gnl_ops,
603 wimax_gnl_mcgrps);
579 if (unlikely(result < 0)) { 604 if (unlikely(result < 0)) {
580 printk(KERN_ERR "cannot register generic netlink family: %d\n", 605 printk(KERN_ERR "cannot register generic netlink family: %d\n",
581 result); 606 result);
582 goto error_register_family; 607 goto error_register_family;
583 } 608 }
584 609
585 for (cnt = 0; cnt < ARRAY_SIZE(wimax_gnl_ops); cnt++) {
586 result = genl_register_ops(&wimax_gnl_family,
587 wimax_gnl_ops[cnt]);
588 d_printf(4, NULL, "registering generic netlink op code "
589 "%u: %d\n", wimax_gnl_ops[cnt]->cmd, result);
590 if (unlikely(result < 0)) {
591 printk(KERN_ERR "cannot register generic netlink op "
592 "code %u: %d\n",
593 wimax_gnl_ops[cnt]->cmd, result);
594 goto error_register_ops;
595 }
596 }
597
598 result = genl_register_mc_group(&wimax_gnl_family, &wimax_gnl_mcg);
599 if (result < 0)
600 goto error_mc_group;
601 d_fnend(4, NULL, "() = 0\n"); 610 d_fnend(4, NULL, "() = 0\n");
602 return 0; 611 return 0;
603 612
604error_mc_group:
605error_register_ops:
606 for (cnt--; cnt >= 0; cnt--)
607 genl_unregister_ops(&wimax_gnl_family,
608 wimax_gnl_ops[cnt]);
609 genl_unregister_family(&wimax_gnl_family); 613 genl_unregister_family(&wimax_gnl_family);
610error_register_family: 614error_register_family:
611 d_fnend(4, NULL, "() = %d\n", result); 615 d_fnend(4, NULL, "() = %d\n", result);
@@ -619,12 +623,7 @@ module_init(wimax_subsys_init);
619static 623static
620void __exit wimax_subsys_exit(void) 624void __exit wimax_subsys_exit(void)
621{ 625{
622 int cnt;
623 wimax_id_table_release(); 626 wimax_id_table_release();
624 genl_unregister_mc_group(&wimax_gnl_family, &wimax_gnl_mcg);
625 for (cnt = ARRAY_SIZE(wimax_gnl_ops) - 1; cnt >= 0; cnt--)
626 genl_unregister_ops(&wimax_gnl_family,
627 wimax_gnl_ops[cnt]);
628 genl_unregister_family(&wimax_gnl_family); 627 genl_unregister_family(&wimax_gnl_family);
629} 628}
630module_exit(wimax_subsys_exit); 629module_exit(wimax_subsys_exit);