]> err.no Git - linux-2.6/blobdiff - net/ipv6/datagram.c
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfashe...
[linux-2.6] / net / ipv6 / datagram.c
index b9c2de84a8a212d137e1ba0c17bc1125dd5b288d..410046a8cc915f5ea2f56a4c7b6c105f58d1903d 100644 (file)
@@ -5,8 +5,6 @@
  *     Authors:
  *     Pedro Roque             <roque@di.fc.ul.pt>
  *
- *     $Id: datagram.c,v 1.24 2002/02/01 22:01:04 davem Exp $
- *
  *     This program is free software; you can redistribute it and/or
  *      modify it under the terms of the GNU General Public License
  *      as published by the Free Software Foundation; either version
@@ -705,6 +703,11 @@ int datagram_send_ctl(struct net *net,
                        }
 
                        *hlimit = *(int *)CMSG_DATA(cmsg);
+                       if (*hlimit < -1 || *hlimit > 0xff) {
+                               err = -EINVAL;
+                               goto exit_f;
+                       }
+
                        break;
 
                case IPV6_TCLASS:
@@ -729,7 +732,7 @@ int datagram_send_ctl(struct net *net,
                        LIMIT_NETDEBUG(KERN_DEBUG "invalid cmsg type: %d\n",
                                       cmsg->cmsg_type);
                        err = -EINVAL;
-                       break;
+                       goto exit_f;
                }
        }