summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/net/if.c6
-rw-r--r--sys/net/route.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 7068202e0d7..272c773336c 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.167 2008/01/05 07:26:04 deraadt Exp $ */
+/* $OpenBSD: if.c,v 1.168 2008/01/05 19:08:19 henning Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -1290,8 +1290,8 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p)
break;
case SIOCGIFRTLABEL:
- if (ifp->if_rtlabelid) {
- label = rtlabel_id2name(ifp->if_rtlabelid);
+ if (ifp->if_rtlabelid &&
+ (label = rtlabel_id2name(ifp->if_rtlabelid)) != NULL) {
strlcpy(ifrtlabelbuf, label, RTLABEL_LEN);
error = copyoutstr(ifrtlabelbuf, ifr->ifr_data,
RTLABEL_LEN, &bytesdone);
diff --git a/sys/net/route.c b/sys/net/route.c
index 38ab3e3a5fa..4258c2eef44 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.86 2007/09/17 05:06:20 pyr Exp $ */
+/* $OpenBSD: route.c,v 1.87 2008/01/05 19:08:19 henning Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@@ -1029,8 +1029,8 @@ rtinit(struct ifaddr *ifa, int cmd, int flags)
info.rti_flags = flags | ifa->ifa_flags;
info.rti_info[RTAX_DST] = dst;
info.rti_info[RTAX_GATEWAY] = ifa->ifa_addr;
- if (ifa->ifa_ifp->if_rtlabelid) {
- label = rtlabel_id2name(ifa->ifa_ifp->if_rtlabelid);
+ if (ifa->ifa_ifp->if_rtlabelid &&
+ (label = rtlabel_id2name(ifa->ifa_ifp->if_rtlabelid)) != NULL) {
bzero(&sa_rl, sizeof(sa_rl));
sa_rl.sr_len = sizeof(sa_rl);
sa_rl.sr_family = AF_UNSPEC;