Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2827857 authored by Erik Kline's avatar Erik Kline
Browse files

IpManager,DhcpClient: catch some errors and better logging

Bug: 28196843
Change-Id: Ia91e926da569bf9c503ea00e1e0f767d196547da
parent b99d6af3
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -264,8 +264,8 @@ public class DhcpClient extends StateMachine {
            mInterfaceBroadcastAddr = new PacketSocketAddress(mIface.getIndex(),
            mInterfaceBroadcastAddr = new PacketSocketAddress(mIface.getIndex(),
                    DhcpPacket.ETHER_BROADCAST);
                    DhcpPacket.ETHER_BROADCAST);
            return true;
            return true;
        } catch(SocketException e) {
        } catch(SocketException | NullPointerException e) {
            Log.wtf(TAG, "Can't determine ifindex or MAC address for " + mIfaceName);
            Log.e(TAG, "Can't determine ifindex or MAC address for " + mIfaceName, e);
            return false;
            return false;
        }
        }
    }
    }
+1 −1
Original line number Original line Diff line number Diff line
@@ -690,7 +690,7 @@ public class IpManager extends StateMachine {
            final InterfaceConfiguration ifcg = new InterfaceConfiguration();
            final InterfaceConfiguration ifcg = new InterfaceConfiguration();
            ifcg.setLinkAddress(new LinkAddress("0.0.0.0/0"));
            ifcg.setLinkAddress(new LinkAddress("0.0.0.0/0"));
            mNwService.setInterfaceConfig(mInterfaceName, ifcg);
            mNwService.setInterfaceConfig(mInterfaceName, ifcg);
        } catch (RemoteException e) {
        } catch (IllegalStateException | RemoteException e) {
            Log.e(mTag, "ALERT: Failed to clear IPv4 address on interface " + mInterfaceName, e);
            Log.e(mTag, "ALERT: Failed to clear IPv4 address on interface " + mInterfaceName, e);
        }
        }
    }
    }