[libvirt] [PATCH 07/13] Replace brSetInetAddress/brSetInetNetmask with brAddInetAddress
Laine Stump
laine at laine.org
Wed Dec 22 17:21:09 UTC 2010
On 12/20/2010 05:46 PM, Paweł Krześniak wrote:
> On Mon, Dec 20, 2010 at 09:03, Laine Stump<laine at laine.org> wrote:
>> brSetInetAddress can only set a single IP address on the bridge, and
>> uses a method (ioctl(SIOCSETIFADDR)) that only works for IPv4. Replace
>> it and brSetInetNetmask with a single function that uses the external
>> "ip addr add" command to add an address/prefix to the interface - this
>> supports IPv6, and allows adding multiple addresses to the interface.
> ioctl(SIOCSIFADDR) on AF_INET socket works for IPv4, on AF_INET6
> socket works for IPv6 space.
> You need to create fd6=socket(AF_INET6, SOCK_STREAM, 0) in brInit()
> and do ioctl() on fd6.
Interesting information. I still prefer to use the ip command, though,
as it allows me to add multiple IP addresses to an interface.
More information about the libvir-list
mailing list