Module Name: src
Committed By: christos
Date: Sat May 9 18:46:25 UTC 2015
Modified Files:
src/sys/netinet: ip_icmp.c
Log Message:
assign sin only when it is needed
To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/sys/netinet/ip_icmp.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/netinet/ip_icmp.c
diff -u src/sys/netinet/ip_icmp.c:1.138 src/sys/netinet/ip_icmp.c:1.139
--- src/sys/netinet/ip_icmp.c:1.138 Sat May 2 10:41:32 2015
+++ src/sys/netinet/ip_icmp.c Sat May 9 14:46:25 2015
@@ -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 @@ icmp_reflect(struct mbuf *m)
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 @@ icmp_reflect(struct mbuf *m)
}
}
- if (ia)
- sin = &ia->ia_addr;
+ sin = ia ? &ia->ia_addr : NULL;
icmpdst.sin_addr = t;