Skip to content

Commit

Permalink
Do not add default route during ifc_configure
Browse files Browse the repository at this point in the history
Avoid duplicate default routes.
Remove adding of default routes during interface configuration as
route add/remove operation is managed by ConnectivityService via netd.
(cherry picked from commit 4a48635)

Change-Id: I982b95a44bf91d3850ca7752e307c1b1b6a66ecf
  • Loading branch information
Niranjan Pendharkar authored and hyperb1iss committed Jul 27, 2013
1 parent 46ccee6 commit d553fed
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions libnetutils/ifc_utils.c
@@ -1,17 +1,18 @@
/*
* Copyright (c) 2011-2013 The Linux Foundation. All rights reserved.
* Copyright 2008, The Android Open Source Project
* Copyright (C) 2011, Code Aurora Forum. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

Expand Down Expand Up @@ -802,11 +803,14 @@ ifc_configure(const char *ifname,
ifc_close();
return -1;
}

#ifndef QCOM_HARDWARE
if (ifc_create_default_route(ifname, gateway)) {
printerr("failed to set default route %s: %s\n", ipaddr_to_string(gateway), strerror(errno));
ifc_close();
return -1;
}
#endif

ifc_close();

Expand Down

0 comments on commit d553fed

Please sign in to comment.