X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fnetdev-vport.c;h=55662890f86a4ca4ea94936924311df5339c9d1c;hb=57b7c6a143a7b86f753ec1928aae3a74b95befd4;hp=f0de376a44b7988edab16f14f30d78de6cbe9848;hpb=c3827f619a38d3d202020838e1f92860046a3dbe;p=openvswitch diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index f0de376a..55662890 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -23,6 +23,7 @@ #include #include +#include "byte-order.h" #include "list.h" #include "netdev-provider.h" #include "openvswitch/datapath-protocol.h" @@ -438,6 +439,7 @@ parse_tunnel_config(const struct netdev_dev *dev, const struct shash *args, bool ipsec_ip_set = false; bool ipsec_mech_set = false; + memset(&config, 0, sizeof config); config.flags |= TNL_F_PMTUD; config.flags |= TNL_F_HDR_CACHE; @@ -461,19 +463,20 @@ parse_tunnel_config(const struct netdev_dev *dev, const struct shash *args, config.flags |= TNL_F_IN_KEY_MATCH; config.flags |= TNL_F_OUT_KEY_ACTION; } else { - config.out_key = config.in_key = htonl(atoi(node->data)); + uint64_t key = strtoull(node->data, NULL, 0); + config.out_key = config.in_key = htonll(key); } } else if (!strcmp(node->name, "in_key") && is_gre) { if (!strcmp(node->data, "flow")) { config.flags |= TNL_F_IN_KEY_MATCH; } else { - config.in_key = htonl(atoi(node->data)); + config.in_key = htonll(strtoull(node->data, NULL, 0)); } } else if (!strcmp(node->name, "out_key") && is_gre) { if (!strcmp(node->data, "flow")) { config.flags |= TNL_F_OUT_KEY_ACTION; } else { - config.out_key = htonl(atoi(node->data)); + config.out_key = htonll(strtoull(node->data, NULL, 0)); } } else if (!strcmp(node->name, "tos")) { if (!strcmp(node->data, "inherit")) {