summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyoga Saito <contact@proelbtn.com>2021-11-22 22:50:48 +0900
committerRyoga Saito <contact@proelbtn.com>2021-11-22 23:32:30 +0900
commit7eab60a793c1e4835c4c7eca227aca1bf45e63bc (patch)
treee34e0da16985e791f5fb9cc8f845c67f80733648
parent2075387e77c06218eebcee597664f09c3724781e (diff)
zebra: add support for End.DT4
This patch enables zebra to insert End.DT4 nexthop into linux kernel. Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
-rw-r--r--include/linux/seg6_local.h1
-rw-r--r--zebra/rt_netlink.c26
2 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/seg6_local.h b/include/linux/seg6_local.h
index 5312de80bc..bb5c8ddfce 100644
--- a/include/linux/seg6_local.h
+++ b/include/linux/seg6_local.h
@@ -26,6 +26,7 @@ enum {
SEG6_LOCAL_IIF,
SEG6_LOCAL_OIF,
SEG6_LOCAL_BPF,
+ SEG6_LOCAL_VRFTABLE,
__SEG6_LOCAL_MAX,
};
#define SEG6_LOCAL_MAX (__SEG6_LOCAL_MAX - 1)
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index e36f320ad9..95e17a3767 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -438,6 +438,10 @@ parse_encap_seg6local(struct rtattr *tb,
if (tb_encap[SEG6_LOCAL_TABLE])
ctx->table = *(uint32_t *)RTA_DATA(tb_encap[SEG6_LOCAL_TABLE]);
+ if (tb_encap[SEG6_LOCAL_VRFTABLE])
+ ctx->table =
+ *(uint32_t *)RTA_DATA(tb_encap[SEG6_LOCAL_VRFTABLE]);
+
return act;
}
@@ -1467,6 +1471,16 @@ static bool _netlink_route_build_singlepath(const struct prefix *p,
ctx->table))
return false;
break;
+ case ZEBRA_SEG6_LOCAL_ACTION_END_DT4:
+ if (!nl_attr_put32(nlmsg, req_size,
+ SEG6_LOCAL_ACTION,
+ SEG6_LOCAL_ACTION_END_DT4))
+ return false;
+ if (!nl_attr_put32(nlmsg, req_size,
+ SEG6_LOCAL_VRFTABLE,
+ ctx->table))
+ return false;
+ break;
default:
zlog_err("%s: unsupport seg6local behaviour action=%u",
__func__,
@@ -2570,6 +2584,18 @@ ssize_t netlink_nexthop_msg_encode(uint16_t cmd,
ctx->table))
return 0;
break;
+ case SEG6_LOCAL_ACTION_END_DT4:
+ if (!nl_attr_put32(
+ &req->n, buflen,
+ SEG6_LOCAL_ACTION,
+ SEG6_LOCAL_ACTION_END_DT4))
+ return 0;
+ if (!nl_attr_put32(
+ &req->n, buflen,
+ SEG6_LOCAL_VRFTABLE,
+ ctx->table))
+ return 0;
+ break;
default:
zlog_err("%s: unsupport seg6local behaviour action=%u",
__func__, action);