X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=datapath%2Fbrcompat_main.c;h=1671b90ba0d797e52ece40b6409908c8d9b19a06;hb=a8643e447601201aabd1159966bd716e48378f97;hp=d4a0acad926868011c81a25ad3333b90d9c4a4ef;hpb=bf8ba92e4875d0ca4c26ddd2a4c46fd26f8e401b;p=sliver-openvswitch.git diff --git a/datapath/brcompat_main.c b/datapath/brcompat_main.c index d4a0acad9..1671b90ba 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); @@ -523,7 +527,7 @@ static int __init brc_init(void) /* Set the bridge ioctl handler */ brioctl_set(brc_ioctl_deviceless_stub); - /* Set the openvswitch_mod device ioctl handler */ + /* Set the openvswitch device ioctl handler */ ovs_dp_ioctl_hook = brc_dev_ioctl; /* Randomize the initial sequence number. This is not a security @@ -565,14 +569,14 @@ 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) /* * In kernels 2.6.36 and later, Open vSwitch can safely coexist with * the Linux bridge module, but it does not make sense to load both bridge and - * brcompat_mod, so this prevents it. + * brcompat, so this prevents it. */ BRIDGE_MUTUAL_EXCLUSION; #endif