Permalink
Browse files

Minor simplification to aliased interface detection logic

  • Loading branch information...
flan committed Mar 12, 2017
1 parent b275540 commit a40feee9cfe55877fbbae01f4b9df983e9b0532f
Showing with 2 additions and 8 deletions.
  1. +2 −8 libpydhcpserver/libpydhcpserver/getifaddrslib.py
@@ -135,15 +135,9 @@ def get_network_interface(ipv4):
lambda ifaddr : _evaluate_ipv4(ifaddr, ipv4),
_extract_ipv4,
)
needle = ":"
pos = interface.upper().find(needle.upper())
if pos < 0: # primary interface
return interface
else: # aliased secondary interface, strip of :<alias_id>
real_interface,alias_id = interface.split(":")
return real_interface
#Handle aliased interfaces, like 'eth0:1'
return interface.split(':', 1)[0]
def get_mac_address(iface):
return _evaluate_ifaddrs(
lambda ifaddr : _evaluate_mac(ifaddr, iface),

0 comments on commit a40feee

Please sign in to comment.