From 00dc400bb324312df5b7e532a0445b606e0dfdba Mon Sep 17 00:00:00 2001 From: itojun Date: Thu, 15 Jun 2000 05:50:22 +0000 Subject: [PATCH] correct port number matching (src/dst mixup). --- sys/netkey/key.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/netkey/key.c b/sys/netkey/key.c index 075fdd79efd9..9bd2616e101e 100644 --- a/sys/netkey/key.c +++ b/sys/netkey/key.c @@ -1,5 +1,5 @@ -/* $NetBSD: key.c,v 1.20 2000/06/14 03:16:23 itojun Exp $ */ -/* $KAME: key.c,v 1.129 2000/06/14 02:51:50 itojun Exp $ */ +/* $NetBSD: key.c,v 1.21 2000/06/15 05:50:22 itojun Exp $ */ +/* $KAME: key.c,v 1.130 2000/06/15 05:46:06 sakane Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -3825,7 +3825,7 @@ key_cmpspidx_withmask(spidx0, spidx1) switch (spidx0->dst.ss_family) { case AF_INET: - if (satosin(&spidx0->src)->sin_port != IPSEC_PORT_ANY + if (satosin(&spidx0->dst)->sin_port != IPSEC_PORT_ANY && satosin(&spidx0->dst)->sin_port != satosin(&spidx1->dst)->sin_port) return 0; @@ -3834,7 +3834,7 @@ key_cmpspidx_withmask(spidx0, spidx1) return 0; break; case AF_INET6: - if (satosin6(&spidx0->src)->sin6_port != IPSEC_PORT_ANY + if (satosin6(&spidx0->dst)->sin6_port != IPSEC_PORT_ANY && satosin6(&spidx0->dst)->sin6_port != satosin6(&spidx1->dst)->sin6_port) return 0;