| 304 | } |
| 305 | |
| 306 | void |
| 307 | sctp_mark_ifa_addr_down(uint32_t vrf_id, struct sockaddr *addr, |
| 308 | const char *if_name, uint32_t ifn_index) |
| 309 | { |
| 310 | struct sctp_vrf *vrf; |
| 311 | struct sctp_ifa *sctp_ifap; |
| 312 | |
| 313 | SCTP_IPI_ADDR_RLOCK(); |
| 314 | vrf = sctp_find_vrf(vrf_id); |
| 315 | if (vrf == NULL) { |
| 316 | SCTPDBG(SCTP_DEBUG_PCB4, "Can't find vrf_id 0x%x\n", vrf_id); |
| 317 | goto out; |
| 318 | } |
| 319 | sctp_ifap = sctp_find_ifa_by_addr(addr, vrf->vrf_id, SCTP_ADDR_LOCKED); |
| 320 | if (sctp_ifap == NULL) { |
| 321 | SCTPDBG(SCTP_DEBUG_PCB4, "Can't find sctp_ifap for address\n"); |
| 322 | goto out; |
| 323 | } |
| 324 | if (sctp_ifap->ifn_p == NULL) { |
| 325 | SCTPDBG(SCTP_DEBUG_PCB4, "IFA has no IFN - can't mark unusable\n"); |
| 326 | goto out; |
| 327 | } |
| 328 | if (if_name) { |
| 329 | if (strncmp(if_name, sctp_ifap->ifn_p->ifn_name, SCTP_IFNAMSIZ) != 0) { |
| 330 | SCTPDBG(SCTP_DEBUG_PCB4, "IFN %s of IFA not the same as %s\n", |
| 331 | sctp_ifap->ifn_p->ifn_name, if_name); |
| 332 | goto out; |
| 333 | } |
| 334 | } else { |
| 335 | if (sctp_ifap->ifn_p->ifn_index != ifn_index) { |
| 336 | SCTPDBG(SCTP_DEBUG_PCB4, "IFA owned by ifn_index:%d down command for ifn_index:%d - ignored\n", |
| 337 | sctp_ifap->ifn_p->ifn_index, ifn_index); |
| 338 | goto out; |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | sctp_ifap->localifa_flags &= (~SCTP_ADDR_VALID); |
| 343 | sctp_ifap->localifa_flags |= SCTP_ADDR_IFA_UNUSEABLE; |
| 344 | out: |
| 345 | SCTP_IPI_ADDR_RUNLOCK(); |
| 346 | } |
| 347 | |
| 348 | void |
| 349 | sctp_mark_ifa_addr_up(uint32_t vrf_id, struct sockaddr *addr, |
nothing calls this directly
no test coverage detected