68 |
warn ">> ",$sock->peeraddr,":",$sock->peerport," send $ip with server $ip_server\n",$packet->toString(),"\n"; |
warn ">> ",$sock->peeraddr,":",$sock->peerport," send $ip with server $ip_server\n",$packet->toString(),"\n"; |
69 |
|
|
70 |
my $reply = IO::Socket::INET->new( |
my $reply = IO::Socket::INET->new( |
71 |
LocalAddr => '10.0.0.100', |
LocalAddr => $ip_server, |
72 |
LocalPort => 67, |
LocalPort => 67, |
73 |
Proto => "udp", |
Proto => "udp", |
74 |
Broadcast => 1, |
Broadcast => 1, |
81 |
my $buff = $packet->serialize(); |
my $buff = $packet->serialize(); |
82 |
$reply->send( $buff, 0 ) or die "Error sending: $!\n"; |
$reply->send( $buff, 0 ) or die "Error sending: $!\n"; |
83 |
|
|
84 |
|
# system("arp -s $ip ",$dhcp->chaddr()); |
85 |
|
|
86 |
} else { |
} else { |
87 |
print "No bootp request.\n"; |
print "No bootp request.\n"; |
88 |
} |
} |