mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 12:48:33 -10:00
igmp: Refresh the ip header pointer after m_pullup()
There is a chance that the m_pullup() call immediately above invalidated the "ip" pointer, so refresh it as we do with the IGMP header. Otherwise the test in igmp_input_v3_query() for whether the packet is an IGMPv3 general query might use a pointer to a freed mbuf. MFC after: 1 week Sponsored by: The FreeBSD Foundation
This commit is contained in:
1 parent
123342f3d2
commit
dc47a6940d
1 file changed
+1
@@ -1605,6 +1605,7 @@ igmp_input(struct mbuf **mp, int *offp, int proto)
|
||||
IGMPSTAT_INC(igps_rcv_tooshort);
|
||||
return (IPPROTO_DONE);
|
||||
}
|
||||
ip = mtod(m, struct ip *);
|
||||
igmpv3 = (struct igmpv3 *)(mtod(m, uint8_t *) + iphlen);
|
||||
if (igmp_input_v3_query(ifp, ip, igmpv3) != 0) {
|
||||
m_freem(m);
|
||||
|
||||
Reference in new issue
Block a user