Update link_sctp_linux.go

This commit is contained in:
Vadym Vikulin 2022-10-28 20:54:05 +00:00 committed by GitHub
parent 5f3a6c7d6c
commit 62324db959
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,7 +63,7 @@ func (l *linkSCTP) dial(url *url.URL, options linkOptions, sintf string) error {
//l.core.log.Printf("Read buffer %d", rbuf)
//l.core.log.Printf("Write buffer %d", wbuf)
conn.(*sctp.SCTPConn).SetEvents(sctp.SCTP_EVENT_DATA_IO)
return l.handler(url.String(), info, conn, options, false)
return l.handler(url.String(), info, conn, options, false, false)
}
func (l *linkSCTP) listen(url *url.URL, sintf string) (*Listener, error) {
@ -114,7 +114,7 @@ func (l *linkSCTP) listen(url *url.URL, sintf string) (*Listener, error) {
l.core.log.Printf("Read buffer %d", rbuf)
l.core.log.Printf("Write buffer %d", wbuf)
if err = l.handler(name, info, conn, linkOptions{}, true); err != nil {
if err = l.handler(name, info, conn, linkOptions{}, true, addr.IP.IsLinkLocalUnicast()); err != nil {
l.core.log.Errorln("Failed to create inbound link:", err)
}
}
@ -125,13 +125,13 @@ func (l *linkSCTP) listen(url *url.URL, sintf string) (*Listener, error) {
return entry, nil
}
func (l *linkSCTP) handler(name string, info linkInfo, conn net.Conn, options linkOptions, incoming bool) error {
func (l *linkSCTP) handler(name string, info linkInfo, conn net.Conn, options linkOptions, incoming bool, force boo) error {
return l.links.create(
conn, // connection
name, // connection name
info, // connection info
incoming, // not incoming
false, // not forced
force, // not forced
options, // connection options
)
}