From 258be56539a3d4b47fe779f9658ca3d88761878d Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Sat, 17 Aug 2019 13:36:36 +0200 Subject: Nest: Added const to ea_show just to declare that this shouldn't really change anything --- sysdep/unix/krt.c | 2 +- sysdep/unix/krt.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sysdep/unix') diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c index 42dd12f6..cccee456 100644 --- a/sysdep/unix/krt.c +++ b/sysdep/unix/krt.c @@ -1156,7 +1156,7 @@ krt_copy_config(struct proto_config *dest, struct proto_config *src) } static int -krt_get_attr(eattr *a, byte *buf, int buflen) +krt_get_attr(const eattr *a, byte *buf, int buflen) { switch (a->id) { diff --git a/sysdep/unix/krt.h b/sysdep/unix/krt.h index 6066f2f1..4a5d10d2 100644 --- a/sysdep/unix/krt.h +++ b/sysdep/unix/krt.h @@ -141,7 +141,7 @@ void krt_sys_copy_config(struct krt_config *, struct krt_config *); int krt_capable(rte *e); void krt_do_scan(struct krt_proto *); void krt_replace_rte(struct krt_proto *p, net *n, rte *new, rte *old); -int krt_sys_get_attr(eattr *a, byte *buf, int buflen); +int krt_sys_get_attr(const eattr *a, byte *buf, int buflen); /* kif sysdep */ -- cgit v1.2.3 From cdde3550dc188f493daf82ef9d9acf8b85d9d722 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Sat, 17 Aug 2019 14:57:41 +0200 Subject: Unix socket: Path length check directly before copying the path. This is not needed as the string is always short enough, anyway it may be needed in future and one strlen during BIRD start is cheap enough. --- sysdep/unix/io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sysdep/unix') diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index f6cc0e32..9d54a2c3 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -1495,7 +1495,9 @@ sk_open_unix(sock *s, char *name) if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) return -1; - /* Path length checked in test_old_bird() */ + /* Path length checked in test_old_bird() but we may need unix sockets for other reasons in future */ + ASSERT_DIE(strlen(name) < sizeof(sa.sun_path)); + sa.sun_family = AF_UNIX; strcpy(sa.sun_path, name); -- cgit v1.2.3