diff options
author | 2016-02-24 22:41:53 +0000 | |
---|---|---|
committer | 2016-02-24 22:41:53 +0000 | |
commit | d6737014d5622fa82fba140d2ced117df6ac3678 (patch) | |
tree | 30506539d880453729f0eae98af56c2d01b3bbad /sys/net/rtable.c | |
parent | Fix the build with DRMDEBUG. Committing now instead of after unlock to (diff) | |
download | wireguard-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.c | 6 |
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; |