question about vlan driver
Hello, I have a short question about vlan driver; I see in the vlan driver the following code when creating a new vlan interface: vlan_newlink() { ... if (data[IFLA_VLAN_PROTOCOL]) proto = nla_get_be16(data[IFLA_VLAN_PROTOCOL]); else proto = htons(ETH_P_8021Q); ... } see: http://lxr.free-electrons.com/source/net/8021q/vlan_netlink.c#L105 I understand that in the common case, proto is ETH_P_8021Q. How can it be set to a different value when creating a vlan interface ? And to which other values can it be set ? I did not find anything by vconfig --help, and also by probing into the userspace code of the vconfig tool. any ideas? Regards, Kevin ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: question about vlan driver
Kevin Wilson wkev...@gmail.com writes: Hello, I have a short question about vlan driver; I see in the vlan driver the following code when creating a new vlan interface: vlan_newlink() { ... if (data[IFLA_VLAN_PROTOCOL]) proto = nla_get_be16(data[IFLA_VLAN_PROTOCOL]); else proto = htons(ETH_P_8021Q); ... } see: http://lxr.free-electrons.com/source/net/8021q/vlan_netlink.c#L105 I understand that in the common case, proto is ETH_P_8021Q. How can it be set to a different value when creating a vlan interface ? And to which other values can it be set ? I did not find anything by vconfig --help, and also by probing into the userspace code of the vconfig tool. That code is pretty new, so you won't find many examples on how to use it. But the commit message includes an example: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/net/8021q/vlan_netlink.c?id=8ad227ff89a7e6f05d07cd0acfd95ed3a24450ca You'll naturally need a pretty recent version of iproute2 as well. Actually, the matching userspace code doesn't seem to be in http://git.kernel.org/cgit/linux/kernel/git/shemminger/iproute2.git just yet. So you'd need a not-yet-there version of iproute2 :) The iproute2 patch was submitted at the same time as the kernel patch: http://www.spinics.net/lists/netdev/msg233587.html Bjørn ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: question about vlan driver
Hi, Bjorn Thanks a lot for your quick answer. This explains all ! It seems as though there was only one line from this patch was applied, since in the latest git of iproute I see: in include/linux/if_link.h:IFLA_VLAN_PROTOCOL which was added in this patch you mentioned http://www.spinics.net/lists/netdev/msg233587.html but nothing else It is probably a matter of sync between iproute version and kernel version rgs Kevin On Mon, May 6, 2013 at 9:26 PM, Bjørn Mork bj...@mork.no wrote: Kevin Wilson wkev...@gmail.com writes: Hello, I have a short question about vlan driver; I see in the vlan driver the following code when creating a new vlan interface: vlan_newlink() { ... if (data[IFLA_VLAN_PROTOCOL]) proto = nla_get_be16(data[IFLA_VLAN_PROTOCOL]); else proto = htons(ETH_P_8021Q); ... } see: http://lxr.free-electrons.com/source/net/8021q/vlan_netlink.c#L105 I understand that in the common case, proto is ETH_P_8021Q. How can it be set to a different value when creating a vlan interface ? And to which other values can it be set ? I did not find anything by vconfig --help, and also by probing into the userspace code of the vconfig tool. That code is pretty new, so you won't find many examples on how to use it. But the commit message includes an example: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/net/8021q/vlan_netlink.c?id=8ad227ff89a7e6f05d07cd0acfd95ed3a24450ca You'll naturally need a pretty recent version of iproute2 as well. Actually, the matching userspace code doesn't seem to be in http://git.kernel.org/cgit/linux/kernel/git/shemminger/iproute2.git just yet. So you'd need a not-yet-there version of iproute2 :) The iproute2 patch was submitted at the same time as the kernel patch: http://www.spinics.net/lists/netdev/msg233587.html Bjørn ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies