| 1234 | |
| 1235 | #if 0 |
| 1236 | int |
| 1237 | ff_rtioctl_old(int fibnum, void *data, unsigned *plen, unsigned maxlen) |
| 1238 | { |
| 1239 | struct rt_msghdr *rtm = NULL; |
| 1240 | struct rtentry *rt = NULL; |
| 1241 | struct rib_head *rnh; |
| 1242 | struct rt_addrinfo info; |
| 1243 | union sockaddr_union saun; |
| 1244 | sa_family_t saf = AF_UNSPEC; |
| 1245 | struct sockaddr_storage ss; |
| 1246 | struct walkarg w; |
| 1247 | int error = 0, alloc_len = 0, len; |
| 1248 | struct ifnet *ifp = NULL; |
| 1249 | |
| 1250 | #ifdef INET6 |
| 1251 | struct sockaddr_in6 *sin6; |
| 1252 | int i, rti_need_deembed = 0; |
| 1253 | #endif |
| 1254 | |
| 1255 | #define senderr(e) { error = e; goto flush;} |
| 1256 | |
| 1257 | len = *plen; |
| 1258 | /* |
| 1259 | * Most of current messages are in range 200-240 bytes, |
| 1260 | * minimize possible re-allocation on reply using larger size |
| 1261 | * buffer aligned on 1k boundaty. |
| 1262 | */ |
| 1263 | alloc_len = roundup2(len, 1024); |
| 1264 | if ((rtm = malloc(alloc_len, M_TEMP, M_NOWAIT)) == NULL) |
| 1265 | senderr(ENOBUFS); |
| 1266 | bcopy(data, (caddr_t)rtm, len); |
| 1267 | |
| 1268 | if (len < sizeof(*rtm) || len != rtm->rtm_msglen) |
| 1269 | senderr(EINVAL); |
| 1270 | |
| 1271 | bzero(&info, sizeof(info)); |
| 1272 | bzero(&w, sizeof(w)); |
| 1273 | |
| 1274 | if (rtm->rtm_version != RTM_VERSION) |
| 1275 | senderr(EPROTONOSUPPORT); |
| 1276 | |
| 1277 | /* |
| 1278 | * Starting from here, it is possible |
| 1279 | * to alter original message and insert |
| 1280 | * caller PID and error value. |
| 1281 | */ |
| 1282 | |
| 1283 | rtm->rtm_pid = curproc->p_pid; |
| 1284 | info.rti_addrs = rtm->rtm_addrs; |
| 1285 | |
| 1286 | info.rti_mflags = rtm->rtm_inits; |
| 1287 | info.rti_rmx = &rtm->rtm_rmx; |
| 1288 | |
| 1289 | /* |
| 1290 | * rt_xaddrs() performs s6_addr[2] := sin6_scope_id for AF_INET6 |
| 1291 | * link-local address because rtrequest requires addresses with |
| 1292 | * embedded scope id. |
| 1293 | */ |
nothing calls this directly
no test coverage detected