Skip to content

Commit 46771e9

Browse files
authored
Merge pull request #12 from lluki/master
l3 assignment strategy: Support multiple unnamed hosts per switch
2 parents e6090d9 + 9a6c067 commit 46771e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

p4utils/mininetlib/apptopo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ def l3_assignment_strategy(self):
292292
if self.is_host_link(link):
293293
host_name = link[self.get_host_position(link)]
294294
if self.check_host_valid_ip_from_name(host_name):
295-
296295
direct_sw = link[self.get_sw_position(link)]
297296
sw_id = sw_to_id[direct_sw]
298297
host_num = int(host_name[1:])
@@ -322,6 +321,7 @@ def l3_assignment_strategy(self):
322321
while ("10.%d.%d.2" % (sw_id, host_num)) in self.reserved_ips.values():
323322
host_num +=1
324323
assert host_num < 254
324+
sw_to_next_available_host_id[direct_sw] = host_num + 1
325325
host_ip = "10.%d.%d.2" % (sw_id, host_num)
326326
host_gw = "10.%d.%d.1" % (sw_id, host_num)
327327

0 commit comments

Comments
 (0)