| 203 | } |
| 204 | |
| 205 | static int |
| 206 | scope6_get(struct ifnet *ifp, struct scope6_id *idlist) |
| 207 | { |
| 208 | struct epoch_tracker et; |
| 209 | struct scope6_id *sid; |
| 210 | |
| 211 | /* We only need to lock the interface's afdata for SID() to work. */ |
| 212 | NET_EPOCH_ENTER(et); |
| 213 | sid = SID(ifp); |
| 214 | if (sid == NULL) { /* paranoid? */ |
| 215 | NET_EPOCH_EXIT(et); |
| 216 | return (EINVAL); |
| 217 | } |
| 218 | |
| 219 | *idlist = *sid; |
| 220 | |
| 221 | NET_EPOCH_EXIT(et); |
| 222 | return (0); |
| 223 | } |
| 224 | |
| 225 | /* |
| 226 | * Get a scope of the address. Node-local, link-local, site-local or global. |