curvecpserver fails to bind to socket

Bug #1316355 reported by Tv
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nacl (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

$ curvecpserver -v foo key 127.0.0.1 10000 31415926535897932384626433832795 curvecpmessage cat /usr/share/dict/words
curvecpserver: fatal: unable to bind socket: address family not supported
$ echo $?
111
$ strace -e bind curvecpserver -v foo key 127.0.0.1 10000 31415926535897932384626433832795 curvecpmessage cat /usr/share/dict/words
bind(12, {sa_family=AF_UNSPEC, sa_data="'\20\177\0\0\1\0\0\0\0\0\0\0\0"}, 16) = -1 EAFNOSUPPORT (Address family not supported by protocol)
curvecpserver: fatal: unable to bind socket: address family not supported
+++ exited with 111 +++

This patch fixes it:

diff -ru orig/nacl-20110221/curvecp/socket_bind.c nacl-20110221/curvecp/socket_bind.c
--- orig/nacl-20110221/curvecp/socket_bind.c 2011-02-20 17:49:34.000000000 -0800
+++ nacl-20110221/curvecp/socket_bind.c 2013-01-18 23:34:49.000000000 -0800
@@ -9,6 +9,7 @@
 {
   struct sockaddr_in sa;
   byte_zero(&sa,sizeof sa);
+ sa.sin_family = AF_INET;
   byte_copy(&sa.sin_addr,4,ip);
   byte_copy(&sa.sin_port,2,port);
   return bind(fd,(struct sockaddr *) &sa,sizeof sa);

Revision history for this message
Jan Mojžíš (jan-mojzis) wrote :

Fixed in 20110221-5

Changed in nacl (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.