In the PACKET_LOOPBACK case, the skb data was always interpreted as
IPv4, but that is not valid for IPv6, obviously. Fix this by adding an
extra condition to check for AF_INET.
Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
const struct xt_pkttype_info *info = matchinfo;
if (skb->pkt_type == PACKET_LOOPBACK)
- type = ipv4_is_multicast(ip_hdr(skb)->daddr)
+ type = match->family == AF_INET &&
+ ipv4_is_multicast(ip_hdr(skb)->daddr)
? PACKET_MULTICAST
: PACKET_BROADCAST;
else