| ... | @@ -273,10 +273,12 @@ pub const Address = extern union { | ... | @@ -273,10 +273,12 @@ pub const Address = extern union { |
| 273 | } | 273 | } |
| 274 | | 274 | |
| 275 | var resolved_scope_id: u32 = 0; | 275 | var resolved_scope_id: u32 = 0; |
| 276 | if (std.mem.len(scope_id_value) > 0) { | 276 | std.debug.warn("scope_id_value {} len {}\n", .{ scope_id_value, std.mem.len(scope_id_value) }); |
| 277 | resolved_scope_id = std.fmt.parseInt(u32, &scope_id_value, 10) catch |err| blk: { | 277 | if (scope_id_index > 0) { |
| | 278 | const scope_id_str = scope_id_value[0..scope_id_index]; |
| | 279 | resolved_scope_id = std.fmt.parseInt(u32, scope_id_str, 10) catch |err| blk: { |
| 278 | if (err != error.InvalidCharacter) return err; | 280 | if (err != error.InvalidCharacter) return err; |
| 279 | break :blk try if_nametoindex(&scope_id_value); | 281 | break :blk try if_nametoindex(scope_id_str); |
| 280 | }; | 282 | }; |
| 281 | } | 283 | } |
| 282 | | 284 | |