-
Notifications
You must be signed in to change notification settings - Fork 874
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For IPv6 pass prefix not nexthop as network for connected nexthops ba…
…ck to the RDE so that the code actually works. Problem found and reported by Pier Carlo Chiodi (pierky at pierky com) OK deraadt@
- Loading branch information
Showing
1 changed file
with
5 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $OpenBSD: kroute.c,v 1.211 2017/01/24 04:22:42 benno Exp $ */ | ||
/* $OpenBSD: kroute.c,v 1.212 2017/03/28 05:04:09 claudio Exp $ */ | ||
|
||
/* | ||
* Copyright (c) 2003, 2004 Henning Brauer <[email protected]> | ||
|
@@ -2200,9 +2200,10 @@ knexthop_send_update(struct knexthop_node *kn) | |
kr = kn->kroute; | ||
n.valid = kroute_validate(&kr->r); | ||
n.connected = kr->r.flags & F_CONNECTED; | ||
if ((n.gateway.v4.s_addr = | ||
kr->r.nexthop.s_addr) != 0) | ||
if (kr->r.nexthop.s_addr != 0) { | ||
n.gateway.aid = AID_INET; | ||
n.gateway.v4.s_addr = kr->r.nexthop.s_addr; | ||
} | ||
if (n.connected) { | ||
n.net.aid = AID_INET; | ||
n.net.v4.s_addr = kr->r.prefix.s_addr; | ||
|
@@ -2221,7 +2222,7 @@ knexthop_send_update(struct knexthop_node *kn) | |
} | ||
if (n.connected) { | ||
n.net.aid = AID_INET6; | ||
memcpy(&n.net.v6, &kr6->r.nexthop, | ||
memcpy(&n.net.v6, &kr6->r.prefix, | ||
sizeof(struct in6_addr)); | ||
n.netlen = kr6->r.prefixlen; | ||
} | ||
|