]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/netrom/af_netrom.c
Merge current mainline tree into linux-omap tree
[linux-2.6-omap-h63xx.git] / net / netrom / af_netrom.c
index e9c05b8f4f4517fc5b13b6295eebfd1cf75e0a1c..4e705f87969f332c30939dc8acabd4f8d4d74352 100644 (file)
@@ -1082,7 +1082,11 @@ static int nr_sendmsg(struct kiocb *iocb, struct socket *sock,
 
        SOCK_DEBUG(sk, "NET/ROM: sendto: Addresses built.\n");
 
-       /* Build a packet */
+       /* Build a packet - the conventional user limit is 236 bytes. We can
+          do ludicrously large NetROM frames but must not overflow */
+       if (len > 65536)
+               return -EMSGSIZE;
+
        SOCK_DEBUG(sk, "NET/ROM: sendto: building packet.\n");
        size = len + NR_NETWORK_LEN + NR_TRANSPORT_LEN;
 
@@ -1432,7 +1436,7 @@ static int __init nr_proto_init(void)
                struct net_device *dev;
 
                sprintf(name, "nr%d", i);
-               dev = alloc_netdev(sizeof(struct nr_private), name, nr_setup);
+               dev = alloc_netdev(0, name, nr_setup);
                if (!dev) {
                        printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device structure\n");
                        goto fail;