diff options
author | Steven Barth <steven@midlink.org> | 2013-12-10 15:56:41 +0100 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2013-12-10 15:56:41 +0100 |
commit | 5df476f99b3254bfc26721452b17a5fc23e7142c (patch) | |
tree | 546400db61994a5a990fa32d56d168a124977110 /src/ndp.c | |
parent | 3d84d7c0b5fa08068b4055c793e1cccd6e0e9ea3 (diff) | |
parent | 93a6018520bf3521a6e853e5ffbff827d33f96b9 (diff) |
Merge branch 'master' of github.com:sbyx/odhcpd
Diffstat (limited to 'src/ndp.c')
-rw-r--r-- | src/ndp.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -160,10 +160,19 @@ int setup_ndp_interface(struct interface *iface, bool enable) if (iface->static_ndp_len) { char *entry = alloca(iface->static_ndp_len), *saveptr; + if (!entry) { + syslog(LOG_ERR, "Alloca failed for static NDP list"); + return -1; + } memcpy(entry, iface->static_ndp, iface->static_ndp_len); for (entry = strtok_r(entry, " ", &saveptr); entry; entry = strtok_r(NULL, " ", &saveptr)) { struct ndp_neighbor *n = malloc(sizeof(*n)); + if (!n) { + syslog(LOG_ERR, "Malloc failed for static NDP-prefix %s", entry); + return -1; + } + n->iface = iface; n->timeout = 0; |