Commit e53c89f
committed
fix: Refine MAC validation using interface name
When a user provides both an interface name and a MAC address, the
current validation process retrieves sysfs link info separately using
the interface name and the MAC address, then compares the results. If
the information doesn't match, an error is raised.
However, this approach may trigger false alarms because retrieving the
link info by MAC might return data that only matches the current MAC
instead of the permanent MAC. Since the interface name is unique within
the kernel, a more robust validation method is to fetch the MAC address
using the interface name and then compare it directly with the
user-provided MAC address.
Signed-off-by: Wen Liang <[email protected]>1 parent 57b4c00 commit e53c89f
1 file changed
+34
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
170 | 180 | | |
171 | 181 | | |
172 | 182 | | |
| |||
187 | 197 | | |
188 | 198 | | |
189 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
190 | 207 | | |
191 | 208 | | |
192 | 209 | | |
| |||
2180 | 2197 | | |
2181 | 2198 | | |
2182 | 2199 | | |
2183 | | - | |
2184 | | - | |
2185 | | - | |
2186 | | - | |
2187 | | - | |
2188 | | - | |
2189 | | - | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
2190 | 2217 | | |
2191 | 2218 | | |
2192 | 2219 | | |
| |||
0 commit comments