]> git.baikalelectronics.ru Git - kernel.git/commit
mpls: Functions for reading and wrinting mpls labels over netlink
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 4 Mar 2015 01:13:19 +0000 (19:13 -0600)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Mar 2015 05:26:06 +0000 (00:26 -0500)
commit1cc10143ef530c17ec0bce36259b0f9b6edd96d5
tree26201a85773baac274b0c05ffa20ded79429ab15
parentee15b79488fc4c55a6662921004bc0a42be1a1e3
mpls: Functions for reading and wrinting mpls labels over netlink

Reading and writing addresses in network byte order in netlink is
traditional and I see no reason to change that.  MPLS is interesting
as effectively it has variabely length addresses (the MPLS label
stack).  To represent these variable length addresses in netlink
I use a valid MPLS label stack (complete with stop bit).

This achieves two things: a well defined existing format is used,
and the data can be interpreted without looking at it's length.

Not needed to look at the length to decode the variable length
network representation allows existing userspace functions
such as inet_ntop to be used without needed to change their
prototype.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mpls/af_mpls.c
net/mpls/internal.h