nl_dump_line(p, " vlan-info id %d <%s>", vi->vi_vlan_id, buf);
if (vi->vi_mask & VLAN_HAS_PROTOCOL)
- nl_dump_line(p, " vlan protocol <%d>", vi->vi_protocol);
+ nl_dump_line(p, " vlan protocol <%d>", ntohs(vi->vi_protocol));
nl_dump(p, "\n");
/**
* Set VLAN protocol
* @arg link Link object
- * @arg protocol VLAN protocol
+ * @arg protocol VLAN protocol in network byte order.
+ * Probably you want to set it to something like htons(ETH_P_8021Q).
*
* @return 0 on success or a negative error code
*/
* Get VLAN protocol
* @arg link Link object
*
- * @return VLAN protocol, 0 if not set or a negative error code.
+ * @return VLAN protocol in network byte order like htons(ETH_P_8021Q),
+ * 0 if not set or a negative error code.
*/
int rtnl_link_vlan_get_protocol(struct rtnl_link *link)
{