diff options
Diffstat (limited to 'lib/net.h')
-rw-r--r-- | lib/net.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -259,6 +259,14 @@ static inline ip_addr net_prefix(const net_addr *a) } } +static inline u32 net_mpls(const net_addr *a) +{ + if (a->type == NET_MPLS) + return ((net_addr_mpls *) a)->label; + + bug("Can't call net_mpls on non-mpls net_addr"); +} + static inline uint net4_pxlen(const net_addr *a) { return a->pxlen; } |