diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-10-17 23:36:21 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-10-17 23:36:21 +0000 |
| commit | e52702f29d003585dcfbb4914b2a52d77a177739 (patch) | |
| tree | 3e130ded38c48316796bfb602dc6fe6d119129d2 /zebra/kernel_socket.c | |
| parent | 6fbde29dafeaf7c6aab9789d3eaf0234e99eefb6 (diff) | |
| parent | 3d3c3cbd115a3c38b490d656002af777d002743c (diff) | |
Merge branch 'cmaster-next' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Conflicts:
bgpd/bgp_route.c
bgpd/bgp_routemap.c
bgpd/bgp_vty.c
isisd/isis_redist.c
isisd/isis_routemap.c
isisd/isis_vty.c
isisd/isisd.c
lib/command.c
lib/distribute.c
lib/if.c
lib/keychain.c
lib/routemap.c
lib/routemap.h
ospf6d/ospf6_asbr.c
ospf6d/ospf6_interface.c
ospf6d/ospf6_neighbor.c
ospf6d/ospf6_top.c
ospf6d/ospf6_zebra.c
ospf6d/ospf6d.c
ospfd/ospf_routemap.c
ospfd/ospf_vty.c
ripd/rip_routemap.c
ripngd/ripng_routemap.c
vtysh/extract.pl.in
vtysh/vtysh.c
zebra/interface.c
zebra/irdp_interface.c
zebra/rt_netlink.c
zebra/rtadv.c
zebra/test_main.c
zebra/zebra_routemap.c
zebra/zebra_vty.c
Diffstat (limited to 'zebra/kernel_socket.c')
| -rw-r--r-- | zebra/kernel_socket.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c index 3a232129b6..f3f0a2777e 100644 --- a/zebra/kernel_socket.c +++ b/zebra/kernel_socket.c @@ -21,6 +21,9 @@ #include <zebra.h> #include <net/if_types.h> +#ifdef __OpenBSD__ +#include <netmpls/mpls.h> +#endif #include "if.h" #include "prefix.h" @@ -1068,6 +1071,7 @@ rtm_write (int message, union sockunion *dest, union sockunion *mask, union sockunion *gate, + union sockunion *mpls, unsigned int index, int zebra_flags, int metric) @@ -1097,6 +1101,10 @@ rtm_write (int message, msg.rtm.rtm_addrs = RTA_DST; msg.rtm.rtm_addrs |= RTA_GATEWAY; msg.rtm.rtm_flags = RTF_UP; +#ifdef __OpenBSD__ + msg.rtm.rtm_flags |= RTF_MPATH; + msg.rtm.rtm_fmask = RTF_MPLS; +#endif msg.rtm.rtm_index = index; if (metric != 0) @@ -1142,6 +1150,17 @@ rtm_write (int message, else if (message == RTM_ADD) msg.rtm.rtm_flags |= RTF_HOST; +#ifdef __OpenBSD__ + if (mpls) + { + msg.rtm.rtm_addrs |= RTA_SRC; + msg.rtm.rtm_flags |= RTF_MPLS; + + if (mpls->smpls.smpls_label != htonl (MPLS_IMP_NULL_LABEL << MPLS_LABEL_OFFSET)) + msg.rtm.rtm_mpls = MPLS_OP_PUSH; + } +#endif + /* Tagging route with flags */ msg.rtm.rtm_flags |= (RTF_PROTO1); @@ -1166,6 +1185,9 @@ rtm_write (int message, SOCKADDRSET (dest, RTA_DST); SOCKADDRSET (gate, RTA_GATEWAY); SOCKADDRSET (mask, RTA_NETMASK); +#ifdef __OpenBSD__ + SOCKADDRSET (mpls, RTA_SRC); +#endif msg.rtm.rtm_msglen = pnt - (caddr_t) &msg; |
