]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/sysctl_check.c
Blackfin arch: add defines for the on-chip L1 ROM of BF54x
[linux-2.6-omap-h63xx.git] / kernel / sysctl_check.c
index 8bce52cc06d4bcc85faf409c36f4f7fecd22e6ca..4abc6d2306f451e8da9141e753b7b517045edda6 100644 (file)
@@ -38,7 +38,10 @@ static struct trans_ctl_table trans_kern_table[] = {
        { KERN_NODENAME,                "hostname" },
        { KERN_DOMAINNAME,              "domainname" },
 
+#ifdef CONFIG_SECURITY_CAPABILITIES
        { KERN_CAP_BSET,                "cap-bound" },
+#endif /* def CONFIG_SECURITY_CAPABILITIES */
+
        { KERN_PANIC,                   "panic" },
        { KERN_REALROOTDEV,             "real-root-dev" },
 
@@ -565,6 +568,7 @@ static struct trans_ctl_table trans_net_ipv6_table[] = {
        { NET_IPV6_IP6FRAG_TIME,        "ip6frag_time" },
        { NET_IPV6_IP6FRAG_SECRET_INTERVAL,     "ip6frag_secret_interval" },
        { NET_IPV6_MLD_MAX_MSF,         "mld_max_msf" },
+       { 2088 /* IPQ_QMAX */,          "ip6_queue_maxlen" },
        {}
 };
 
@@ -702,6 +706,24 @@ static struct trans_ctl_table trans_net_dccp_table[] = {
        {}
 };
 
+static struct trans_ctl_table trans_net_irda_table[] = {
+       { NET_IRDA_DISCOVERY,           "discovery" },
+       { NET_IRDA_DEVNAME,             "devname" },
+       { NET_IRDA_DEBUG,               "debug" },
+       { NET_IRDA_FAST_POLL,           "fast_poll_increase" },
+       { NET_IRDA_DISCOVERY_SLOTS,     "discovery_slots" },
+       { NET_IRDA_DISCOVERY_TIMEOUT,   "discovery_timeout" },
+       { NET_IRDA_SLOT_TIMEOUT,        "slot_timeout" },
+       { NET_IRDA_MAX_BAUD_RATE,       "max_baud_rate" },
+       { NET_IRDA_MIN_TX_TURN_TIME,    "min_tx_turn_time" },
+       { NET_IRDA_MAX_TX_DATA_SIZE,    "max_tx_data_size" },
+       { NET_IRDA_MAX_TX_WINDOW,       "max_tx_window" },
+       { NET_IRDA_MAX_NOREPLY_TIME,    "max_noreply_time" },
+       { NET_IRDA_WARN_NOREPLY_TIME,   "warn_noreply_time" },
+       { NET_IRDA_LAP_KEEPALIVE_TIME,  "lap_keepalive_time" },
+       {}
+};
+
 static struct trans_ctl_table trans_net_table[] = {
        { NET_CORE,             "core",         trans_net_core_table },
        /* NET_ETHER not used */
@@ -709,20 +731,22 @@ static struct trans_ctl_table trans_net_table[] = {
        { NET_UNIX,             "unix",         trans_net_unix_table },
        { NET_IPV4,             "ipv4",         trans_net_ipv4_table },
        { NET_IPX,              "ipx",          trans_net_ipx_table },
-       { NET_ATALK,            "atalk",        trans_net_atalk_table },
+       { NET_ATALK,            "appletalk",    trans_net_atalk_table },
        { NET_NETROM,           "netrom",       trans_net_netrom_table },
        { NET_AX25,             "ax25",         trans_net_ax25_table },
        { NET_BRIDGE,           "bridge",       trans_net_bridge_table },
        { NET_ROSE,             "rose",         trans_net_rose_table },
        { NET_IPV6,             "ipv6",         trans_net_ipv6_table },
        { NET_X25,              "x25",          trans_net_x25_table },
-       { NET_TR,               "tr",           trans_net_tr_table },
+       { NET_TR,               "token-ring",   trans_net_tr_table },
        { NET_DECNET,           "decnet",       trans_net_decnet_table },
        /*  NET_ECONET not used */
        { NET_SCTP,             "sctp",         trans_net_sctp_table },
        { NET_LLC,              "llc",          trans_net_llc_table },
        { NET_NETFILTER,        "netfilter",    trans_net_netfilter_table },
        { NET_DCCP,             "dccp",         trans_net_dccp_table },
+       { NET_IRDA,             "irda",         trans_net_irda_table },
+       { 2089,                 "nf_conntrack_max" },
        {}
 };
 
@@ -1408,6 +1432,7 @@ static void set_fail(const char **fail, struct ctl_table *table, const char *str
                printk(KERN_ERR "sysctl table check failed: ");
                sysctl_print_path(table);
                printk(" %s\n", *fail);
+               dump_stack();
        }
        *fail = str;
 }
@@ -1421,12 +1446,14 @@ static int sysctl_check_dir(struct ctl_table *table)
        ref = sysctl_check_lookup(table);
        if (ref) {
                int match = 0;
-               if (table->procname && ref->procname &&
-                   (strcmp(table->procname, ref->procname) == 0))
+               if ((!table->procname && !ref->procname) ||
+                   (table->procname && ref->procname &&
+                    (strcmp(table->procname, ref->procname) == 0)))
                        match++;
 
-               if (table->ctl_name && ref->ctl_name &&
-                   (table->ctl_name == ref->ctl_name))
+               if ((!table->ctl_name && !ref->ctl_name) ||
+                   (table->ctl_name && ref->ctl_name &&
+                    (table->ctl_name == ref->ctl_name)))
                        match++;
 
                if (match != 2) {
@@ -1463,8 +1490,8 @@ static void sysctl_check_bin_path(struct ctl_table *table, const char **fail)
                     (strcmp(table->procname, ref->procname) != 0)))
                        set_fail(fail, table, "procname does not match binary path procname");
 
-               if (ref->ctl_name &&
-                   (!table->ctl_name || table->ctl_name != ref->ctl_name))
+               if (ref->ctl_name && table->ctl_name &&
+                   (table->ctl_name != ref->ctl_name))
                        set_fail(fail, table, "ctl_name does not match binary path ctl_name");
        }
 }
@@ -1500,7 +1527,7 @@ int sysctl_check_table(struct ctl_table *table)
                        if (table->extra2)
                                set_fail(&fail, table, "Directory with extra2");
                        if (sysctl_check_dir(table))
-                               set_fail(&fail, table, "Inconsistent directory");
+                               set_fail(&fail, table, "Inconsistent directory names");
                } else {
                        if ((table->strategy == sysctl_data) ||
                            (table->strategy == sysctl_string) ||
@@ -1509,7 +1536,9 @@ int sysctl_check_table(struct ctl_table *table)
                            (table->strategy == sysctl_ms_jiffies) ||
                            (table->proc_handler == proc_dostring) ||
                            (table->proc_handler == proc_dointvec) ||
+#ifdef CONFIG_SECURITY_CAPABILITIES
                            (table->proc_handler == proc_dointvec_bset) ||
+#endif /* def CONFIG_SECURITY_CAPABILITIES */
                            (table->proc_handler == proc_dointvec_minmax) ||
                            (table->proc_handler == proc_dointvec_jiffies) ||
                            (table->proc_handler == proc_dointvec_userhz_jiffies) ||
@@ -1521,23 +1550,27 @@ int sysctl_check_table(struct ctl_table *table)
                                if (!table->maxlen)
                                        set_fail(&fail, table, "No maxlen");
                        }
-                       if ((table->strategy == sysctl_intvec) ||
-                           (table->proc_handler == proc_dointvec_minmax) ||
-                           (table->proc_handler == proc_doulongvec_minmax) ||
+                       if ((table->proc_handler == proc_doulongvec_minmax) ||
                            (table->proc_handler == proc_doulongvec_ms_jiffies_minmax)) {
-                               if (!table->extra1)
-                                       set_fail(&fail, table, "No min");
-                               if (!table->extra2)
-                                       set_fail(&fail, table, "No max");
+                               if (table->maxlen > sizeof (unsigned long)) {
+                                       if (!table->extra1)
+                                               set_fail(&fail, table, "No min");
+                                       if (!table->extra2)
+                                               set_fail(&fail, table, "No max");
+                               }
                        }
+#ifdef CONFIG_SYSCTL_SYSCALL
                        if (table->ctl_name && !table->strategy)
                                set_fail(&fail, table, "Missing strategy");
+#endif
 #if 0
                        if (!table->ctl_name && table->strategy)
                                set_fail(&fail, table, "Strategy without ctl_name");
 #endif
+#ifdef CONFIG_PROC_FS
                        if (table->procname && !table->proc_handler)
                                set_fail(&fail, table, "No proc_handler");
+#endif
 #if 0
                        if (!table->procname && table->proc_handler)
                                set_fail(&fail, table, "proc_handler without procname");