summaryrefslogtreecommitdiff
blob: 40e541538c4c85bf7c63727be24c9650ec1e86b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
https://bugs.gentoo.org/show_bug.cgi?id=289943

From ab302148275a973c3fccd164fa1ae4b4c4409d21 Mon Sep 17 00:00:00 2001
From: Jeremy Olexa <darkside@gentoo.org>
Date: Wed, 28 Oct 2009 21:04:39 -0500
Subject: [PATCH 2/2] Add ipv6 monitor support to mirmon

This patch will overload the gethost() function provided by perl in such a way
that it uses gethostbyname2() from Socket6, which is a new dependency.

Original patch by: Kent Fredric
---
 mirmon |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/mirmon b/mirmon
index 6c0aaa8..50d40ca 100755
--- a/mirmon
+++ b/mirmon
@@ -30,7 +30,17 @@ my $VER = '$Id: 0002-Add-ipv6-monitor-support-to-mirmon.patch,v 1.1 2009/10/29 02:26:38 darkside Exp $' ;
 use strict ;
 use IO::Pipe ;
 use IO::Select ;
-use Net::hostent ;
+
+use Socket;
+use Socket6;
+use Data::Dumper qw( Dumper );
+
+sub gethost($){
+  my $url = shift;
+  return 1 if gethostbyname2 $url, AF_INET;
+  return 1 if gethostbyname2 $url, AF_INET6;
+  return 0;
+}
 
 my $DEF_CNF = "/etc/$PRG.conf" ;
 
-- 
1.6.4.4