hdr = register_net_sysctl_sz(net, "net/ipv4", table,
ARRAY_SIZE(xfrm4_policy_table)); if (!hdr) goto err_reg;
net->ipv4.xfrm4_hdr = hdr; return 0;
err_reg: if (!net_eq(net, &init_net))
kfree(table);
err_alloc: return -ENOMEM;
}
static __net_exit void xfrm4_net_sysctl_exit(struct net *net)
{ conststruct ctl_table *table;
if (!net->ipv4.xfrm4_hdr) return;
table = net->ipv4.xfrm4_hdr->ctl_table_arg;
unregister_net_sysctl_table(net->ipv4.xfrm4_hdr); if (!net_eq(net, &init_net))
kfree(table);
} #else/* CONFIG_SYSCTL */ staticinlineint xfrm4_net_sysctl_init(struct net *net)
{ return 0;
}
staticinlinevoid xfrm4_net_sysctl_exit(struct net *net)
{
} #endif
staticint __net_init xfrm4_net_init(struct net *net)
{ int ret;
memcpy(&net->xfrm.xfrm4_dst_ops, &xfrm4_dst_ops_template, sizeof(xfrm4_dst_ops_template));
ret = dst_entries_init(&net->xfrm.xfrm4_dst_ops); if (ret) return ret;
ret = xfrm4_net_sysctl_init(net); if (ret)
dst_entries_destroy(&net->xfrm.xfrm4_dst_ops);
return ret;
}
staticvoid __net_exit xfrm4_net_exit(struct net *net)
{
xfrm4_net_sysctl_exit(net);
dst_entries_destroy(&net->xfrm.xfrm4_dst_ops);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.