summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_icmp.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-12-08 10:51:01 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-12-08 10:51:01 +0000
commit289b5d92df74fa66f52fd6e6c1007523f9e1f37c (patch)
treedaa0f07283549c98d26ef3e64739f46fa8528374 /sys/netinet/ip_icmp.c
parentf76ca90c7214ed1dd62ada0fb63dea7beb7bf8ec (diff)
Do not use a "struct route" when a "struct rtentry" is enough.
ok millert@, bluhm@
Diffstat (limited to 'sys/netinet/ip_icmp.c')
-rw-r--r--sys/netinet/ip_icmp.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index 86527e9b2c9..d6ee15c9a17 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_icmp.c,v 1.127 2014/12/05 15:50:04 mpi Exp $ */
+/* $OpenBSD: ip_icmp.c,v 1.128 2014/12/08 10:51:00 mpi Exp $ */
/* $NetBSD: ip_icmp.c,v 1.19 1996/02/13 23:42:22 christos Exp $ */
/*
@@ -913,19 +913,16 @@ icmp_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
struct rtentry *
icmp_mtudisc_clone(struct in_addr dst, u_int rtableid)
{
- struct sockaddr_in *sin;
- struct route ro;
+ struct sockaddr_in sin;
struct rtentry *rt;
int error;
- memset(&ro, 0, sizeof(ro));
- ro.ro_tableid = rtableid;
- sin = satosin(&ro.ro_dst);
- sin->sin_family = AF_INET;
- sin->sin_len = sizeof(*sin);
- sin->sin_addr = dst;
+ memset(&sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_len = sizeof(sin);
+ sin.sin_addr = dst;
- rt = rtalloc(&ro.ro_dst, RT_REPORT|RT_RESOLVE, rtableid);
+ rt = rtalloc(sintosa(&sin), RT_REPORT|RT_RESOLVE, rtableid);
if (rt == NULL)
return (NULL);
@@ -941,7 +938,7 @@ icmp_mtudisc_clone(struct in_addr dst, u_int rtableid)
struct rt_addrinfo info;
memset(&info, 0, sizeof(info));
- info.rti_info[RTAX_DST] = sintosa(sin);
+ info.rti_info[RTAX_DST] = sintosa(&sin);
info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;
info.rti_flags = RTF_GATEWAY | RTF_HOST | RTF_DYNAMIC;