MCPcopy Create free account
hub / github.com/F-Stack/f-stack / icmp6_error2

Function icmp6_error2

freebsd/netinet6/icmp6.c:229–253  ·  view source on GitHub ↗

* A wrapper function for icmp6_error() necessary when the erroneous packet * may not contain enough scope zone information. */

Source from the content-addressed store, hash-verified

227 * may not contain enough scope zone information.
228 */
229void
230icmp6_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.

Callers 3

nptv6_rewrite_internalFunction · 0.85
nptv6_rewrite_externalFunction · 0.85
nd6_llinfo_timerFunction · 0.85

Calls 3

m_pullupFunction · 0.85
in6_setscopeFunction · 0.85
icmp6_errorFunction · 0.85

Tested by

no test coverage detected