datapath: Fix uninitializaed variable with GRE GSO.
authorJesse Gross <jesse@nicira.com>
Fri, 21 Jun 2013 22:28:20 +0000 (15:28 -0700)
committerJesse Gross <jesse@nicira.com>
Fri, 21 Jun 2013 22:28:20 +0000 (15:28 -0700)
If a packet is neither GSO nor CHECKSUM_PARTIAL then the
GRE GSO compatibility code can use an uninitialized IP ID.

CC: Pravin Shelar <pshelar@nicira.com>
Reported-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/linux/compat/gso.c

index 7379a57..3cadde9 100644 (file)
@@ -103,7 +103,7 @@ free:
 int rpl_ip_local_out(struct sk_buff *skb)
 {
        int ret = NETDEV_TX_OK;
-       int id;
+       int id = -1;
 
        if (skb_is_gso(skb)) {
                struct iphdr *iph;
@@ -119,7 +119,6 @@ int rpl_ip_local_out(struct sk_buff *skb)
                err = skb_checksum_help(skb);
                if (unlikely(err))
                        return 0;
-               id = -1;
        }
 
        while (skb) {