X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=datapath%2Fbrcompat_main.c;h=1671b90ba0d797e52ece40b6409908c8d9b19a06;hb=c376f9a3e968570d2df2574336d86185fc18b8a2;hp=5d0f0bba944a426c47f71cc3a3e3aa690fe746e7;hpb=9b80f761bed9a32c1b0eb22ee3361966057ea973;p=openvswitch diff --git a/datapath/brcompat_main.c b/datapath/brcompat_main.c index 5d0f0bba..1671b90b 100644 --- a/datapath/brcompat_main.c +++ b/datapath/brcompat_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007-2012 Nicira Networks. + * Copyright (c) 2007-2012 Nicira, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public @@ -63,10 +63,12 @@ static struct sk_buff *brc_make_request(int op, const char *bridge, goto error; genlmsg_put(skb, 0, 0, &brc_genl_family, 0, op); - if (bridge) - NLA_PUT_STRING(skb, BRC_GENL_A_DP_NAME, bridge); - if (port) - NLA_PUT_STRING(skb, BRC_GENL_A_PORT_NAME, port); + + if (bridge && nla_put_string(skb, BRC_GENL_A_DP_NAME, bridge)) + goto nla_put_failure; + if (port && nla_put_string(skb, BRC_GENL_A_PORT_NAME, port)) + goto nla_put_failure; + return skb; nla_put_failure: @@ -288,8 +290,9 @@ static int brc_get_fdb_entries(struct net_device *dev, void __user *userbuf, request = brc_make_request(BRC_GENL_C_FDB_QUERY, dev->name, NULL); if (!request) return -ENOMEM; - NLA_PUT_U64(request, BRC_GENL_A_FDB_COUNT, maxnum); - NLA_PUT_U64(request, BRC_GENL_A_FDB_SKIP, offset); + if (nla_put_u64(request, BRC_GENL_A_FDB_COUNT, maxnum) || + nla_put_u64(request, BRC_GENL_A_FDB_SKIP, offset)) + goto nla_put_failure; rtnl_unlock(); reply = brc_send_command(dev_net(dev), request, attrs); @@ -401,7 +404,8 @@ static int brc_genl_query(struct sk_buff *skb, struct genl_info *info) err = -ENOMEM; goto err; } - NLA_PUT_U32(ans_skb, BRC_GENL_A_MC_GROUP, brc_mc_group.id); + if (nla_put_u32(ans_skb, BRC_GENL_A_MC_GROUP, brc_mc_group.id)) + goto nla_put_failure; genlmsg_end(ans_skb, data); return genlmsg_reply(ans_skb, info); @@ -565,7 +569,7 @@ module_init(brc_init); module_exit(brc_cleanup); MODULE_DESCRIPTION("Open vSwitch bridge compatibility"); -MODULE_AUTHOR("Nicira Networks"); +MODULE_AUTHOR("Nicira, Inc."); MODULE_LICENSE("GPL"); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)