bugWeeChat - Bugs: bug #39119, Relay tries to bind to garbage...


bug #39119: Relay tries to bind to garbage addresses

Submitted by:  Mantas Mikulėnas <grawity>
Submitted on:  Wed 29 May 2013 05:41:34 PM UTC  
Category: relay pluginSeverity: 3 - Normal
Item Group: otherStatus: Fixed
Privacy: PublicAssigned to: Sebastien Helleu <flashcode>
Originator Name: Open/Closed: Closed
Release: 0.4.1IRC nick: grawity

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Wed 29 May 2013 05:41:34 PM UTC, original submission:

As reported on IRC by deese, asking the relay plugin to bind to a specific IP address will cause strange errors...

20:00 (deese) any clue about this error? 19:01 weechat =!= relay: cannot "bind" on port 9001 (ipv4.ssl.weechat): error 97 Address family not supported by protocol

...since it gives a garbage address to bind():

20:04 (deese) socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 37
20:04 (deese) bind(37, {sa_family=0x20b2 /* AF_??? */, sa_data="6260262 6260��������"}, 16) = -1 EAFNOSUPPORT (Address family not supported by protocol)

The problem is caused by an inet_pton() call in relay_server_create_socket() overwriting the beginning of *ptr_addr, where the sa_family and sa_port fields reside.

Patch attached.

Mantas Mikulėnas <grawity>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #28206:  0002-relay-warn-about-invalid-bind_address-values.patch added by grawity (2KiB - text/x-patch - Bonus: inform the user when bind_address could not be parsed)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by flashcode (Updated the item)
  • -unavailable- added by grawity (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 06 Oct 2013 07:41:08 AM UTCflashcodeOpen/ClosedOpen=>Closed
    Thu 30 May 2013 06:05:17 AM UTCflashcodeItem GroupNone=>other
      Assigned toNone=>flashcode
    Wed 29 May 2013 05:48:13 PM UTCgrawityAttached File-=>Added 0002-relay-warn-about-invalid-bind_address-values.patch, #28206
    Wed 29 May 2013 05:41:34 PM UTCgrawityAttached File-=>Added 0001-relay-fix-binding-to-an-IP-address.patch, #28205

    Back to the top

    Powered by Savane 3.1-cleanup1