X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=datapath%2Fbrcompat.c;h=15cec9c912d467a807ab27c98d52dfdcb0bc9c9f;hb=31ac1e590b9bb2a2ce7c70cd7c8fd2db0fb8e481;hp=2113eae0f7a39fed65128a8bb6fcf56fa1ab749d;hpb=bbf4f269a391724d886f66b3661b10e5a434e2e8;p=openvswitch diff --git a/datapath/brcompat.c b/datapath/brcompat.c index 2113eae0..15cec9c9 100644 --- a/datapath/brcompat.c +++ b/datapath/brcompat.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009 Nicira Networks. + * Copyright (c) 2009, 2011 Nicira Networks. * Distributed under the terms of the GNU GPL version 2. * * Significant portions of this file may be copied from parts of the Linux @@ -17,7 +17,6 @@ #include #include -#include "compat.h" #include "openvswitch/brcompat-netlink.h" #include "brc_procfs.h" #include "datapath.h" @@ -224,14 +223,13 @@ static int brc_get_bridge_info(struct net_device *dev, struct __bridge_info __user *ub) { struct __bridge_info b; - u64 id = 0; - int i; memset(&b, 0, sizeof(struct __bridge_info)); - for (i=0; idev_addr[i] << (8*(ETH_ALEN-1 - i)); - b.bridge_id = cpu_to_be64(id); + /* First two bytes are the priority, which we should skip. This comes + * from struct bridge_id in br_private.h, which is unavailable to us. + */ + memcpy((u8 *)&b.bridge_id + 2, dev->dev_addr, ETH_ALEN); b.stp_enabled = 0; if (copy_to_user(ub, &b, sizeof(struct __bridge_info)))