05Jul20=======================================================================
1. Fix show/dxcc.
+2. Add HAPROXY "real ip" type 1 handling for incoming connections.
04Jul20=======================================================================
1. Give console.pl (or dx) a good going over with a bog brush to *finally*
(cough) make it work correctly with a full 80 column window (and not just
maxconnect => '1,Max Connections',
startt => '0,Start Time,cldatetime',
connlist => '1,Connections,parraydifft',
- width => '0,Preferred Width'
+ width => '0,Preferred Width',
);
#no strict;
&{$conn->{rproc}}($conn, "I$conn->{call}|$msg");
} elsif ($conn->{state} eq 'WL' ) {
$msg = uc $msg;
- if (is_callsign($msg)) {
+ if ($conn->{sort} =~ /^I/ && (my ($ip, $from) = $msg =~ /^PROXY TCP[46] ([\da-fA-F:\.]+) ([\da-fA-F:\.]+)/) ) {
+ # SOMEONE appears to have affixed an HA Proxy to my connection
+ $ip =~ s|^::ffff:||; # chop off leading pseudo IPV6 stuff on dual stack listeners
+ $from =~ s|^::ffff:||;
+ if ($from eq $conn->{peerhost}) {
+ dbg("ExtMsg: connect - PROXY IP change from '$conn->{peerhost}' -> '$ip'");
+ $conn->{peerhost} = $ip;
+ } else {
+ dbg("ExtMsg: connect - PROXY someone ($from) is trying to spoof '$ip'");
+ $conn->send_now("Sorry $msg is an invalid callsign");
+ $conn->disconnect;
+ }
+ } elsif (is_callsign($msg)) {
if ($main::allowslashcall || $msg !~ m|/|) {
my $sort = $conn->{csort};
$sort = 'local' if $conn->{peerhost} =~ /127\.\d+\.\d+\.\d+$/ || $conn->{peerhost} eq '::1';