summaryrefslogtreecommitdiff
path: root/sysdep
diff options
context:
space:
mode:
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/linux/netlink/netlink.c5
-rw-r--r--sysdep/unix/io.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/sysdep/linux/netlink/netlink.c b/sysdep/linux/netlink/netlink.c
index 98c63f02..38d00afe 100644
--- a/sysdep/linux/netlink/netlink.c
+++ b/sysdep/linux/netlink/netlink.c
@@ -268,7 +268,8 @@ nl_parse_link(struct nlmsghdr *h, int scan)
if (!a[IFLA_IFNAME] || RTA_PAYLOAD(a[IFLA_IFNAME]) < 2 ||
!a[IFLA_MTU] || RTA_PAYLOAD(a[IFLA_MTU]) != 4)
{
- log(L_ERR "nl_parse_link: Malformed message received");
+ if (scan)
+ log(L_ERR "nl_parse_link: Malformed message received");
return;
}
name = RTA_DATA(a[IFLA_IFNAME]);
@@ -384,7 +385,7 @@ nl_parse_addr(struct nlmsghdr *h)
ipa_ntoh(xbrd);
if (ipa_equal(xbrd, ifa.prefix) || ipa_equal(xbrd, ifa.brd))
ifa.brd = xbrd;
- else
+ else if (ifi->flags & IF_TMP_DOWN) /* Complain only during the first scan */
log(L_ERR "KIF: Invalid broadcast address %I for %s", xbrd, ifi->name);
}
#endif
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index 6faa176b..8cec2cdd 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -940,6 +940,10 @@ sk_open_unix(sock *s, char *name)
if (err = sk_setup(s))
goto bad;
unlink(name);
+
+ if (strlen(name) >= sizeof(sa.sun_path))
+ die("sk_open_unix: path too long");
+
sa.sun_family = AF_UNIX;
strcpy(sa.sun_path, name);
if (bind(fd, (struct sockaddr *) &sa, SUN_LEN(&sa)) < 0)