diff options
author | 2015-11-24 12:48:20 +0000 | |
---|---|---|
committer | 2015-11-24 12:48:20 +0000 | |
commit | a8f21e608349ef84da2b59abb8497a94950e97dc (patch) | |
tree | dad6a646f429e93cd43e356a815e4c33fc9ffa41 /sys/net | |
parent | no need for zsc mlink now; (diff) | |
download | wireguard-openbsd-a8f21e608349ef84da2b59abb8497a94950e97dc.tar.xz wireguard-openbsd-a8f21e608349ef84da2b59abb8497a94950e97dc.zip |
in art_insert, if at_default on the first table is set then return the
existing route rather than overwrite it.
ok mpi@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/art.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net/art.c b/sys/net/art.c index d2135592f16..747878fa34d 100644 --- a/sys/net/art.c +++ b/sys/net/art.c @@ -1,4 +1,4 @@ -/* $OpenBSD: art.c,v 1.9 2015/11/24 12:06:30 mpi Exp $ */ +/* $OpenBSD: art.c,v 1.10 2015/11/24 12:48:20 dlg Exp $ */ /* * Copyright (c) 2015 Martin Pieuchot @@ -353,6 +353,9 @@ art_insert(struct art_root *ar, struct art_node *an, uint8_t *addr, int plen) /* Default route */ if (plen == 0) { + if (at->at_default != NULL) + return (at->at_default); + art_table_ref(ar, at); at->at_default = an; return (an); |