I have a USB CAN device that create a network interface:
$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:30:18:05:ed:0d brd ff:ff:ff:ff:ff:ff
inet 192.168.8.156/24 brd 192.168.8.255 scope global dynamic noprefixroute enp2s0
valid_lft 85716sec preferred_lft 85716sec
inet6 fd4c:5077:bd05:c700:7917:7860:6e2b:7d47/64 scope global temporary dynamic
valid_lft 6854sec preferred_lft 3254sec
inet6 fd4c:5077:bd05:c700:230:18ff:fe05:ed0d/64 scope global dynamic mngtmpaddr
valid_lft 6854sec preferred_lft 3254sec
inet6 fe80::230:18ff:fe05:ed0d/64 scope link
valid_lft forever preferred_lft forever
3: enp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 00:30:18:05:ed:0e brd ff:ff:ff:ff:ff:ff
4: wlp1s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether e8:84:a5:c1:f1:10 brd ff:ff:ff:ff:ff:ff
7: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 10
link/can
With Ubuntu 21.10 I brought my can0 interface up with this command:
sudo ip link set up can0
After upgrading to 22.04 the same command returns:
$ sudo ip link set up can0
RTNETLINK answers: Invalid argument
Looking at the manual of ip link the right syntax is slightly different:
ip link set { DEVICE | dev DEVICE | group DEVGROUP }
[ { up | down } ]
[ type TYPE ARGS ]
So I tried:
$ sudo ip link set dev can0 up type can
RTNETLINK answers: Invalid argument
but the error is the same. I don't understand the programmers that don't add the details of which is the invalid argument... If I would do something like this I would be fired.
Anyway, what's wrong in my syntax? How to retrieve the offending invalid argument?