the list of addresses on the interface of a guest is not cached anymore, but queried directly from the interface

This commit is contained in:
Tobias Brunner
2008-07-30 13:15:18 +00:00
parent 9901cdb4cd
commit eadd460f7c
2 changed files with 36 additions and 32 deletions
+6 -1
View File
@@ -443,13 +443,14 @@ static VALUE iface_add_addr(VALUE self, VALUE name)
addr = host_create_from_string(StringValuePtr(name), 0);
if (!addr)
{
rb_raise(rb_eRuntimeError, "invalid IP address");
rb_raise(rb_eArgError, "invalid IP address");
}
Data_Get_Struct(self, iface_t, iface);
if (!iface->add_address(iface, addr))
{
rb_raise(rb_eRuntimeError, "adding address failed");
}
addr->destroy(addr);
return self;
}
@@ -481,6 +482,10 @@ static VALUE iface_del_addr(VALUE self, VALUE vaddr)
host_t *addr;
addr = host_create_from_string(StringValuePtr(vaddr), 0);
if (!addr)
{
rb_raise(rb_eArgError, "invalid IP address");
}
Data_Get_Struct(self, iface_t, iface);
if (!iface->delete_address(iface, addr))
{