FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 12-06-2011, 01:05 PM
Tim Gardner
 
Default APPLIED: Lucid/Maverick/Oneiric SRU, relax AF_INET check in bind()

On 12/05/2011 11:46 AM, Herton R. Krzesinski wrote:

SRU Justification

Impact
bind(AF_UNSPEC) to INADDR_ANY doesn't work anymore, breaking some legacy
applications, since commit d0733d2e29b65 (Check for mistakenly passed in
non-IPv4 address)

Fix
upstream commit 29c486df6a208432b370bd4be99ae1369ede28d8

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;

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
");
else
printf("ERROR: too strict AF_INET check
");
close(fd);
}




--
Tim Gardner tim.gardner@canonical.com

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

Thread Tools




All times are GMT. The time now is 10:03 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org