summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMantas Mikulėnas <grawity@gmail.com>2017-03-24 12:01:45 +0000
committerRoy Marples <roy@marples.name>2017-03-24 12:21:17 +0000
commitb76edfe80bc2435fbe3ff973f3b28d77b83eb114 (patch)
treee281d9002b331193d76d53351f1e09c576ed3e99
parentf2ad8bea1043ac20369d1e0d48c4351710def26f (diff)
downloadparpd-b76edfe80bc2435fbe3ff973f3b28d77b83eb114.tar.xz
Do not crash when ifa_addr is null
Summary: This happens with tun interfaces, which are layer 3 only. Fixes T109. Reviewers: roy Reviewed By: roy Maniphest Tasks: T109 Differential Revision: https://dev.marples.name/D103
-rw-r--r--parpd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/parpd.c b/parpd.c
index 0bfcc71..a178696 100644
--- a/parpd.c
+++ b/parpd.c
@@ -474,6 +474,8 @@ ifa_valid(int s, const struct ifaddrs *ifa)
{
struct ifreq ifr;
+ if (ifa->ifa_addr == NULL)
+ return 0;
#ifdef AF_LINK
if (ifa->ifa_addr->sa_family != AF_LINK)
return 0;