Commit de9519d
authored
Fix MAC and IP address comparison logic in generators (#164)
This commit corrects the comparison logic in setMacGenerator and
setIpGenerator methods to accurately compare MAC and IP addresses byte
by byte.
The previous method relied on array reference comparison, which led to
incorrect maximum address detection and subsequent address duplication.
The newly introduced helper functions, compareMacs and compareIps,
ensure element-wise comparison, preventing duplication by correctly
identifying and initializing the maximum address for each generator.
before:

after:
1 parent 0ac2529 commit de9519d
3 files changed
+30
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| |||
136 | 140 | | |
137 | 141 | | |
138 | 142 | | |
| 143 | + | |
139 | 144 | | |
140 | 145 | | |
141 | 146 | | |
142 | | - | |
143 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
144 | 153 | | |
145 | 154 | | |
146 | 155 | | |
147 | | - | |
148 | 156 | | |
149 | 157 | | |
150 | 158 | | |
| |||
155 | 163 | | |
156 | 164 | | |
157 | 165 | | |
158 | | - | |
| 166 | + | |
159 | 167 | | |
160 | 168 | | |
161 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
0 commit comments