Commit 73ae179a authored by Natanael Copa's avatar Natanael Copa

main/opennhrp: handle dns lookup failure properly

backport fix from upstream
http://opennhrp.git.sourceforge.net/git/gitweb.cgi?p=opennhrp/opennhrp;a=commit;h=10a70c0fabdc3a90840a3ede5ef47480b82ce425
(cherry picked from commit e8b6deb5)
parent 6e06983e
From 10a70c0fabdc3a90840a3ede5ef47480b82ce425 Mon Sep 17 00:00:00 2001
From: Timo Teras <timo.teras@iki.fi>
Date: Wed, 14 Oct 2009 13:21:39 +0300
Subject: [PATCH] peer: handle dns lookup failure properly
---
nhrp/nhrp_peer.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/nhrp/nhrp_peer.c b/nhrp/nhrp_peer.c
index fdeef17..aee2906 100644
--- a/nhrp/nhrp_peer.c
+++ b/nhrp/nhrp_peer.c
@@ -679,17 +679,17 @@ static void nhrp_peer_address_query_cb(struct nhrp_address_query *query,
address_query);
char host[64];
- if (num_addr <= 0) {
+ if (num_addr > 0) {
+ nhrp_info("Resolved '%s' as %s",
+ peer->nbma_hostname,
+ nhrp_address_format(&addrs[0], sizeof(host), host));
+ peer->next_hop_address = addrs[0];
+ peer->afnum = nhrp_afnum_from_pf(peer->next_hop_address.type);
+ nhrp_peer_run_up_script(peer);
+ } else {
nhrp_error("Failed to resolve '%s'", peer->nbma_hostname);
nhrp_peer_restart_error(peer);
}
-
- nhrp_info("Resolved '%s' as %s",
- peer->nbma_hostname,
- nhrp_address_format(&addrs[0], sizeof(host), host));
- peer->next_hop_address = addrs[0];
- peer->afnum = nhrp_afnum_from_pf(peer->next_hop_address.type);
- nhrp_peer_run_up_script(peer);
}
static void nhrp_peer_restart_cb(struct ev_timer *w, int revents)
--
1.6.5
# Maintainer: Natanael Copa <ncopa@alpinelinux.org> # Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=opennhrp pkgname=opennhrp
pkgver=0.11.2 pkgver=0.11.2
pkgrel=2 pkgrel=3
pkgdesc="NBMA Next Hop Resolution Protocol daemon" pkgdesc="NBMA Next Hop Resolution Protocol daemon"
url="http://sourceforge.net/projects/opennhrp" url="http://sourceforge.net/projects/opennhrp"
license="GPL-3" license="GPL-3"
...@@ -10,6 +10,7 @@ makedepends="c-ares-dev" ...@@ -10,6 +10,7 @@ makedepends="c-ares-dev"
subpackages="$pkgname-doc" subpackages="$pkgname-doc"
source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.bz2 source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.bz2
opennhrp-0.9.3-peer-up-bgp.patch opennhrp-0.9.3-peer-up-bgp.patch
0001-peer-handle-dns-lookup-failure-properly.patch
$pkgname.initd $pkgname.initd
$pkgname.confd $pkgname.confd
" "
...@@ -29,5 +30,6 @@ build() { ...@@ -29,5 +30,6 @@ build() {
} }
md5sums="3aace509ac79acbde3bb3e44e88798d5 opennhrp-0.11.2.tar.bz2 md5sums="3aace509ac79acbde3bb3e44e88798d5 opennhrp-0.11.2.tar.bz2
f81539fc92800bb79668dda119a97d1d opennhrp-0.9.3-peer-up-bgp.patch f81539fc92800bb79668dda119a97d1d opennhrp-0.9.3-peer-up-bgp.patch
7d4c31dbde10340eb0e053ae7804bf1e 0001-peer-handle-dns-lookup-failure-properly.patch
ae65f88ccf849ef882669a8b4f0c7fc0 opennhrp.initd ae65f88ccf849ef882669a8b4f0c7fc0 opennhrp.initd
8eee86233728dc0d156bbfee6d98f338 opennhrp.confd" 8eee86233728dc0d156bbfee6d98f338 opennhrp.confd"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment