Project

General

Profile

Actions

Bug #15648

closed

Attempting to create multiple link-local IPv6 addresses leaves subinterfaces behind

Added by Andy Fiddaman about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
networking
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:

Description

Trying to create additional link-local addresses on an interface results in subinterfaces being created even though the command ultimately fails:

bloody% ifconfig | grep -A1 vioif0
vioif0: flags=20002004841<UP,RUNNING,MULTICAST,DHCP,IPv6> mtu 1400 index 3
        inet6 fe80::8:20ff:fe10:1cb6/10
vioif0:1: flags=20002000841<UP,RUNNING,MULTICAST,IPv6> mtu 1400 index 3
        inet6 2a00:5600:1600:1::2/64

bloody% for i in {0..5}; do
for> pfexec ipadm create-addr -T addrconf vioif0/ni
for> done
ipadm: Could not create address: Addrconf already in progress
ipadm: Could not create address: Addrconf already in progress
ipadm: Could not create address: Addrconf already in progress
ipadm: Could not create address: Addrconf already in progress
ipadm: Could not create address: Addrconf already in progress
ipadm: Could not create address: Addrconf already in progress

bloody% ifconfig | grep -A1 vioif0
vioif0: flags=20002004841<UP,RUNNING,MULTICAST,DHCP,IPv6> mtu 1400 index 3
        inet6 fe80::8:20ff:fe10:1cb6/10
vioif0:1: flags=20002000841<UP,RUNNING,MULTICAST,IPv6> mtu 1400 index 3
        inet6 2a00:5600:1600:1::2/64
vioif0:2: flags=20002000840<RUNNING,MULTICAST,IPv6> mtu 1400 index 3
        inet6 ::/10
vioif0:3: flags=20002000840<RUNNING,MULTICAST,IPv6> mtu 1400 index 3
        inet6 ::/10
vioif0:4: flags=20002000840<RUNNING,MULTICAST,IPv6> mtu 1400 index 3
        inet6 ::/10
vioif0:5: flags=20002000840<RUNNING,MULTICAST,IPv6> mtu 1400 index 3
        inet6 ::/10
vioif0:6: flags=20002000840<RUNNING,MULTICAST,IPv6> mtu 1400 index 3
        inet6 ::/10
vioif0:7: flags=20002000840<RUNNING,MULTICAST,IPv6> mtu 1400 index 3
        inet6 ::/10

i_ipadm_create_linklocal() creates a new sub-interface and cleans it up in the failure case if the variable addif is set. Here are the relevant parts:

static ipadm_status_t
i_ipadm_create_linklocal(ipadm_handle_t iph, ipadm_addrobj_t addr)
{
        boolean_t addif = B_FALSE;
...
        status = i_ipadm_do_addif(iph, addr);
...
fail:
        /* Remove the linklocal that was created. */
        if (addif) {
                (void) ioctl(iph->iph_sock6, SIOCLIFREMOVEIF, (caddr_t)&lifr);
        } else {
...

Notice in particular that addif is never set to true.


Related issues

Related to illumos gate - Bug #15359: Failed create of IPv6 addrconf address made it undeletableClosedDan Cross

Actions
Actions #1

Updated by Electric Monk about 1 year ago

  • Gerrit CR set to 2846
Actions #2

Updated by Andy Fiddaman about 1 year ago

  • Related to Bug #15359: Failed create of IPv6 addrconf address made it undeletable added
Actions #3

Updated by Andy Fiddaman about 1 year ago

I tested this change by attempting to create a duplicate IPv6 addrconf interface when one already exists as each of:
- root (with all privileges);
- standard user (no auths, basic privs);
- user with the Network Management profile, but without using pfexec;
- same user, but this time using pfexec.

In each case there were no subinterfaces left around, although in the cases where the authorisations were sufficient I could see via dtrace that they were created and then subsequently cleaned up.

Actions #4

Updated by Electric Monk about 1 year ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit c8152f8f417d34bc129af68ca0b76cfa9ca764db

commit  c8152f8f417d34bc129af68ca0b76cfa9ca764db
Author: Andy Fiddaman <illumos@fiddaman.net>
Date:   2023-05-15T22:31:58.000Z

    15648 Attempting to create multiple link-local IPv6 addresses leaves subinterfaces behind
    15359 Failed create of IPv6 addrconf address made it undeletable
    Reviewed by: Dan Cross <cross@oxidecomputer.com>
    Reviewed by: Bill Sommerfeld <sommerfeld@alum.mit.edu>
    Reviewed by: Dan McDonald <danmcd@mnx.io>
    Approved by: Gordon Ross <gordon.w.ross@gmail.com>

Actions

Also available in: Atom PDF