On Wed, Nov 29, 2017 at 05:32:11PM +0100, Patrick Wildt wrote:
> On Wed, Nov 29, 2017 at 04:32:24PM +0100, Claudio Jeker wrote:
> > On Wed, Nov 29, 2017 at 02:43:45AM +0100, Jeremie Courreges-Anglas wrote:
> > > On Wed, Nov 29 2017, Claudio Jeker <cje...@diehard.n-r-g.com> wrote:
> > > > On Wed, Nov 29, 2017 at 01:59:06AM +0100, Claudio Jeker wrote:
> > > >> Seen in my log file:
> > > >> Nov 28 17:47:22 dramaqueen iked: vfprintf %s NULL in "%s: %s %s from 
> > > >> %s to
> > > >> %s ms gid %u, %ld bytes%s"
> > > >> 
> > > >> and
> > > >> 
> > > >> Nov 29 01:02:39 dramaqueen iked[49967]: ikev2_msg_send: IKE_SA_INIT
> > > >> request from (null) to 62.48.30.5:500 msgid 0, 438 bytes
> > > >> 
> > > >> The problem seems to be in print_host so try to not return NULL in 
> > > >> there.
> > > >> Maybe we could return something else but this is a start IMO.
> > > >
> > > > beck@ prefers to just print unknown instead  of the gai_strerror -- 
> > > > guess
> > > > that is more sensible.
> > > 
> > > Why would getnameinfo(NI_NUMERICHOST) fail here?  The code in
> > > ikev2_msg.c is:
> > > 
> > > --8<--
> > >   log_info("%s: %s %s from %s to %s msgid %u, %ld bytes%s", __func__,
> > >       print_map(exchange, ikev2_exchange_map),
> > >       (flags & IKEV2_FLAG_RESPONSE) ? "response" : "request",
> > >       print_host((struct sockaddr *)&msg->msg_local, NULL, 0),
> > >       print_host((struct sockaddr *)&msg->msg_peer, NULL, 0),
> > >       betoh32(hdr->ike_msgid),
> > >       ibuf_length(buf), isnatt ? ", NAT-T" : "");
> > > -->8--
> > > 
> > > Maybe msg->msg_local is corrupt?
> > > 
> > 
> > I assume so much. gai_strerror returns "system error" not very helpful.
> 
> I would like to find out where that comes from.  What's your setup?  I
> guess you can reproduce it easily?

More or less. It seems that msg_local is garbage:
$3 = {msg_data = 0x1b4e541fa4c0, msg_offset = 0, msg_local = {
    ss_len = 128 '\200', ss_family = 192 'À', 
    __ss_pad1 = 0x7f7ffffda8c2 "Ì]\001", __ss_pad2 = 30024042514159, 
    __ss_pad3 = 0x7f7ffffda8d0 "Ьýÿ\177\177"}, msg_locallen = 128, 
  msg_peer = {ss_len = 16 '\020', ss_family = 2 '\002', 
    __ss_pad1 = 0x7f7ffffda9ca "\001ô>0\036\005", __ss_pad2 = 0, 
    __ss_pad3 = 0x7f7ffffda9d8 ""}, msg_peerlen = 16, 

Why so I don't know.

Config is:
ikev2 "tunnel" active esp proto ipencap from 10.83.66.133/32 to 10.83.66.6/32 \
        peer 62.48.30.5 \
        ikesa group modp2048 \
        srcid dramaqueen.zyd.ch rsa
ikev2 "tunnel" active esp proto ipv6 from 10.83.66.133/32 to 10.83.66.6/32 \
        peer 62.48.30.5 \
        ikesa group modp2048 \
        srcid dramaqueen6.zyd.ch

The other end does not listen to iked so the connections never succeed. 
Maybe this helps.

-- 
:wq Claudio

Reply via email to