summaryrefslogtreecommitdiffstats
path: root/sys/net/rtable.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2016-02-24 22:41:53 +0000
committermpi <mpi@openbsd.org>2016-02-24 22:41:53 +0000
commitd6737014d5622fa82fba140d2ced117df6ac3678 (patch)
tree30506539d880453729f0eae98af56c2d01b3bbad /sys/net/rtable.c
parentFix the build with DRMDEBUG. Committing now instead of after unlock to (diff)
downloadwireguard-openbsd-d6737014d5622fa82fba140d2ced117df6ac3678.tar.xz
wireguard-openbsd-d6737014d5622fa82fba140d2ced117df6ac3678.zip
Fix ECMP routing by passing the correct destination address to the
hash routine. Bug reported and fix analysed by Jean-Daniel Dupas <jddupas AT xooloo DOT net> ok deraadt@
Diffstat (limited to 'sys/net/rtable.c')
-rw-r--r--sys/net/rtable.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/rtable.c b/sys/net/rtable.c
index 81a94e518aa..630c5e241dd 100644
--- a/sys/net/rtable.c
+++ b/sys/net/rtable.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtable.c,v 1.38 2016/01/18 18:27:12 mpi Exp $ */
+/* $OpenBSD: rtable.c,v 1.39 2016/02/24 22:41:53 mpi Exp $ */
/*
* Copyright (c) 2014-2015 Martin Pieuchot
@@ -367,7 +367,7 @@ rtable_match(unsigned int rtableid, struct sockaddr *dst, uint32_t *src)
#ifndef SMALL_KERNEL
/* Gateway selection by Hash-Threshold (RFC 2992) */
- if ((hash = rt_hash(rt, src)) != -1) {
+ if ((hash = rt_hash(rt, dst, src)) != -1) {
struct rtentry *mrt = rt;
int threshold, npaths = 1;
@@ -617,7 +617,7 @@ rtable_match(unsigned int rtableid, struct sockaddr *dst, uint32_t *src)
#ifndef SMALL_KERNEL
/* Gateway selection by Hash-Threshold (RFC 2992) */
- if ((hash = rt_hash(rt, src)) != -1) {
+ if ((hash = rt_hash(rt, dst, src)) != -1) {
struct rtentry *mrt;
struct srpl_iter i;
int threshold, npaths = 0;