aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
Diffstat (limited to 'net/core')
-rw-r--r--net/core/neighbour.c47
-rw-r--r--net/core/sysctl_net_core.c21
2 files changed, 10 insertions, 58 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index e587e6819698..2b54e6c6a7c8 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);
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 887c03c4e3c6..267314664813 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -19,7 +19,6 @@
19static struct ctl_table net_core_table[] = { 19static struct ctl_table net_core_table[] = {
20#ifdef CONFIG_NET 20#ifdef CONFIG_NET
21 { 21 {
22 .ctl_name = NET_CORE_WMEM_MAX,
23 .procname = "wmem_max", 22 .procname = "wmem_max",
24 .data = &sysctl_wmem_max, 23 .data = &sysctl_wmem_max,
25 .maxlen = sizeof(int), 24 .maxlen = sizeof(int),
@@ -27,7 +26,6 @@ static struct ctl_table net_core_table[] = {
27 .proc_handler = proc_dointvec 26 .proc_handler = proc_dointvec
28 }, 27 },
29 { 28 {
30 .ctl_name = NET_CORE_RMEM_MAX,
31 .procname = "rmem_max", 29 .procname = "rmem_max",
32 .data = &sysctl_rmem_max, 30 .data = &sysctl_rmem_max,
33 .maxlen = sizeof(int), 31 .maxlen = sizeof(int),
@@ -35,7 +33,6 @@ static struct ctl_table net_core_table[] = {
35 .proc_handler = proc_dointvec 33 .proc_handler = proc_dointvec
36 }, 34 },
37 { 35 {
38 .ctl_name = NET_CORE_WMEM_DEFAULT,
39 .procname = "wmem_default", 36 .procname = "wmem_default",
40 .data = &sysctl_wmem_default, 37 .data = &sysctl_wmem_default,
41 .maxlen = sizeof(int), 38 .maxlen = sizeof(int),
@@ -43,7 +40,6 @@ static struct ctl_table net_core_table[] = {
43 .proc_handler = proc_dointvec 40 .proc_handler = proc_dointvec
44 }, 41 },
45 { 42 {
46 .ctl_name = NET_CORE_RMEM_DEFAULT,
47 .procname = "rmem_default", 43 .procname = "rmem_default",
48 .data = &sysctl_rmem_default, 44 .data = &sysctl_rmem_default,
49 .maxlen = sizeof(int), 45 .maxlen = sizeof(int),
@@ -51,7 +47,6 @@ static struct ctl_table net_core_table[] = {
51 .proc_handler = proc_dointvec 47 .proc_handler = proc_dointvec
52 }, 48 },
53 { 49 {
54 .ctl_name = NET_CORE_DEV_WEIGHT,
55 .procname = "dev_weight", 50 .procname = "dev_weight",
56 .data = &weight_p, 51 .data = &weight_p,
57 .maxlen = sizeof(int), 52 .maxlen = sizeof(int),
@@ -59,7 +54,6 @@ static struct ctl_table net_core_table[] = {
59 .proc_handler = proc_dointvec 54 .proc_handler = proc_dointvec
60 }, 55 },
61 { 56 {
62 .ctl_name = NET_CORE_MAX_BACKLOG,
63 .procname = "netdev_max_backlog", 57 .procname = "netdev_max_backlog",
64 .data = &netdev_max_backlog, 58 .data = &netdev_max_backlog,
65 .maxlen = sizeof(int), 59 .maxlen = sizeof(int),
@@ -67,16 +61,13 @@ static struct ctl_table net_core_table[] = {
67 .proc_handler = proc_dointvec 61 .proc_handler = proc_dointvec
68 }, 62 },
69 { 63 {
70 .ctl_name = NET_CORE_MSG_COST,
71 .procname = "message_cost", 64 .procname = "message_cost",
72 .data = &net_ratelimit_state.interval, 65 .data = &net_ratelimit_state.interval,
73 .maxlen = sizeof(int), 66 .maxlen = sizeof(int),
74 .mode = 0644, 67 .mode = 0644,
75 .proc_handler = proc_dointvec_jiffies, 68 .proc_handler = proc_dointvec_jiffies,
76 .strategy = sysctl_jiffies,
77 }, 69 },
78 { 70 {
79 .ctl_name = NET_CORE_MSG_BURST,
80 .procname = "message_burst", 71 .procname = "message_burst",
81 .data = &net_ratelimit_state.burst, 72 .data = &net_ratelimit_state.burst,
82 .maxlen = sizeof(int), 73 .maxlen = sizeof(int),
@@ -84,7 +75,6 @@ static struct ctl_table net_core_table[] = {
84 .proc_handler = proc_dointvec, 75 .proc_handler = proc_dointvec,
85 }, 76 },
86 { 77 {
87 .ctl_name = NET_CORE_OPTMEM_MAX,
88 .procname = "optmem_max", 78 .procname = "optmem_max",
89 .data = &sysctl_optmem_max, 79 .data = &sysctl_optmem_max,
90 .maxlen = sizeof(int), 80 .maxlen = sizeof(int),
@@ -93,7 +83,6 @@ static struct ctl_table net_core_table[] = {
93 }, 83 },
94#endif /* CONFIG_NET */ 84#endif /* CONFIG_NET */
95 { 85 {
96 .ctl_name = NET_CORE_BUDGET,
97 .procname = "netdev_budget", 86 .procname = "netdev_budget",
98 .data = &netdev_budget, 87 .data = &netdev_budget,
99 .maxlen = sizeof(int), 88 .maxlen = sizeof(int),
@@ -101,31 +90,29 @@ static struct ctl_table net_core_table[] = {
101 .proc_handler = proc_dointvec 90 .proc_handler = proc_dointvec
102 }, 91 },
103 { 92 {
104 .ctl_name = NET_CORE_WARNINGS,
105 .procname = "warnings", 93 .procname = "warnings",
106 .data = &net_msg_warn, 94 .data = &net_msg_warn,
107 .maxlen = sizeof(int), 95 .maxlen = sizeof(int),
108 .mode = 0644, 96 .mode = 0644,
109 .proc_handler = proc_dointvec 97 .proc_handler = proc_dointvec
110 }, 98 },
111 { .ctl_name = 0 } 99 { }
112}; 100};
113 101
114static struct ctl_table netns_core_table[] = { 102static struct ctl_table netns_core_table[] = {
115 { 103 {
116 .ctl_name = NET_CORE_SOMAXCONN,
117 .procname = "somaxconn", 104 .procname = "somaxconn",
118 .data = &init_net.core.sysctl_somaxconn, 105 .data = &init_net.core.sysctl_somaxconn,
119 .maxlen = sizeof(int), 106 .maxlen = sizeof(int),
120 .mode = 0644, 107 .mode = 0644,
121 .proc_handler = proc_dointvec 108 .proc_handler = proc_dointvec
122 }, 109 },
123 { .ctl_name = 0 } 110 { }
124}; 111};
125 112
126__net_initdata struct ctl_path net_core_path[] = { 113__net_initdata struct ctl_path net_core_path[] = {
127 { .procname = "net", .ctl_name = CTL_NET, }, 114 { .procname = "net", },
128 { .procname = "core", .ctl_name = NET_CORE, }, 115 { .procname = "core", },
129 { }, 116 { },
130}; 117};
131 118