** Description changed:

+ SRU Justification
+ 
+ Impact
+ bind(AF_UNSPEC) to INADDR_ANY doesn't work anymore, breaking some legacy 
applications
+ 
+ Fix
+ upstream commit 29c486df6a208432b370bd4be99ae1369ede28d8
+ 
+ Testcase
+ small C program below
+ 
+ 
======================================================================================
+ 
  commit d0733d2e29b65 (Check for mistakenly passed in non-IPv4 address),
  causes regressions in applications which expects bind(AF_UNSPEC) with
  INADDR_ANY to work. It was reported at
  https://bugzilla.kernel.org/show_bug.cgi?id=42012, but since
  bugzilla.kernel.org is not available for some time, some of the
  discussion about this issue is can be seen at
  http://patchwork.ozlabs.org/patch/112362/ for example as an additional
  source.
  
  Testcase:
  #include <stdio.h>
  #include <sys/socket.h>
  #include <string.h>
  #include <linux/in.h>
  
  int main(int argc, char **argv)
  {
-       struct sockaddr_in addr;
-       int fd, r;
+  struct sockaddr_in addr;
+  int fd, r;
  
-       fd = socket(PF_INET, SOCK_STREAM, 0);
-       memset(&addr, 0, sizeof(struct sockaddr_in));
-       r = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
-       if (!r)
-               printf("Everything looks good\n");
-       else
-               printf("ERROR: too strict AF_INET check\n");
-       close(fd);
+  fd = socket(PF_INET, SOCK_STREAM, 0);
+  memset(&addr, 0, sizeof(struct sockaddr_in));
+  r = bind(fd, (struct sockaddr *)&addr, sizeof(addr));
+  if (!r)
+   printf("Everything looks good\n");
+  else
+   printf("ERROR: too strict AF_INET check\n");
+  close(fd);
  }

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/900396

Title:
  Regression with applications which expects bind(AF_UNSPEC) with
  INADDR_ANY to work

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/900396/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to