X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=vswitchd%2Fovs-brcompatd.c;h=df9332f3aaf38bc6e73b4f293392b4eed93864c2;hb=8b97ad35e5a36375a357b0c0830ecba3ab0a1b1a;hp=8b1ad5d8bc415d4dd50e6272e8cc2754f9771f7c;hpb=72d32ac0b3a1358cb36cf43f15ee7c026be36d2c;p=openvswitch diff --git a/vswitchd/ovs-brcompatd.c b/vswitchd/ovs-brcompatd.c index 8b1ad5d8..df9332f3 100644 --- a/vswitchd/ovs-brcompatd.c +++ b/vswitchd/ovs-brcompatd.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira Networks +/* Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,7 +76,7 @@ static char *appctl_program; static char *vsctl_program; /* Options that we should generally pass to ovs-vsctl. */ -#define VSCTL_OPTIONS "--timeout=5", "-vANY:console:WARN" +#define VSCTL_OPTIONS "--timeout=5", "-vconsole:warn" /* Netlink socket to bridge compatibility kernel module. */ static struct nl_sock *brc_sock; @@ -280,25 +280,25 @@ parse_command(struct ofpbuf *buffer, uint32_t *seq, const char **br_name, return 0; } -/* Composes and returns a reply to a request made by the datapath with Netlink - * sequence number 'seq' and error code 'error'. The caller may add additional - * attributes to the message, then it may send it with send_reply(). */ +/* Composes and returns a reply to a request made by the datapath with error + * code 'error'. The caller may add additional attributes to the message, then + * it may send it with send_reply(). */ static struct ofpbuf * -compose_reply(uint32_t seq, int error) +compose_reply(int error) { struct ofpbuf *reply = ofpbuf_new(4096); nl_msg_put_genlmsghdr(reply, 32, brc_family, NLM_F_REQUEST, BRC_GENL_C_DP_RESULT, 1); - ((struct nlmsghdr *) reply->data)->nlmsg_seq = seq; nl_msg_put_u32(reply, BRC_GENL_A_ERR_CODE, error); return reply; } -/* Sends 'reply' to the datapath and frees it. */ +/* Sends 'reply' to the datapath, using sequence number 'nlmsg_seq', and frees + * it. */ static void -send_reply(struct ofpbuf *reply) +send_reply(struct ofpbuf *reply, uint32_t nlmsg_seq) { - int retval = nl_sock_send(brc_sock, reply, false); + int retval = nl_sock_send_seq(brc_sock, reply, nlmsg_seq, false); if (retval) { VLOG_WARN_RL(&rl, "replying to brcompat request: %s", strerror(retval)); @@ -311,7 +311,7 @@ send_reply(struct ofpbuf *reply) static void send_simple_reply(uint32_t seq, int error) { - send_reply(compose_reply(seq, error)); + send_reply(compose_reply(error), seq); } static int @@ -555,10 +555,10 @@ handle_fdb_query_cmd(struct ofpbuf *buffer) free(output); /* Compose and send reply to datapath. */ - reply = compose_reply(seq, 0); + reply = compose_reply(0); nl_msg_put_unspec(reply, BRC_GENL_A_FDB_DATA, query_data.data, query_data.size); - send_reply(reply); + send_reply(reply, seq); /* Free memory. */ ofpbuf_uninit(&query_data); @@ -594,10 +594,10 @@ send_ifindex_reply(uint32_t seq, char *output) } /* Compose and send reply. */ - reply = compose_reply(seq, 0); + reply = compose_reply(0); nl_msg_put_unspec(reply, BRC_GENL_A_IFINDEXES, indices, n_indices * sizeof *indices); - send_reply(reply); + send_reply(reply, seq); /* Free memory. */ free(indices);