* Construct a Router Alert option to use in outgoing packets. */
| 590 | * Construct a Router Alert option to use in outgoing packets. |
| 591 | */ |
| 592 | static struct mbuf * |
| 593 | igmp_ra_alloc(void) |
| 594 | { |
| 595 | struct mbuf *m; |
| 596 | struct ipoption *p; |
| 597 | |
| 598 | m = m_get(M_WAITOK, MT_DATA); |
| 599 | p = mtod(m, struct ipoption *); |
| 600 | p->ipopt_dst.s_addr = INADDR_ANY; |
| 601 | p->ipopt_list[0] = (char)IPOPT_RA; /* Router Alert Option */ |
| 602 | p->ipopt_list[1] = 0x04; /* 4 bytes long */ |
| 603 | p->ipopt_list[2] = IPOPT_EOL; /* End of IP option list */ |
| 604 | p->ipopt_list[3] = 0x00; /* pad byte */ |
| 605 | m->m_len = sizeof(p->ipopt_dst) + p->ipopt_list[1]; |
| 606 | |
| 607 | return (m); |
| 608 | } |
| 609 | |
| 610 | /* |
| 611 | * Attach IGMP when PF_INET is attached to an interface. |
no test coverage detected