Most recent kernel where this bug did not occur: - Distribution: Debian Hardware Environment: Alpha / Intel Problem Description: binding LLC stream sockets to a local address leaves llc->dev = NULL. A later connect() causes Oops in llc_establish_connection(). Steps to reproduce: #undef __GLIBC__ #include <linux/socket.h> #include <asm/socket.h> #include <linux/if_ether.h> #include <linux/if_arp.h> #include <linux/if_packet.h> #include <linux/llc.h> #define __GLIBC__ #define SOCK_DGRAM 2 #define SOCK_STREAM 1 static void get_hwaddr (unsigned char *name, unsigned char *addr, short int *type) { struct ifreq ifr; int fd = socket (AF_INET, SOCK_DGRAM, 0); if (fd < 0) { printf ("socket failed\n"); return; } bcopy (name, &ifr.ifr_name, sizeof (ifr.ifr_name)); /* find my own hardware address */ if (ioctl (fd, SIOCGIFHWADDR, &ifr) < 0) { close (fd); printf ("ioctl(SIOCGIFHWADDR) failed\n"); return; } close (fd); bcopy (&ifr.ifr_hwaddr.sa_data, addr, ETH_ALEN); *type = ifr.ifr_hwaddr.sa_family; } int llc_open (unsigned char sap, char *name) { struct sockaddr_llc sllc; short int type; int fd; unsigned char smac[ETH_ALEN]; fd = socket (PF_LLC, SOCK_STREAM, 0); if (fd < 0) { printf ("socket failed\n"); return -1; } get_hwaddr (name, smac, &type); bzero (&sllc, sizeof (sllc)); sllc.sllc_family = AF_LLC; sllc.sllc_arphrd = type; sllc.sllc_sap = 0xc2; bcopy (smac, &sllc.sllc_mac, ETH_ALEN); if (bind (fd, &sllc, sizeof (sllc)) < 0) { close (fd); printf ("bind failed\n"); return -1; } bzero (&sllc, sizeof (sllc)); sllc.sllc_family = AF_LLC; sllc.sllc_arphrd = type; sllc.sllc_sap = 232; sllc.sllc_mac[0] = 0x10; sllc.sllc_mac[1] = 0x00; sllc.sllc_mac[2] = 0x90; sllc.sllc_mac[3] = 0x9a; sllc.sllc_mac[4] = 0x30; sllc.sllc_mac[5] = 0x9c; if (connect (fd, &sllc, sizeof (sllc)) < 0) { close (fd); printf ("connect failed\n"); return -1; } return fd; } int main() { char name[] = "eth0"; int fd; fd = llc_open(232,name); }
Can you test 2.6.13 please?
The LLC code hasn't been touched since 2.6.11. Current netdev-2.6.git#ALL has the same problem (tested on alpha).
Bug has been fixed in 2.6.15.