| 940 | target_mac = get_if_hwaddr(iface) |
| 941 | |
| 942 | def _tups(ip, mac): |
| 943 | # type: (str, Optional[Union[str, List[str]]]) -> Iterable[Tuple[str, str]] |
| 944 | if mac is None: |
| 945 | if broadcast: |
| 946 | # ip can be a Net/list/etc and will be iterated upon while sending |
| 947 | return [(ip, "ff:ff:ff:ff:ff:ff")] |
| 948 | return [(x.query.pdst, x.answer.hwsrc) |
| 949 | for x in arping(ip, verbose=0, iface=iface)[0]] |
| 950 | elif isinstance(mac, list): |
| 951 | return [(ip, x) for x in mac] |
| 952 | else: |
| 953 | return [(ip, mac)] |
| 954 | |
| 955 | tup1 = _tups(ip1, mac1) |
| 956 | if not tup1: |