[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(racoon 534) Problem with listen option: getsockname (Socket operation on non-socket)



Hello,

I have a problem when I use the listen directive in racoon.conf:

listen {
        isakmp 80.124.x.y [500];
        isakmp 80.124.w.z [500];
        isakmp 192.168.78.45 [500];
        isakmp 127.0.0.1 [500];
}

When packets are sent by the remote peer, racoon uses getsockname to get
the socket name and answers to it. But in my case getsockname is
failing.
If I don't specify any listen directive, racoon works fine.

I use racoon 0.3.1 on a Linux 2.6.5 kernel, Debian stable with
backported packages.

Following are racoon debug, lsof and strace output.
In the strace output, you will notice this line:

getsockname(0, 0xbffff6b8, [128])       = -1 ENOTSOCK (Socket operation
on non-socket)

Regards,



Here is the relevant part of the racoon log:

Jun 15 10:49:38 vpn racoon: INFO: @(#)ipsec-tools 0.3.1
(http://ipsec-tools.sourceforge.net)
Jun 15 10:49:38 vpn racoon: INFO: @(#)This product linked OpenSSL 0.9.7d
17 Mar 2004 (http://www.openssl.org/)
[...]
Jun 15 10:49:38 vpn racoon: INFO: 127.0.0.1[500] used as isakmp port
(fd=7)
Jun 15 10:49:38 vpn racoon: INFO: 192.168.78.45[500] used as isakmp port
(fd=8)
Jun 15 10:49:38 vpn racoon: INFO: 80.124.156.234[500] used as isakmp
port (fd=9)
Jun 15 10:49:38 vpn racoon: INFO: 80.124.166.194[500] used as isakmp
port (fd=10)
[...]
Jun 15 09:44:52 vpn racoon: DEBUG: configuration found for
80.124.156.226.
Jun 15 09:44:52 vpn racoon: INFO: IPsec-SA request for 80.124.156.226
queued due to no phase1 found.
Jun 15 09:44:52 vpn racoon: DEBUG: ===
Jun 15 09:44:52 vpn racoon: INFO: initiate new phase 1 negotiation:
80.124.166.194[500]<=>80.124.156.226[500]
Jun 15 09:44:52 vpn racoon: INFO: begin Identity Protection mode.
Jun 15 09:44:52 vpn racoon: DEBUG: new cookie: e60bb85033d29ac5
Jun 15 09:44:52 vpn racoon: DEBUG: add payload of len 48, next type 0
Jun 15 09:44:52 vpn racoon: DEBUG: 80 bytes from 80.124.166.194[500] to
80.124.156.226[500]
Jun 15 09:44:52 vpn racoon: ERROR: getsockname (Socket operation on
non-socket)
Jun 15 09:44:52 vpn racoon: ERROR: sendfromto failed
Jun 15 09:44:52 vpn racoon: ERROR: failed to begin ipsec sa
negotication.

Here is lsof output:
COMMAND  PID USER   FD   TYPE     DEVICE    SIZE    NODE NAME
racoon  5084 root  cwd    DIR        3,2    4096       2 /
racoon  5084 root  rtd    DIR        3,2    4096       2 /
racoon  5084 root  txt    REG        3,2  298472   31687
/usr/sbin/racoon
racoon  5084 root  mem    REG        3,2   82456   62668
/lib/ld-2.3.1.so
racoon  5084 root  mem    REG        3,2  186500  158624
/usr/lib/i686/cmov/libssl.so.0.9.7
racoon  5084 root  mem    REG        3,2  965956  158623
/usr/lib/i686/cmov/libcrypto.so.0.9.7
racoon  5084 root  mem    REG        3,2   56652   62735
/lib/libresolv-2.3.1.so
racoon  5084 root  mem    REG        3,2   47140  158606
/usr/lib/libipsec.so.0.0.0
racoon  5084 root  mem    REG        3,2 1104040   62724
/lib/libc-2.3.1.so
racoon  5084 root  mem    REG        3,2    7992   62726
/lib/libdl-2.3.1.so
racoon  5084 root    0u   CHR        1,3          187896 /dev/null
racoon  5084 root    1u   CHR        1,3          187896 /dev/null
racoon  5084 root    2u   CHR        1,3          187896 /dev/null
racoon  5084 root    3u  unix 0xd9f67880         4410500 socket
racoon  5084 root    4r   CHR        1,9          187902 /dev/urandom
racoon  5084 root    5u  sock        0,4         4410501 can't identify
protocol
racoon  5084 root    6u  sock        0,4         4410502 can't identify
protocol
racoon  5084 root    7u  IPv4    4410503             UDP
localhost.localdomain:500
racoon  5084 root    8u  IPv4    4410504             UDP
192.168.78.45:500
racoon  5084 root    9u  IPv4    4410505             UDP 80.124.x.y:500
racoon  5084 root   10u  IPv4    4410506             UDP 80.124.w.z:500
racoon  5084 root   11r   REG        3,3    2265   80888
/var/lib/racoon/racoon.conf2

Here is my strace output:

select(11, [5 6 7 8 9 10], NULL, NULL, {20, 0}) = 1 (in [5], left {16,
820000})
recv(5, "\2\6\0\3\310\0\0\0\3\0\0\0\0\0\0\0", 16, MSG_PEEK) = 16
recv(5, "\2\6\0\3\310\0\0\0\3\0\0\0\0\0\0\0\3\0\5\0\0 \0\0\2\0\0"...,
1600, MSG_PEEK) = 1600
recv(5, "\2\6\0\3\310\0\0\0\3\0\0\0\0\0\0\0\3\0\5\0\0 \0\0\2\0\0"...,
1600, 0) = 1600
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 61, 0) = 61
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 122, 0) = 122
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 108, 0) = 108
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 108, 0) = 108
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 108, 0) = 108
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 107, 0) = 107
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 120, 0) = 120
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 105, 0) = 105
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 122, 0) = 122
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 80, 0) = 80
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 75, 0) = 75
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
time([1087292301])                      = 1087292301
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<30>Jun 15 11:38:21 racoon: INFO"..., 101, 0) = 101
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 39, 0) = 39
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<30>Jun 15 11:38:21 racoon: INFO"..., 110, 0) = 110
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<30>Jun 15 11:38:21 racoon: INFO"..., 66, 0) = 66
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time(NULL)                              = 1087292301
time([1087292301])                      = 1087292301
getpid()                                = 7217
getpid()                                = 7217
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 65, 0) = 65
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 70, 0) = 70
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 92, 0) = 92
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
getsockname(0, 0xbffff6b8, [128])       = -1 ENOTSOCK (Socket operation
on non-socket)
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<30>Jun 15 11:38:21 racoon: ERRO"..., 80, 0) = 80
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<30>Jun 15 11:38:21 racoon: ERRO"..., 53, 0) = 53
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<30>Jun 15 11:38:21 racoon: ERRO"..., 74, 0) = 74
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
time([1087292301])                      = 1087292301
select(11, [5 6 7 8 9 10], NULL, NULL, {16, 0}) = 1 (in [5], left {15,
78000})
recv(5, "\2\6\0\3\310\0\0\0\4\0\0\0\0\0\0\0", 16, MSG_PEEK) = 16
recv(5, "\2\6\0\3\310\0\0\0\4\0\0\0\0\0\0\0\3\0\5\0\0 \0\0\2\0\0"...,
1600, MSG_PEEK) = 1600
recv(5, "\2\6\0\3\310\0\0\0\4\0\0\0\0\0\0\0\3\0\5\0\0 \0\0\2\0\0"...,
1600, 0) = 1600
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 61, 0) = 61
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 120, 0) = 120
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 106, 0) = 106
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 108, 0) = 108
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 106, 0) = 106
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 107, 0) = 107
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 106, 0) = 106
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 106, 0) = 106
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 106, 0) = 106
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 105, 0) = 105
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 118, 0) = 118
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 103, 0) = 103
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 122, 0) = 122
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 80, 0) = 80
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 75, 0) = 75
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
time([1087292301])                      = 1087292301
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<30>Jun 15 11:38:21 racoon: INFO"..., 101, 0) = 101
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292301])                      = 1087292301
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:21 racoon: DEBU"..., 39, 0) = 39
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292302])                      = 1087292302
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<30>Jun 15 11:38:22 racoon: INFO"..., 110, 0) = 110
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292302])                      = 1087292302
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<30>Jun 15 11:38:22 racoon: INFO"..., 66, 0) = 66
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time(NULL)                              = 1087292302
time([1087292302])                      = 1087292302
getpid()                                = 7217
getpid()                                = 7217
time([1087292302])                      = 1087292302
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:22 racoon: DEBU"..., 65, 0) = 65
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292302])                      = 1087292302
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:22 racoon: DEBU"..., 70, 0) = 70
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292302])                      = 1087292302
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<31>Jun 15 11:38:22 racoon: DEBU"..., 92, 0) = 92
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
getsockname(0, 0xbffff6b8, [128])       = -1 ENOTSOCK (Socket operation
on non-socket)
time([1087292302])                      = 1087292302
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<30>Jun 15 11:38:22 racoon: ERRO"..., 80, 0) = 80
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292302])                      = 1087292302
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<30>Jun 15 11:38:22 racoon: ERRO"..., 53, 0) = 53
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292302])                      = 1087292302
rt_sigaction(SIGPIPE, {0x4021240e, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<30>Jun 15 11:38:22 racoon: ERRO"..., 74, 0) = 74
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
time([1087292302])                      = 1087292302
time([1087292302])                      = 1087292302
select(11, [5 6 7 8 9 10], NULL, NULL, {15, 0} <unfinished ...>

-- 
Cédric Delfosse                             Linbox / Free&ALter Soft
152, rue de Grigy - Technopole Metz              57070 Metz - FRANCE
tél: +33 (0)3 87 50 87 90                          http://linbox.com