mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-21 16:39:39 +00:00
vfs/lxip: make gateway config attribute optional
This enables the application in router/gateway-less network configurations, e.g., test environments.
This commit is contained in:
@ -1616,19 +1616,15 @@ class Vfs::Lxip_file_system : public Vfs::File_system,
|
|||||||
Addr gateway = config.attribute_value("gateway", Addr());
|
Addr gateway = config.attribute_value("gateway", Addr());
|
||||||
Addr nameserver = config.attribute_value("nameserver", Addr());
|
Addr nameserver = config.attribute_value("nameserver", Addr());
|
||||||
|
|
||||||
/* either none or all 4 interface attributes must exist */
|
|
||||||
if (ip_addr == "") {
|
if (ip_addr == "") {
|
||||||
warning("Missing \"ip_addr\" attribute. Ignoring network interface config.");
|
warning("Missing \"ip_addr\" attribute. Ignoring network interface config.");
|
||||||
throw Genode::Xml_node::Nonexistent_attribute();
|
throw Genode::Xml_node::Nonexistent_attribute();
|
||||||
} else if (netmask == "") {
|
} else if (netmask == "") {
|
||||||
warning("Missing \"netmask\" attribute. Ignoring network interface config.");
|
warning("Missing \"netmask\" attribute. Ignoring network interface config.");
|
||||||
throw Genode::Xml_node::Nonexistent_attribute();
|
throw Genode::Xml_node::Nonexistent_attribute();
|
||||||
} else if (gateway == "") {
|
|
||||||
warning("Missing \"gateway\" attribute. Ignoring network interface config.");
|
|
||||||
throw Genode::Xml_node::Nonexistent_attribute();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log("static network interface: ip_addr=",ip_addr," netmask=",netmask," gateway=",gateway);
|
log("static network interface: ip_addr=",ip_addr," netmask=",netmask);
|
||||||
|
|
||||||
lxip_configure_static(ip_addr.string(), netmask.string(),
|
lxip_configure_static(ip_addr.string(), netmask.string(),
|
||||||
gateway.string(), nameserver.string());
|
gateway.string(), nameserver.string());
|
||||||
|
@ -64,7 +64,7 @@ append_if [use_dynamic_rom] config {
|
|||||||
<config ld_verbose="yes">
|
<config ld_verbose="yes">
|
||||||
<vfs>
|
<vfs>
|
||||||
<dir name="socket">
|
<dir name="socket">
|
||||||
<lxip mtu="400" ip_addr="10.0.2.55" netmask="255.255.255.0" gateway="10.0.2.1" nameserver="8.8.8.8"/>
|
<lxip mtu="400" ip_addr="10.0.2.55" netmask="255.255.255.0" nameserver="8.8.8.8"/>
|
||||||
</dir>
|
</dir>
|
||||||
</vfs>
|
</vfs>
|
||||||
<default-policy root="/socket" writeable="yes" />
|
<default-policy root="/socket" writeable="yes" />
|
||||||
|
Reference in New Issue
Block a user