| To: | Andrew Morton <akpm@xxxxxxxxx>, cliff white <cliffw@xxxxxxxx>, netdev@xxxxxxxxxxx |
|---|---|
| Subject: | 2.6.10-rc3-mm1 FIONREAD breakge |
| From: | Stephen Hemminger <shemminger@xxxxxxxx> |
| Date: | Fri, 17 Dec 2004 13:07:16 -0800 |
| Organization: | Open Source Development Lab |
| Sender: | netdev-bounce@xxxxxxxxxxx |
Latest -mm kernel broke FIONREAD on UDP sockets. This stopped STP in it's tracks
because then names don't resolve.
The following works on 2.6.10-rc3 but breaks on 2.6.10-rc3-mm1
=====================================
/* Did FIONREAD break on UDP? */
#include <stdio.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <arpa/inet.h>
int main(int argc, char **argv)
{
int s;
static struct sockaddr_in sin = { AF_INET };
int len;
s = socket(AF_INET, SOCK_DGRAM, 0);
if (bind(s, (struct sockaddr *) &sin, sizeof(sin)) < 0)
perror("bind");
len = sizeof(sin);
getsockname(s, (struct sockaddr *) &sin, &len);
printf("Bound to %s.%d\n",
inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
for(;;) {
unsigned long count;
fflush(stdout);
if (ioctl(s, FIONREAD, &count) < 0)
perror("ioctl(FIONREAD)");
printf("nread = %ld\n", count);
sleep(5);
}
}
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: primary and secondary ip addresses, Andrea G Forte |
|---|---|
| Next by Date: | Re: 2.6.10-rc3-mm1 FIONREAD breakge, Andrew Morton |
| Previous by Thread: | [BK netdev-2.6] Update Typhoon firmware, David Dillow |
| Next by Thread: | Re: 2.6.10-rc3-mm1 FIONREAD breakge, Andrew Morton |
| Indexes: | [Date] [Thread] [Top] [All Lists] |