ifupdown-ng / ifupdown-ng

flexible ifup/ifdown implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VRF interface doesn't come up with latest ifupdown-ng

EasyNetDev opened this issue · comments

Hi,

I'm facing a strange situation with the VRF interfaces. The config is very simple:

auto red
iface red
    vrf-table 300

But when I'm trying to bring the VRF up in the system I'm getting:

ifup: failed to change interface red state to 'up'

And the verbose output:

ifupdown: lo: attempting to run link executor for phase depend
/usr/libexec/ifupdown-ng/link
+ is_vlan
+ [ -z  ]
+ return 1
+ [  = veth -a  ]
ifupdown: lo: attempting to run loopback executor for phase depend
ifupdown: eth0: attempting to run link executor for phase depend
/usr/libexec/ifupdown-ng/link
+ is_vlan
+ [ -z  ]
+ return 1
+ [  = veth -a  ]
ifupdown: eth0: attempting to run static executor for phase depend
/usr/libexec/ifupdown-ng/static
+ [ -z  ]
+ IF_METRIC=1
+ [ -n  ]
+ [ -n  ]
+ [ -n 1 ]
+ METRIC=metric 1
+ exit 0
ifupdown: eth0: attempting to run name executor for phase depend
ifupdown: red: attempting to run link executor for phase depend
/usr/libexec/ifupdown-ng/link
+ is_vlan
+ [ -z  ]
+ return 1
+ [  = veth -a  ]
ifupdown: red: attempting to run vrf executor for phase depend
/usr/libexec/ifupdown-ng/vrf
+ echo
ifup: acquiring lock on /run/ifstate.red.lock
ifup: changing state of interface red to 'up'
ifupdown: red: attempting to run link executor for phase create
/usr/libexec/ifupdown-ng/link
+ [  = dummy ]
+ [  = veth ]
+ is_vlan
+ [ -z  ]
+ return 1
ifupdown: red: attempting to run vrf executor for phase create
/usr/libexec/ifupdown-ng/vrf
+ export
+ echo
+ [ -n 300 ]
+ handle_init add
+ /sbin/ip link add red type vrf table 300
+ kernel_version_48
+ uname -r
+ local kver=6.1.0-7-amd64
+ echo 6.1.0-7-amd64
+ sed s/\([0-9]\+\)\.\([0-9]\+\).*/\1/
+ local kverMaj=6
+ echo 6.1.0-7-amd64
+ sed s/\([0-9]\+\)\.\([0-9]\+\).*/\2/
+ local kverMin=1
+ [ 6 -le 4 -a 1 -lt 8 ]
+ return 1
+ return 0
ifupdown: red: attempting to run link executor for phase pre-up
/usr/libexec/ifupdown-ng/link
ifupdown: red: attempting to run vrf executor for phase pre-up
/usr/libexec/ifupdown-ng/vrf
+ export
+ echo
+ [ -n  ]
ifup: failed to change interface red state to 'up'

With version 0.11.4~rc1-1+b1 of ifupdown-ng in Debian is working well.

I did a debug on ifupdown tool for my config and this is the output:

# gdb --args ./ifupdown ifup -v red
(gdb) run
Starting program: /opt/devel/ifupdown-ng/ifupdown-ng-0.12.1/ifupdown ifup -v red
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
ifupdown: lo: attempting to run link executor for phase depend
/usr/libexec/ifupdown-ng/link
[Detaching after vfork from child process 3835539]
+ is_vlan
+ [ -z  ]
+ return 1
+ [  = veth -a  ]
ifupdown: lo: attempting to run loopback executor for phase depend
ifupdown: eth0: attempting to run link executor for phase depend
/usr/libexec/ifupdown-ng/link
[Detaching after vfork from child process 3835541]
+ is_vlan
+ [ -z  ]
+ return 1
+ [  = veth -a  ]
ifupdown: eth0: attempting to run static executor for phase depend
/usr/libexec/ifupdown-ng/static
[Detaching after vfork from child process 3835543]
+ [ -z  ]
+ IF_METRIC=1
+ [ -n  ]
+ [ -n  ]
+ [ -n 1 ]
+ METRIC=metric 1
+ exit 0
ifupdown: eth0: attempting to run name executor for phase depend
ifupdown: red: attempting to run link executor for phase depend
/usr/libexec/ifupdown-ng/link
[Detaching after vfork from child process 3835545]
+ is_vlan
+ [ -z  ]
+ return 1
+ [  = veth -a  ]
ifupdown: red: attempting to run vrf executor for phase depend
/usr/libexec/ifupdown-ng/vrf
[Detaching after vfork from child process 3835547]
+ echo
ifup: acquiring lock on /run/ifstate.red.lock
ifup: changing state of interface red to 'up'

Breakpoint 2, change_interface (iface=0x555555567cd0, collection=collection@entry=0x7fffffffe280,
    state=state@entry=0x7fffffffe2a0, ifname=ifname@entry=0x7fffffffd240 "red", update_state=update_state@entry=true)
    at cmd/ifupdown.c:174
174             if (!lif_lifecycle_run(&exec_opts, iface, collection, state, ifname, up))
(gdb) step
lif_lifecycle_run (opts=0x555555565500 <exec_opts>, iface=iface@entry=0x555555567cd0,
    collection=collection@entry=0x7fffffffe280, state=state@entry=0x7fffffffe2a0,
    lifname=lifname@entry=0x7fffffffd240 "red", up=true) at libifupdown/lifecycle.c:440
440     {
(gdb)
442             if (iface->is_pending)
(gdb)
445             if (iface->is_template)
(gdb)
448             if (lifname == NULL)
(gdb)
451             if (up)
(gdb)
454                     if (!handle_dependents(opts, iface, collection, state, up))
(gdb)
handle_dependents (opts=opts@entry=0x555555565500 <exec_opts>, parent=parent@entry=0x555555567cd0,
    collection=collection@entry=0x7fffffffe280, state=state@entry=0x7fffffffe2a0, up=up@entry=true)
    at libifupdown/lifecycle.c:369
369     {
(gdb)
370             struct lif_dict_entry *requires = lif_dict_find(&parent->vars, "requires");
(gdb)
lif_dict_find (dict=dict@entry=0x555555567ce0, key=key@entry=0x55555555f899 "requires") at libifupdown/dict.c:90
90      {
(gdb)
93              LIF_DICT_FOREACH(iter, dict)
(gdb)
95                      struct lif_dict_entry *entry = iter->data;
(gdb)
97                      if (!strcmp(entry->key, key))
(gdb)

Breakpoint 1, lif_lifecycle_run_phase (opts=opts@entry=0x555555565500 <exec_opts>, iface=iface@entry=0x555555567cd0,
    phase=phase@entry=0x555555560d9d "create", lifname=lifname@entry=0x7fffffffd240 "red", up=up@entry=true)
    at libifupdown/lifecycle.c:306
306             if (!handle_executors_for_phase(opts, envp, iface, up, phase))
(gdb)
handle_executors_for_phase (opts=opts@entry=0x555555565500 <exec_opts>, envp=0x555555569b30,
    iface=iface@entry=0x555555567cd0, up=up@entry=true, phase=phase@entry=0x555555560d9d "create")
    at libifupdown/lifecycle.c:68
68      {
(gdb)
72              if (up)
(gdb)
74                      LIF_DICT_FOREACH(iter, &iface->vars) {
(gdb)
75                              if (!handle_single_executor_for_phase(iter->data, opts, envp, phase, iface->ifname)) {
(gdb)
handle_single_executor_for_phase (entry=0x555555567d30, opts=opts@entry=0x555555565500 <exec_opts>,
    envp=envp@entry=0x555555569b30, phase=phase@entry=0x555555560d9d "create", lifname=0x555555567910 "red")
    at libifupdown/lifecycle.c:55
55      {
(gdb)
56              if (strcmp(entry->key, "use"))
(gdb)
ifupdown: red: attempting to run link executor for phase create
/usr/libexec/ifupdown-ng/link
[Detaching after vfork from child process 3835554]
+ [  = dummy ]
+ [  = veth ]
+ is_vlan
+ [ -z  ]
+ return 1
ifupdown: red: attempting to run vrf executor for phase create
/usr/libexec/ifupdown-ng/vrf
[Detaching after vfork from child process 3835556]
+ export
+ echo
+ [ -n 300 ]
+ handle_init add
+ /sbin/ip link add red type vrf table 300

Breakpoint 1, lif_lifecycle_run_phase (opts=opts@entry=0x555555565500 <exec_opts>, iface=iface@entry=0x555555567cd0,
    phase=phase@entry=0x555555560da4 "pre-up", lifname=lifname@entry=0x7fffffffd240 "red", up=up@entry=true)
    at libifupdown/lifecycle.c:306
306             if (!handle_executors_for_phase(opts, envp, iface, up, phase))
(gdb)
handle_executors_for_phase (opts=opts@entry=0x555555565500 <exec_opts>, envp=0x555555569bb0,
    iface=iface@entry=0x555555567cd0, up=up@entry=true, phase=phase@entry=0x555555560da4 "pre-up")
    at libifupdown/lifecycle.c:68
68      {
(gdb)
72              if (up)
(gdb)
74                      LIF_DICT_FOREACH(iter, &iface->vars) {
(gdb)
75                              if (!handle_single_executor_for_phase(iter->data, opts, envp, phase, iface->ifname)) {
(gdb)
handle_single_executor_for_phase (entry=0x555555567d30, opts=opts@entry=0x555555565500 <exec_opts>,
    envp=envp@entry=0x555555569bb0, phase=phase@entry=0x555555560da4 "pre-up", lifname=0x555555567910 "red")
    at libifupdown/lifecycle.c:55
55      {
(gdb)
56              if (strcmp(entry->key, "use"))
(gdb)
ifupdown: red: attempting to run link executor for phase pre-up
/usr/libexec/ifupdown-ng/link
[Detaching after vfork from child process 3835572]
ifupdown: red: attempting to run vrf executor for phase pre-up
/usr/libexec/ifupdown-ng/vrf
[Detaching after vfork from child process 3835574]
+ export
+ echo
+ [ -n  ]
ifup: failed to change interface red state to 'up'
[Inferior 1 (process 3835538) exited with code 01]

I don't understand why is not bringing up the VRF interface.