Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet assign sin only when it is needed
details: https://anonhg.NetBSD.org/src/rev/b2c45eb660ba
branches: trunk
changeset: 338069:b2c45eb660ba
user: christos <christos%NetBSD.org@localhost>
date: Sat May 09 18:46:25 2015 +0000
description:
assign sin only when it is needed
diffstat:
sys/netinet/ip_icmp.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diffs (37 lines):
diff -r 86c41ac05060 -r b2c45eb660ba sys/netinet/ip_icmp.c
--- a/sys/netinet/ip_icmp.c Sat May 09 18:32:04 2015 +0000
+++ b/sys/netinet/ip_icmp.c Sat May 09 18:46:25 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_icmp.c,v 1.138 2015/05/02 14:41:32 roy Exp $ */
+/* $NetBSD: ip_icmp.c,v 1.139 2015/05/09 18:46:25 christos Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -94,7 +94,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.138 2015/05/02 14:41:32 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.139 2015/05/09 18:46:25 christos Exp $");
#include "opt_ipsec.h"
@@ -680,7 +680,7 @@
struct ip *ip = mtod(m, struct ip *);
struct in_ifaddr *ia;
struct ifaddr *ifa;
- struct sockaddr_in *sin = NULL;
+ struct sockaddr_in *sin;
struct in_addr t;
struct mbuf *opts = NULL;
int optlen = (ip->ip_hl << 2) - sizeof(struct ip);
@@ -721,8 +721,7 @@
}
}
- if (ia)
- sin = &ia->ia_addr;
+ sin = ia ? &ia->ia_addr : NULL;
icmpdst.sin_addr = t;
Home |
Main Index |
Thread Index |
Old Index