* A wrapper function for icmp6_error() necessary when the erroneous packet * may not contain enough scope zone information. */
| 227 | * may not contain enough scope zone information. |
| 228 | */ |
| 229 | void |
| 230 | icmp6_error2(struct mbuf *m, int type, int code, int param, |
| 231 | struct ifnet *ifp) |
| 232 | { |
| 233 | struct ip6_hdr *ip6; |
| 234 | |
| 235 | if (ifp == NULL) |
| 236 | return; |
| 237 | |
| 238 | if (m->m_len < sizeof(struct ip6_hdr)) { |
| 239 | m = m_pullup(m, sizeof(struct ip6_hdr)); |
| 240 | if (m == NULL) { |
| 241 | IP6STAT_INC(ip6s_exthdrtoolong); |
| 242 | return; |
| 243 | } |
| 244 | } |
| 245 | ip6 = mtod(m, struct ip6_hdr *); |
| 246 | |
| 247 | if (in6_setscope(&ip6->ip6_src, ifp, NULL) != 0) |
| 248 | return; |
| 249 | if (in6_setscope(&ip6->ip6_dst, ifp, NULL) != 0) |
| 250 | return; |
| 251 | |
| 252 | icmp6_error(m, type, code, param); |
| 253 | } |
| 254 | |
| 255 | /* |
| 256 | * Generate an error packet of type error in response to bad IP6 packet. |
no test coverage detected