From 7ab4c3cc61a2062a6702a3fe48efb19b0671e901 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 6 Dec 2010 15:14:21 -0800 Subject: Move is_local_address to common code Now part of lib/Vyatta/Misc.pm module --- scripts/keepalived/vyatta-keepalived.pl | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'scripts/keepalived') diff --git a/scripts/keepalived/vyatta-keepalived.pl b/scripts/keepalived/vyatta-keepalived.pl index 651832b1..dae60fcf 100755 --- a/scripts/keepalived/vyatta-keepalived.pl +++ b/scripts/keepalived/vyatta-keepalived.pl @@ -30,7 +30,6 @@ use Vyatta::Interface; use Vyatta::ConntrackSync; use Vyatta::Misc; use Getopt::Long; -use Socket; use strict; use warnings; @@ -40,18 +39,6 @@ my ( $conf_file, $changes_file ); my %HoA_sync_groups; my $ctsync_script = "/opt/vyatta/sbin/vyatta-vrrp-conntracksync.sh"; - -# To test if IP address is local use the kernel since -# Linux will only allow binding to local addresses -sub is_local_address { - my $addr = shift; - - socket( my $sock, PF_INET, SOCK_STREAM, 0) - or die "socket failed\n"; - - return bind($sock, sockaddr_in(0, inet_aton($addr))); -} - sub validate_source_addr { my ( $ifname, $source_addr ) = @_; -- cgit v1.2.3