aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/neighbour.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/neighbour.c')
-rw-r--r--net/core/neighbour.c47
1 files changed, 6 insertions, 41 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index e587e681969..2b54e6c6a7c 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -2566,21 +2566,18 @@ static struct neigh_sysctl_table {
2566} neigh_sysctl_template __read_mostly = { 2566} neigh_sysctl_template __read_mostly = {
2567 .neigh_vars = { 2567 .neigh_vars = {
2568 { 2568 {
2569 .ctl_name = NET_NEIGH_MCAST_SOLICIT,
2570 .procname = "mcast_solicit", 2569 .procname = "mcast_solicit",
2571 .maxlen = sizeof(int), 2570 .maxlen = sizeof(int),
2572 .mode = 0644, 2571 .mode = 0644,
2573 .proc_handler = proc_dointvec, 2572 .proc_handler = proc_dointvec,
2574 }, 2573 },
2575 { 2574 {
2576 .ctl_name = NET_NEIGH_UCAST_SOLICIT,
2577 .procname = "ucast_solicit", 2575 .procname = "ucast_solicit",
2578 .maxlen = sizeof(int), 2576 .maxlen = sizeof(int),
2579 .mode = 0644, 2577 .mode = 0644,
2580 .proc_handler = proc_dointvec, 2578 .proc_handler = proc_dointvec,
2581 }, 2579 },
2582 { 2580 {
2583 .ctl_name = NET_NEIGH_APP_SOLICIT,
2584 .procname = "app_solicit", 2581 .procname = "app_solicit",
2585 .maxlen = sizeof(int), 2582 .maxlen = sizeof(int),
2586 .mode = 0644, 2583 .mode = 0644,
@@ -2593,38 +2590,30 @@ static struct neigh_sysctl_table {
2593 .proc_handler = proc_dointvec_userhz_jiffies, 2590 .proc_handler = proc_dointvec_userhz_jiffies,
2594 }, 2591 },
2595 { 2592 {
2596 .ctl_name = NET_NEIGH_REACHABLE_TIME,
2597 .procname = "base_reachable_time", 2593 .procname = "base_reachable_time",
2598 .maxlen = sizeof(int), 2594 .maxlen = sizeof(int),
2599 .mode = 0644, 2595 .mode = 0644,
2600 .proc_handler = proc_dointvec_jiffies, 2596 .proc_handler = proc_dointvec_jiffies,
2601 .strategy = sysctl_jiffies,
2602 }, 2597 },
2603 { 2598 {
2604 .ctl_name = NET_NEIGH_DELAY_PROBE_TIME,
2605 .procname = "delay_first_probe_time", 2599 .procname = "delay_first_probe_time",
2606 .maxlen = sizeof(int), 2600 .maxlen = sizeof(int),
2607 .mode = 0644, 2601 .mode = 0644,
2608 .proc_handler = proc_dointvec_jiffies, 2602 .proc_handler = proc_dointvec_jiffies,
2609 .strategy = sysctl_jiffies,
2610 }, 2603 },
2611 { 2604 {
2612 .ctl_name = NET_NEIGH_GC_STALE_TIME,
2613 .procname = "gc_stale_time", 2605 .procname = "gc_stale_time",
2614 .maxlen = sizeof(int), 2606 .maxlen = sizeof(int),
2615 .mode = 0644, 2607 .mode = 0644,
2616 .proc_handler = proc_dointvec_jiffies, 2608 .proc_handler = proc_dointvec_jiffies,
2617 .strategy = sysctl_jiffies,
2618 }, 2609 },
2619 { 2610 {
2620 .ctl_name = NET_NEIGH_UNRES_QLEN,
2621 .procname = "unres_qlen", 2611 .procname = "unres_qlen",
2622 .maxlen = sizeof(int), 2612 .maxlen = sizeof(int),
2623 .mode = 0644, 2613 .mode = 0644,
2624 .proc_handler = proc_dointvec, 2614 .proc_handler = proc_dointvec,
2625 }, 2615 },
2626 { 2616 {
2627 .ctl_name = NET_NEIGH_PROXY_QLEN,
2628 .procname = "proxy_qlen", 2617 .procname = "proxy_qlen",
2629 .maxlen = sizeof(int), 2618 .maxlen = sizeof(int),
2630 .mode = 0644, 2619 .mode = 0644,
@@ -2649,45 +2638,36 @@ static struct neigh_sysctl_table {
2649 .proc_handler = proc_dointvec_userhz_jiffies, 2638 .proc_handler = proc_dointvec_userhz_jiffies,
2650 }, 2639 },
2651 { 2640 {
2652 .ctl_name = NET_NEIGH_RETRANS_TIME_MS,
2653 .procname = "retrans_time_ms", 2641 .procname = "retrans_time_ms",
2654 .maxlen = sizeof(int), 2642 .maxlen = sizeof(int),
2655 .mode = 0644, 2643 .mode = 0644,
2656 .proc_handler = proc_dointvec_ms_jiffies, 2644 .proc_handler = proc_dointvec_ms_jiffies,
2657 .strategy = sysctl_ms_jiffies,
2658 }, 2645 },
2659 { 2646 {
2660 .ctl_name = NET_NEIGH_REACHABLE_TIME_MS,
2661 .procname = "base_reachable_time_ms", 2647 .procname = "base_reachable_time_ms",
2662 .maxlen = sizeof(int), 2648 .maxlen = sizeof(int),
2663 .mode = 0644, 2649 .mode = 0644,
2664 .proc_handler = proc_dointvec_ms_jiffies, 2650 .proc_handler = proc_dointvec_ms_jiffies,
2665 .strategy = sysctl_ms_jiffies,
2666 }, 2651 },
2667 { 2652 {
2668 .ctl_name = NET_NEIGH_GC_INTERVAL,
2669 .procname = "gc_interval", 2653 .procname = "gc_interval",
2670 .maxlen = sizeof(int), 2654 .maxlen = sizeof(int),
2671 .mode = 0644, 2655 .mode = 0644,
2672 .proc_handler = proc_dointvec_jiffies, 2656 .proc_handler = proc_dointvec_jiffies,
2673 .strategy = sysctl_jiffies,
2674 }, 2657 },
2675 { 2658 {
2676 .ctl_name = NET_NEIGH_GC_THRESH1,
2677 .procname = "gc_thresh1", 2659 .procname = "gc_thresh1",
2678 .maxlen = sizeof(int), 2660 .maxlen = sizeof(int),
2679 .mode = 0644, 2661 .mode = 0644,
2680 .proc_handler = proc_dointvec, 2662 .proc_handler = proc_dointvec,
2681 }, 2663 },
2682 { 2664 {
2683 .ctl_name = NET_NEIGH_GC_THRESH2,
2684 .procname = "gc_thresh2", 2665 .procname = "gc_thresh2",
2685 .maxlen = sizeof(int), 2666 .maxlen = sizeof(int),
2686 .mode = 0644, 2667 .mode = 0644,
2687 .proc_handler = proc_dointvec, 2668 .proc_handler = proc_dointvec,
2688 }, 2669 },
2689 { 2670 {
2690 .ctl_name = NET_NEIGH_GC_THRESH3,
2691 .procname = "gc_thresh3", 2671 .procname = "gc_thresh3",
2692 .maxlen = sizeof(int), 2672 .maxlen = sizeof(int),
2693 .mode = 0644, 2673 .mode = 0644,
@@ -2699,7 +2679,7 @@ static struct neigh_sysctl_table {
2699 2679
2700int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, 2680int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
2701 int p_id, int pdev_id, char *p_name, 2681 int p_id, int pdev_id, char *p_name,
2702 proc_handler *handler, ctl_handler *strategy) 2682 proc_handler *handler)
2703{ 2683{
2704 struct neigh_sysctl_table *t; 2684 struct neigh_sysctl_table *t;
2705 const char *dev_name_source = NULL; 2685 const char *dev_name_source = NULL;
@@ -2710,10 +2690,10 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
2710#define NEIGH_CTL_PATH_DEV 3 2690#define NEIGH_CTL_PATH_DEV 3
2711 2691
2712 struct ctl_path neigh_path[] = { 2692 struct ctl_path neigh_path[] = {
2713 { .procname = "net", .ctl_name = CTL_NET, }, 2693 { .procname = "net", },
2714 { .procname = "proto", .ctl_name = 0, }, 2694 { .procname = "proto", },
2715 { .procname = "neigh", .ctl_name = 0, }, 2695 { .procname = "neigh", },
2716 { .procname = "default", .ctl_name = NET_PROTO_CONF_DEFAULT, }, 2696 { .procname = "default", },
2717 { }, 2697 { },
2718 }; 2698 };
2719 2699
@@ -2738,7 +2718,6 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
2738 2718
2739 if (dev) { 2719 if (dev) {
2740 dev_name_source = dev->name; 2720 dev_name_source = dev->name;
2741 neigh_path[NEIGH_CTL_PATH_DEV].ctl_name = dev->ifindex;
2742 /* Terminate the table early */ 2721 /* Terminate the table early */
2743 memset(&t->neigh_vars[14], 0, sizeof(t->neigh_vars[14])); 2722 memset(&t->neigh_vars[14], 0, sizeof(t->neigh_vars[14]));
2744 } else { 2723 } else {
@@ -2750,31 +2729,19 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
2750 } 2729 }
2751 2730
2752 2731
2753 if (handler || strategy) { 2732 if (handler) {
2754 /* RetransTime */ 2733 /* RetransTime */
2755 t->neigh_vars[3].proc_handler = handler; 2734 t->neigh_vars[3].proc_handler = handler;
2756 t->neigh_vars[3].strategy = strategy;
2757 t->neigh_vars[3].extra1 = dev; 2735 t->neigh_vars[3].extra1 = dev;
2758 if (!strategy)
2759 t->neigh_vars[3].ctl_name = CTL_UNNUMBERED;
2760 /* ReachableTime */ 2736 /* ReachableTime */
2761 t->neigh_vars[4].proc_handler = handler; 2737 t->neigh_vars[4].proc_handler = handler;
2762 t->neigh_vars[4].strategy = strategy;
2763 t->neigh_vars[4].extra1 = dev; 2738 t->neigh_vars[4].extra1 = dev;
2764 if (!strategy)
2765 t->neigh_vars[4].ctl_name = CTL_UNNUMBERED;
2766 /* RetransTime (in milliseconds)*/ 2739 /* RetransTime (in milliseconds)*/
2767 t->neigh_vars[12].proc_handler = handler; 2740 t->neigh_vars[12].proc_handler = handler;
2768 t->neigh_vars[12].strategy = strategy;
2769 t->neigh_vars[12].extra1 = dev; 2741 t->neigh_vars[12].extra1 = dev;
2770 if (!strategy)
2771 t->neigh_vars[12].ctl_name = CTL_UNNUMBERED;
2772 /* ReachableTime (in milliseconds) */ 2742 /* ReachableTime (in milliseconds) */
2773 t->neigh_vars[13].proc_handler = handler; 2743 t->neigh_vars[13].proc_handler = handler;
2774 t->neigh_vars[13].strategy = strategy;
2775 t->neigh_vars[13].extra1 = dev; 2744 t->neigh_vars[13].extra1 = dev;
2776 if (!strategy)
2777 t->neigh_vars[13].ctl_name = CTL_UNNUMBERED;
2778 } 2745 }
2779 2746
2780 t->dev_name = kstrdup(dev_name_source, GFP_KERNEL); 2747 t->dev_name = kstrdup(dev_name_source, GFP_KERNEL);
@@ -2782,9 +2749,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
2782 goto free; 2749 goto free;
2783 2750
2784 neigh_path[NEIGH_CTL_PATH_DEV].procname = t->dev_name; 2751 neigh_path[NEIGH_CTL_PATH_DEV].procname = t->dev_name;
2785 neigh_path[NEIGH_CTL_PATH_NEIGH].ctl_name = pdev_id;
2786 neigh_path[NEIGH_CTL_PATH_PROTO].procname = p_name; 2752 neigh_path[NEIGH_CTL_PATH_PROTO].procname = p_name;
2787 neigh_path[NEIGH_CTL_PATH_PROTO].ctl_name = p_id;
2788 2753
2789 t->sysctl_header = 2754 t->sysctl_header =
2790 register_net_sysctl_table(neigh_parms_net(p), neigh_path, t->neigh_vars); 2755 register_net_sysctl_table(neigh_parms_net(p), neigh_path, t->neigh_vars);