summaryrefslogtreecommitdiff
path: root/zebra/rt_netlink.h
diff options
context:
space:
mode:
authorJakub Urbańczyk <xthaid@gmail.com>2020-06-10 11:44:31 +0200
committerJakub Urbańczyk <xthaid@gmail.com>2020-06-13 22:56:25 +0200
commit0be6e7d75dbbbfae33c3b51ae7c160d35b228915 (patch)
treebce89dc6c75a01809334c591f21ac9c5ab455465 /zebra/rt_netlink.h
parent312a6beed67017e53679673a763c7693514cdd7e (diff)
zebra: check for buffer boundary
* Move code encoding Netlink messages to separate functions * Add buffer bounds checking while creating Nelink messages Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
Diffstat (limited to 'zebra/rt_netlink.h')
-rw-r--r--zebra/rt_netlink.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/zebra/rt_netlink.h b/zebra/rt_netlink.h
index c09609f47c..429ff0bf85 100644
--- a/zebra/rt_netlink.h
+++ b/zebra/rt_netlink.h
@@ -64,11 +64,14 @@ extern "C" {
void rt_netlink_init(void);
/* MPLS label forwarding table change, using dataplane context information. */
-extern int netlink_mpls_multipath(int cmd, struct zebra_dplane_ctx *ctx);
+extern ssize_t netlink_mpls_multipath_msg_encode(int cmd,
+ struct zebra_dplane_ctx *ctx,
+ void *buf, size_t buflen);
-extern ssize_t netlink_route_multipath(int cmd, struct zebra_dplane_ctx *ctx,
- uint8_t *data, size_t datalen, bool fpm,
- bool force_nhg);
+extern ssize_t netlink_route_multipath_msg_encode(int cmd,
+ struct zebra_dplane_ctx *ctx,
+ uint8_t *data, size_t datalen,
+ bool fpm, bool force_nhg);
extern ssize_t netlink_macfdb_update_ctx(struct zebra_dplane_ctx *ctx,
uint8_t *data, size_t datalen);
@@ -78,9 +81,9 @@ extern int netlink_route_read(struct zebra_ns *zns);
extern int netlink_nexthop_change(struct nlmsghdr *h, ns_id_t ns_id,
int startup);
extern int netlink_nexthop_read(struct zebra_ns *zns);
-extern ssize_t netlink_nexthop_encode(uint16_t cmd,
- const struct zebra_dplane_ctx *ctx,
- void *buf, size_t buflen);
+extern ssize_t netlink_nexthop_msg_encode(uint16_t cmd,
+ const struct zebra_dplane_ctx *ctx,
+ void *buf, size_t buflen);
extern int netlink_neigh_change(struct nlmsghdr *h, ns_id_t ns_id);
extern int netlink_macfdb_read(struct zebra_ns *zns);