https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241954

            Bug ID: 241954
           Summary: netgraph fails on concurrent node rename
           Product: Base System
           Version: 12.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: b...@freebsd.org
          Reporter: free...@otoh.org

I have a FreeBSD 12.1 host on which I'm using jng to create netgraph nodes for
host interfaces. If I start the jails in series, it works fine. If I start them
in parallel netgraph fails to rename the nodes and those jails fail to
initialize.

jail.conf:

exec.prestart = "";
exec.start = "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown";
exec.poststop = "";
exec.clean;
mount.devfs;
mount.fdescfs;
mount.procfs;
persist;
vnet = new;
devfs_ruleset = 10; # random, log, null, fd/* and other critical items

# Dynamic wildcard parameter:
# Base the path off the jail name.
path = "/jail/${host.hostname}/root";
exec.consolelog = "/var/log/jail_${host.hostname}_console.log";

################################################################################
# External Jails
################################################################################

ext {
  host.hostname = "ext.example.com";
  exec.prestart += "jng bridge ext bridge0 bridge1";
  exec.poststop += "jng shutdown ext";
  vnet.interface = ng0_ext,ng1_ext;
}

################################################################################
# Internal Jails
################################################################################

ns0 {
  host.hostname = "ns0.example.com";
  exec.prestart += "jng bridge ns0 bridge0 bridge1";
  exec.poststop += "jng shutdown ns0";
  vnet.interface = ng0_ns0,ng1_ns0;
}

ns1 {
  host.hostname = "ns1.example.com";
  exec.prestart += "jng bridge ns1 bridge0 bridge1";
  exec.poststop += "jng shutdown ns1";
  vnet.interface = ng0_ns1,ng1_ns1;
}

wg {
  host.hostname = "wg.example.com";
  exec.prestart += "jng bridge wg bridge0 bridge1";
  exec.poststop += "jng shutdown wg";
  vnet.interface = ng0_wg,ng1_wg;
  devfs_ruleset = 11; # include tun
}

www {
  host.hostname = "www.example.com";
  exec.prestart += "jng bridge www bridge0 bridge1";
  exec.poststop += "jng shutdown www";
  vnet.interface = ng0_www,ng1_www;
  sysvshm; # postgresql
}

vault {
  host.hostname = "vault.example.com";
  exec.prestart += "jng bridge vault bridge0 bridge1";
  exec.poststop += "jng shutdown vault";
  vnet.interface = ng0_vault,ng1_vault;
}

dmesg:

WARNING: attempt to domain_add(netgraph) after domainfinalize()
bridge0: promiscuous mode enabled
ngeth0: link state changed to UP
ngeth0: changing name to 'ng0_www'
bridge1: promiscuous mode enabled
ngeth1: link state changed to UP
ngeth1: changing name to 'ng1_www'
ng_ether_ifnet_arrival_event: can't re-name node ng0_www
ng_ether_ifnet_arrival_event: can't re-name node ng1_www
lo0: link state changed to UP

Jail start (clean after boot with jails disabled):

[root@ext]# service jail start
Starting jails:ngctl: send msg: File exists
ngctl: send msg: File exists
ngctl: send msg: File exists
ngctl: jail: send msgns0: jng bridge ns0 bridge0 bridge1: failed:
jail: ngctl: wg: jng bridge wg bridge0 bridge1: failedFile exists

send msgjail: : ns1: jng bridge ns1 bridge0 bridge1: failed
File exists
jail: vault: jng bridge vault bridge0 bridge1: failed
jail: numbat: jng bridge numbat bridge0 bridge1: failed
ng0_www
ng1_www
www: created

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to