Module Name:    src
Committed By:   maxv
Date:           Tue Jan 23 07:33:49 UTC 2018

Modified Files:
        src/sys/netinet: ip_icmp.c

Log Message:
Don't use global variables, that's obviously incorrect on MP systems.
One remains, because it is imported in tcp_timer.c, and I'm not totally
sure of how it interacts with icmp_mtudisc().


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 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.165 src/sys/netinet/ip_icmp.c:1.166
--- src/sys/netinet/ip_icmp.c:1.165	Tue Jan 23 07:15:04 2018
+++ src/sys/netinet/ip_icmp.c	Tue Jan 23 07:33:49 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_icmp.c,v 1.165 2018/01/23 07:15:04 maxv Exp $	*/
+/*	$NetBSD: ip_icmp.c,v 1.166 2018/01/23 07:33:49 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -94,7 +94,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.165 2018/01/23 07:15:04 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.166 2018/01/23 07:33:49 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -403,21 +403,9 @@ freeit:
 }
 
 struct sockaddr_in icmpsrc = {
-	.sin_len = sizeof (struct sockaddr_in),
+	.sin_len = sizeof(struct sockaddr_in),
 	.sin_family = AF_INET,
 };
-static struct sockaddr_in icmpdst = {
-	.sin_len = sizeof (struct sockaddr_in),
-	.sin_family = AF_INET,
-};
-static struct sockaddr_in icmpgw = {
-	.sin_len = sizeof (struct sockaddr_in),
-	.sin_family = AF_INET,
-};
-struct sockaddr_in icmpmask = { 
-	.sin_len = 8,
-	.sin_family = 0,
-};
 
 /*
  * Process a received ICMP message.
@@ -433,6 +421,14 @@ _icmp_input(struct mbuf *m, int hlen, in
 	void *(*ctlfunc)(int, const struct sockaddr *, void *);
 	int code;
 	struct rtentry *rt;
+	struct sockaddr_in icmpdst = {
+		.sin_len = sizeof(struct sockaddr_in),
+		.sin_family = AF_INET,
+	};
+	struct sockaddr_in icmpgw = {
+		.sin_len = sizeof(struct sockaddr_in),
+		.sin_family = AF_INET,
+	};
 
 	/*
 	 * Locate icmp structure in mbuf, and check
@@ -799,8 +795,6 @@ icmp_reflect(struct mbuf *m)
 
 	sin = ia ? &ia->ia_addr : NULL;
 
-	icmpdst.sin_addr = t;
-
 	/*
 	 * if the packet is addressed somewhere else, compute the
 	 * source address for packets routed back to the source, and

Reply via email to