summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2006-03-06 13:34:03 +0000
committerhenning <henning@openbsd.org>2006-03-06 13:34:03 +0000
commit23c0977a4636e6fb7f2929d69c804a8268cfc3bd (patch)
tree2056aaee04d28099cd62d940ef7a404191770a99
parentmore cleanup, again no binary change. (diff)
downloadwireguard-openbsd-23c0977a4636e6fb7f2929d69c804a8268cfc3bd.tar.xz
wireguard-openbsd-23c0977a4636e6fb7f2929d69c804a8268cfc3bd.zip
change a questionable multi-level foo ? a : b construct into readable
code. no binary change.
-rw-r--r--sys/net/route.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index 0e602962b88..6eae02050cb 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.66 2006/03/06 13:29:28 henning Exp $ */
+/* $OpenBSD: route.c,v 1.67 2006/03/06 13:34:03 henning Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@@ -362,11 +362,11 @@ rtredirect(struct sockaddr *dst, struct sockaddr *gateway,
struct sockaddr *netmask, int flags, struct sockaddr *src,
struct rtentry **rtp)
{
- struct rt_addrinfo info;
struct rtentry *rt;
- struct ifaddr *ifa;
- u_int32_t *stat = NULL;
int error = 0;
+ u_int32_t *stat = NULL;
+ struct rt_addrinfo info;
+ struct ifaddr *ifa;
splassert(IPL_SOFTNET);
@@ -625,8 +625,10 @@ rt_getifa(struct rt_addrinfo *info)
if (info->rti_ifa == NULL) {
struct sockaddr *sa;
- sa = ifaaddr != NULL ? ifaaddr :
- (gateway != NULL ? gateway : dst);
+ if ((sa = ifaaddr) == NULL)
+ if ((sa = gateway) == NULL)
+ sa = dst;
+
if (sa != NULL && info->rti_ifp != NULL)
info->rti_ifa = ifaof_ifpforaddr(sa, info->rti_ifp);
else if (dst != NULL && gateway != NULL)