o net: several C99 struct init style conversions and cleanups

parent 499c357d
...@@ -252,9 +252,7 @@ static int dst_dev_event(struct notifier_block *this, unsigned long event, void ...@@ -252,9 +252,7 @@ static int dst_dev_event(struct notifier_block *this, unsigned long event, void
} }
struct notifier_block dst_dev_notifier = { struct notifier_block dst_dev_notifier = {
dst_dev_event, .notifier_call = dst_dev_event,
NULL,
0
}; };
void __init dst_init(void) void __init dst_init(void)
......
...@@ -1473,141 +1473,141 @@ struct neigh_sysctl_table { ...@@ -1473,141 +1473,141 @@ struct neigh_sysctl_table {
} neigh_sysctl_template = { } neigh_sysctl_template = {
.neigh_vars = { .neigh_vars = {
{ {
.ctl_name = NET_NEIGH_MCAST_SOLICIT, .ctl_name = NET_NEIGH_MCAST_SOLICIT,
.procname = "mcast_solicit", .procname = "mcast_solicit",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler =&proc_dointvec, .proc_handler = &proc_dointvec,
}, },
{ {
.ctl_name = NET_NEIGH_UCAST_SOLICIT, .ctl_name = NET_NEIGH_UCAST_SOLICIT,
.procname = "ucast_solicit", .procname = "ucast_solicit",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler =&proc_dointvec, .proc_handler = &proc_dointvec,
}, },
{ {
.ctl_name = NET_NEIGH_APP_SOLICIT, .ctl_name = NET_NEIGH_APP_SOLICIT,
.procname = "app_solicit", .procname = "app_solicit",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler =&proc_dointvec, .proc_handler = &proc_dointvec,
}, },
{ {
.ctl_name = NET_NEIGH_RETRANS_TIME, .ctl_name = NET_NEIGH_RETRANS_TIME,
.procname = "retrans_time", .procname = "retrans_time",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler =&proc_dointvec, .proc_handler = &proc_dointvec,
}, },
{ {
.ctl_name = NET_NEIGH_REACHABLE_TIME, .ctl_name = NET_NEIGH_REACHABLE_TIME,
.procname = "base_reachable_time", .procname = "base_reachable_time",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler =&proc_dointvec_jiffies, .proc_handler = &proc_dointvec_jiffies,
}, },
{ {
.ctl_name = NET_NEIGH_DELAY_PROBE_TIME, .ctl_name = NET_NEIGH_DELAY_PROBE_TIME,
.procname = "delay_first_probe_time", .procname = "delay_first_probe_time",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler =&proc_dointvec_jiffies, .proc_handler = &proc_dointvec_jiffies,
}, },
{ {
.ctl_name = NET_NEIGH_GC_STALE_TIME, .ctl_name = NET_NEIGH_GC_STALE_TIME,
.procname = "gc_stale_time", .procname = "gc_stale_time",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler =&proc_dointvec_jiffies, .proc_handler = &proc_dointvec_jiffies,
}, },
{ {
.ctl_name = NET_NEIGH_UNRES_QLEN, .ctl_name = NET_NEIGH_UNRES_QLEN,
.procname = "unres_qlen", .procname = "unres_qlen",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler =&proc_dointvec, .proc_handler = &proc_dointvec,
}, },
{ {
.ctl_name = NET_NEIGH_PROXY_QLEN, .ctl_name = NET_NEIGH_PROXY_QLEN,
.procname = "proxy_qlen", .procname = "proxy_qlen",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler =&proc_dointvec, .proc_handler = &proc_dointvec,
}, },
{ {
.ctl_name = NET_NEIGH_ANYCAST_DELAY, .ctl_name = NET_NEIGH_ANYCAST_DELAY,
.procname = "anycast_delay", .procname = "anycast_delay",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler =&proc_dointvec, .proc_handler = &proc_dointvec,
}, },
{ {
.ctl_name = NET_NEIGH_PROXY_DELAY, .ctl_name = NET_NEIGH_PROXY_DELAY,
.procname = "proxy_delay", .procname = "proxy_delay",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler =&proc_dointvec, .proc_handler = &proc_dointvec,
}, },
{ {
.ctl_name = NET_NEIGH_LOCKTIME, .ctl_name = NET_NEIGH_LOCKTIME,
.procname = "locktime", .procname = "locktime",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler =&proc_dointvec, .proc_handler = &proc_dointvec,
}, },
{ {
.ctl_name = NET_NEIGH_GC_INTERVAL, .ctl_name = NET_NEIGH_GC_INTERVAL,
.procname = "gc_interval", .procname = "gc_interval",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler =&proc_dointvec_jiffies, .proc_handler = &proc_dointvec_jiffies,
}, },
{ {
.ctl_name = NET_NEIGH_GC_THRESH1, .ctl_name = NET_NEIGH_GC_THRESH1,
.procname = "gc_thresh1", .procname = "gc_thresh1",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler =&proc_dointvec, .proc_handler = &proc_dointvec,
}, },
{ {
.ctl_name = NET_NEIGH_GC_THRESH2, .ctl_name = NET_NEIGH_GC_THRESH2,
.procname = "gc_thresh2", .procname = "gc_thresh2",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler =&proc_dointvec, .proc_handler = &proc_dointvec,
}, },
{ {
.ctl_name = NET_NEIGH_GC_THRESH3, .ctl_name = NET_NEIGH_GC_THRESH3,
.procname = "gc_thresh3", .procname = "gc_thresh3",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler =&proc_dointvec, .proc_handler = &proc_dointvec,
}, },
}, },
.neigh_dev = { .neigh_dev = {
{ {
.ctl_name = NET_PROTO_CONF_DEFAULT, .ctl_name = NET_PROTO_CONF_DEFAULT,
.procname = "default", .procname = "default",
.mode = 0555, .mode = 0555,
}, },
}, },
.neigh_neigh_dir = { .neigh_neigh_dir = {
{ {
.procname = "neigh", .procname = "neigh",
.mode = 0555, .mode = 0555,
}, },
}, },
.neigh_proto_dir = { .neigh_proto_dir = {
{ {
.mode = 0555, .mode = 0555,
}, },
}, },
.neigh_root_dir = { .neigh_root_dir = {
{ {
.ctl_name = CTL_NET, .ctl_name = CTL_NET,
.procname = "net", .procname = "net",
.mode = 0555, .mode = 0555,
}, },
}, },
}; };
......
...@@ -160,7 +160,9 @@ static struct timer_list whitehole_timer = ...@@ -160,7 +160,9 @@ static struct timer_list whitehole_timer =
TIMER_INITIALIZER(whitehole_inject, 0, 0); TIMER_INITIALIZER(whitehole_inject, 0, 0);
static struct net_device whitehole_dev = { static struct net_device whitehole_dev = {
"whitehole", 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NULL, whitehole_init, }; .name = "whitehole",
.init = whitehole_init,
};
static int whitehole_open(struct net_device *dev) static int whitehole_open(struct net_device *dev)
{ {
......
...@@ -83,23 +83,62 @@ static struct ...@@ -83,23 +83,62 @@ static struct
{ {
int error; int error;
u8 scope; u8 scope;
} fib_props[RTA_MAX+1] = { } fib_props[RTA_MAX + 1] = {
{ 0, RT_SCOPE_NOWHERE}, /* RTN_UNSPEC */ {
{ 0, RT_SCOPE_UNIVERSE}, /* RTN_UNICAST */ .error = 0,
{ 0, RT_SCOPE_HOST}, /* RTN_LOCAL */ .scope = RT_SCOPE_NOWHERE,
{ 0, RT_SCOPE_LINK}, /* RTN_BROADCAST */ }, /* RTN_UNSPEC */
{ 0, RT_SCOPE_LINK}, /* RTN_ANYCAST */ {
{ 0, RT_SCOPE_UNIVERSE}, /* RTN_MULTICAST */ .error = 0,
{ -EINVAL, RT_SCOPE_UNIVERSE}, /* RTN_BLACKHOLE */ .scope = RT_SCOPE_UNIVERSE,
{ -EHOSTUNREACH, RT_SCOPE_UNIVERSE},/* RTN_UNREACHABLE */ }, /* RTN_UNICAST */
{ -EACCES, RT_SCOPE_UNIVERSE}, /* RTN_PROHIBIT */ {
{ -EAGAIN, RT_SCOPE_UNIVERSE}, /* RTN_THROW */ .error = 0,
.scope = RT_SCOPE_HOST,
}, /* RTN_LOCAL */
{
.error = 0,
.scope = RT_SCOPE_LINK,
}, /* RTN_BROADCAST */
{
.error = 0,
.scope = RT_SCOPE_LINK,
}, /* RTN_ANYCAST */
{
.error = 0,
.scope = RT_SCOPE_UNIVERSE,
}, /* RTN_MULTICAST */
{
.error = -EINVAL,
.scope = RT_SCOPE_UNIVERSE,
}, /* RTN_BLACKHOLE */
{
.error = -EHOSTUNREACH,
.scope = RT_SCOPE_UNIVERSE,
}, /* RTN_UNREACHABLE */
{
.error = -EACCES,
.scope = RT_SCOPE_UNIVERSE,
}, /* RTN_PROHIBIT */
{
.error = -EAGAIN,
.scope = RT_SCOPE_UNIVERSE,
}, /* RTN_THROW */
#ifdef CONFIG_IP_ROUTE_NAT #ifdef CONFIG_IP_ROUTE_NAT
{ 0, RT_SCOPE_HOST}, /* RTN_NAT */ {
.error = 0,
.scope = RT_SCOPE_HOST,
}, /* RTN_NAT */
#else #else
{ -EINVAL, RT_SCOPE_NOWHERE}, /* RTN_NAT */ {
.error = -EINVAL,
.scope = RT_SCOPE_NOWHERE,
}, /* RTN_NAT */
#endif #endif
{ -EINVAL, RT_SCOPE_NOWHERE} /* RTN_XRESOLVE */ {
.error = -EINVAL,
.scope = RT_SCOPE_NOWHERE,
}, /* RTN_XRESOLVE */
}; };
......
...@@ -132,45 +132,43 @@ static int ipv6_chk_same_addr(const struct in6_addr *addr, struct net_device *de ...@@ -132,45 +132,43 @@ static int ipv6_chk_same_addr(const struct in6_addr *addr, struct net_device *de
static struct notifier_block *inet6addr_chain; static struct notifier_block *inet6addr_chain;
struct ipv6_devconf ipv6_devconf = struct ipv6_devconf ipv6_devconf = {
{ .forwarding = 0,
0, /* forwarding */ .hop_limit = IPV6_DEFAULT_HOPLIMIT,
IPV6_DEFAULT_HOPLIMIT, /* hop limit */ .mtu6 = IPV6_MIN_MTU,
IPV6_MIN_MTU, /* mtu */ .accept_ra = 1,
1, /* accept RAs */ .accept_redirects = 1,
1, /* accept redirects */ .autoconf = 1,
1, /* autoconfiguration */ .dad_transmits = 1,
1, /* dad transmits */ .rtr_solicits = MAX_RTR_SOLICITATIONS,
MAX_RTR_SOLICITATIONS, /* router solicits */ .rtr_solicit_interval = RTR_SOLICITATION_INTERVAL,
RTR_SOLICITATION_INTERVAL, /* rtr solicit interval */ .rtr_solicit_delay = MAX_RTR_SOLICITATION_DELAY,
MAX_RTR_SOLICITATION_DELAY, /* rtr solicit delay */
#ifdef CONFIG_IPV6_PRIVACY #ifdef CONFIG_IPV6_PRIVACY
.use_tempaddr = 0, .use_tempaddr = 0,
.temp_valid_lft = TEMP_VALID_LIFETIME, .temp_valid_lft = TEMP_VALID_LIFETIME,
.temp_prefered_lft = TEMP_PREFERRED_LIFETIME, .temp_prefered_lft = TEMP_PREFERRED_LIFETIME,
.regen_max_retry = REGEN_MAX_RETRY, .regen_max_retry = REGEN_MAX_RETRY,
.max_desync_factor = MAX_DESYNC_FACTOR, .max_desync_factor = MAX_DESYNC_FACTOR,
#endif #endif
}; };
static struct ipv6_devconf ipv6_devconf_dflt = static struct ipv6_devconf ipv6_devconf_dflt = {
{ .forwarding = 0,
0, /* forwarding */ .hop_limit = IPV6_DEFAULT_HOPLIMIT,
IPV6_DEFAULT_HOPLIMIT, /* hop limit */ .mtu6 = IPV6_MIN_MTU,
IPV6_MIN_MTU, /* mtu */ .accept_ra = 1,
1, /* accept RAs */ .accept_redirects = 1,
1, /* accept redirects */ .autoconf = 1,
1, /* autoconfiguration */ .dad_transmits = 1,
1, /* dad transmits */ .rtr_solicits = MAX_RTR_SOLICITATIONS,
MAX_RTR_SOLICITATIONS, /* router solicits */ .rtr_solicit_interval = RTR_SOLICITATION_INTERVAL,
RTR_SOLICITATION_INTERVAL, /* rtr solicit interval */ .rtr_solicit_delay = MAX_RTR_SOLICITATION_DELAY,
MAX_RTR_SOLICITATION_DELAY, /* rtr solicit delay */
#ifdef CONFIG_IPV6_PRIVACY #ifdef CONFIG_IPV6_PRIVACY
.use_tempaddr = 0, .use_tempaddr = 0,
.temp_valid_lft = TEMP_VALID_LIFETIME, .temp_valid_lft = TEMP_VALID_LIFETIME,
.temp_prefered_lft = TEMP_PREFERRED_LIFETIME, .temp_prefered_lft = TEMP_PREFERRED_LIFETIME,
.regen_max_retry = REGEN_MAX_RETRY, .regen_max_retry = REGEN_MAX_RETRY,
.max_desync_factor = MAX_DESYNC_FACTOR, .max_desync_factor = MAX_DESYNC_FACTOR,
#endif #endif
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment