X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=utilities%2Fovs-ofctl.c;h=d9d1d193fee52894a4e5ec7dca023fbe02efd088;hb=afc143dfa54ee263430570b1b78dad7cd8577843;hp=995a6c6c9dda16fdc0f15ecd4cbb6a16db595fe4;hpb=2793521cf0d896d7907c7298ff909522c7489fa1;p=sliver-openvswitch.git diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index 995a6c6c9..d9d1d193f 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks. + * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -800,24 +800,6 @@ monitor_vconn(struct vconn *vconn) bool exiting = false; int error, fd; - if (preferred_packet_in_format >= 0) { - set_packet_in_format(vconn, preferred_packet_in_format); - } else { - struct ofpbuf *spif, *reply; - - spif = ofputil_make_set_packet_in_format(NXPIF_NXM); - run(vconn_transact_noreply(vconn, spif, &reply), - "talking to %s", vconn_get_name(vconn)); - if (reply) { - char *s = ofp_to_string(reply->data, reply->size, 2); - VLOG_DBG("%s: failed to set packet in format to nxm, controller" - " replied: %s. Falling back to the switch default.", - vconn_get_name(vconn), s); - free(s); - ofpbuf_delete(reply); - } - } - /* Daemonization will close stderr but we really want to keep it, so make a * copy. */ fd = dup(STDERR_FILENO); @@ -875,6 +857,24 @@ do_monitor(int argc, char *argv[]) config.miss_send_len = htons(atoi(argv[2])); set_switch_config(vconn, &config); } + if (preferred_packet_in_format >= 0) { + set_packet_in_format(vconn, preferred_packet_in_format); + } else { + struct ofpbuf *spif, *reply; + + spif = ofputil_make_set_packet_in_format(NXPIF_NXM); + run(vconn_transact_noreply(vconn, spif, &reply), + "talking to %s", vconn_get_name(vconn)); + if (reply) { + char *s = ofp_to_string(reply->data, reply->size, 2); + VLOG_DBG("%s: failed to set packet in format to nxm, controller" + " replied: %s. Falling back to the switch default.", + vconn_get_name(vconn), s); + free(s); + ofpbuf_delete(reply); + } + } + monitor_vconn(vconn); }