datapath: Clear struct ovs_key_ipv4_tunnel padding.
[sliver-openvswitch.git] / datapath / tunnel.h
index b7de7a9..82c5cca 100644 (file)
@@ -201,6 +201,10 @@ static inline void tnl_tun_key_init(struct ovs_key_ipv4_tunnel *tun_key,
        tun_key->ipv4_tos = iph->tos;
        tun_key->ipv4_ttl = iph->ttl;
        tun_key->tun_flags = tun_flags;
+
+       /* clear struct padding. */
+       memset((unsigned char*) tun_key + OVS_TUNNEL_KEY_SIZE, 0,
+              sizeof(*tun_key) - OVS_TUNNEL_KEY_SIZE);
 }
 
 static inline void tnl_get_param(const struct tnl_mutable_config *mutable,