With macvlan support built into the kernel (CONFIG_MACVLAN=y in .config), running linux 3.1.x, there is no /sys/module/macvlan. This causes _check_macvlan to incorrectly decide that there is no kernel support for macvlan and bail. Commenting out the call to _check_macvlan makes the module mostly work (but see followup bug about not bringing the interface up).
Interestingly the module still works with _check_macvlan commented out, macvlan a kernel module, and the kernel module not explicitly loaded. The kernel autoloads the module when the "ip link add" command is run. The modprobe in _check_macvlan is not really necessary.
Without macvlan support the "ip link add" fails with "RTNETLINK answers: Operation not supported". If this error message is deemed sufficiently obvious just removing the check altogether should suffice.
For reference, my /etc/conf.d/net is:
routes_macvlan0="default via 192.168.1.254"
Created attachment 297315 [details]
This patch removes the _check_macvlan function.
Can you test this and let me know if you have any issues?
I have tested the attached patch on this bug and the patch attached to
bug #396429. Macvlan is a module here, with kernel 3.0, and with both of
these patches, macvlan0 came up successfully.
Let me know if you want me to do anything else before I commit.
This is fixed in commit 759f4ca.
Thanks for the report.