linux-sctp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pau Espin Pedrol <pespin@sysmocom.de>
To: linux-sctp@vger.kernel.org
Subject: Re: SCTP multi-homed association (::1)->(::1+127.0.0.1) attempting HEARTBEAT on 127.0.0.1->127.0.0.1
Date: Mon, 24 Aug 2020 10:23:47 +0000	[thread overview]
Message-ID: <8d6bafce-225b-32b3-93c2-48640251bac2@sysmocom.de> (raw)
In-Reply-To: <552de663-8aeb-ff84-a425-988da88ca5cd@sysmocom.de>

Hi Andreas,

My point is that the failure is in the client, which is creating an
AF_INET6 socket and only binding on ::1, so it should never try to use
"127.0.0.1" as local IP imho. Your comments may apply to the server,
which is actually behaving fine.

On 8/24/20 12:12 PM, Andreas Fink wrote:
> The problem might be that your socket(AF_INET6,SCTP,STREAM) gives you an
> IPv6 only socket
> but you are binding an IPv4 address to it with sctp_bindx. This will
> probably fail and thus you are binding to "any".

It doesn't fail, I'm checking the result of sctp_bindx() and
/proc/net/sctp/eps I initially attached to the bug tracker shows it's
binding fine as expected.

> 
> If you want IPv4+IPv6 in one socket, you need to specify a IPv4 address
> in  IPv6 compatibility format
> So you should sctp_bindx to   "::ffff:127.0.0.1" not to  "127.0.0.1"
>  (well in any case you should pass a struck sockaddr_in6 and not a
> struct sockaddr_in)

Not really. I'm creating an addr buffer containing both struct
sockaddr_in and struct sockaddr_in6 (see [1] if interested) after having
looked at how libsctp and the kernel handle the sctp_bindx call, and
it's working fine as backed by what /proc/net/sctp/eps shows.

[1]
https://git.osmocom.org/libosmocore/tree/src/socket.c?idí42a889004730beb26ce61ee462244b2bad6be9#n470

-- 
- Pau Espin Pedrol <pespin@sysmocom.de>         http://www.sysmocom.de/
===================================* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte

  parent reply	other threads:[~2020-08-24 10:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20 11:11 SCTP multi-homed association (::1)->(::1+127.0.0.1) attempting HEARTBEAT on 127.0.0.1->127.0.0.1 Pau Espin Pedrol
2020-08-21 20:17 ` Marcelo Ricardo Leitner
2020-08-24 10:00 ` Pau Espin Pedrol
2020-08-24 10:23 ` Pau Espin Pedrol [this message]
2020-08-24 10:33 ` Pau Espin Pedrol
2020-08-24 10:46 ` Harald Welte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8d6bafce-225b-32b3-93c2-48640251bac2@sysmocom.de \
    --to=pespin@sysmocom.de \
    --cc=linux-sctp@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).