diff options
author | Zhang zhengguang <zhengguang.zhang@intel.com> | 2014-07-17 10:37:39 +0800 |
---|---|---|
committer | Zhang zhengguang <zhengguang.zhang@intel.com> | 2014-07-17 10:37:39 +0800 |
commit | 1b9d0a62f59bb48c8deb2f0b98d9acdffdd9abe7 (patch) | |
tree | 6e991827d28537f7f40f20786c2354fd04a9fdad /src/bridge.c | |
parent | fbe905ab58ecc31fe64c410c5f580cadc30e7f04 (diff) | |
download | connman-1b9d0a62f59bb48c8deb2f0b98d9acdffdd9abe7.tar.gz connman-1b9d0a62f59bb48c8deb2f0b98d9acdffdd9abe7.tar.bz2 connman-1b9d0a62f59bb48c8deb2f0b98d9acdffdd9abe7.zip |
Imported Upstream version 1.24upstream/1.24
Diffstat (limited to 'src/bridge.c')
-rw-r--r-- | src/bridge.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/bridge.c b/src/bridge.c index e46cdda6..034fa139 100644 --- a/src/bridge.c +++ b/src/bridge.c @@ -2,8 +2,8 @@ * * Connection Manager * - * Copyright (C) 2007-2012 Intel Corporation. All rights reserved. - * Copyright (C) 2012 BMW Car IT GmbH. All rights reserved. + * Copyright (C) 2007-2013 Intel Corporation. All rights reserved. + * Copyright (C) 2012-2013 BMW Car IT GmbH. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -46,14 +46,14 @@ static int set_forward_delay(const char *name, unsigned int delay) forward_delay_path = g_strdup_printf("/sys/class/net/%s/bridge/forward_delay", name); - if (forward_delay_path == NULL) + if (!forward_delay_path) return -ENOMEM; f = fopen(forward_delay_path, "r+"); g_free(forward_delay_path); - if (f == NULL) + if (!f) return -errno; fprintf(f, "%d", delay); @@ -111,8 +111,8 @@ int __connman_bridge_remove(const char *name) return 0; } -int __connman_bridge_enable(const char *name, const char *gateway, - const char *broadcast) +int __connman_bridge_enable(const char *name, const char *ip_address, + int prefix_len, const char *broadcast) { int err, index; @@ -121,8 +121,8 @@ int __connman_bridge_enable(const char *name, const char *gateway, return index; err = __connman_inet_modify_address(RTM_NEWADDR, - NLM_F_REPLACE | NLM_F_ACK, index, AF_INET, - gateway, NULL, 24, broadcast); + NLM_F_REPLACE | NLM_F_ACK, index, AF_INET, + ip_address, NULL, prefix_len, broadcast); if (err < 0) return err; |