diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index f61eb2e..3d4c5d2 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c @@ -764,8 +764,11 @@ static int br_ip4_multicast_add_group(struct net_bridge *br, { struct br_ip br_group; - if (ipv4_is_local_multicast(group)) +printk("+++ br_ip4_multicast_add_group() %s %pI4\n", port->dev->name, &group); + if (ipv4_is_local_multicast(group)) { +printk("+++ br_ip4_multicast_add_group() %s %pI4, is link local\n", port->dev->name, &group); return 0; + } br_group.u.ip4 = group; br_group.proto = htons(ETH_P_IP); @@ -780,8 +783,11 @@ static int br_ip6_multicast_add_group(struct net_bridge *br, { struct br_ip br_group; - if (!ipv6_is_transient_multicast(group)) +printk("+++ br_ip6_multicast_add_group() %s %pI6\n", port->dev->name, group); + if (!ipv6_is_transient_multicast(group)) { +printk("+++ br_ip6_multicast_add_group() %s %pI6, is not transient\n", port->dev->name, group); return 0; + } ipv6_addr_copy(&br_group.u.ip6, group); br_group.proto = htons(ETH_P_IPV6); @@ -1001,6 +1007,7 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br, int num; int err = 0; +printk("+++ br_ip6_multicast_mld2_report()\n"); if (!pskb_may_pull(skb, sizeof(*icmp6h))) return -EINVAL; @@ -1386,11 +1393,14 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br, if (skb->len < len || len < ip_hdrlen(skb)) return -EINVAL; +printk("+++ br_multicast_ipv4_rcv() skb2->len: %i len: %i skb->len: %i\n", skb2->len, len, skb->len); if (skb->len > len) { +printk("+++ br_multicast_ipv4_rcv() doing clone\n"); skb2 = skb_clone(skb, GFP_ATOMIC); if (!skb2) return -ENOMEM; +printk("+++ br_multicast_ipv4_rcv() and pskb_trim_rcsum\n"); err = pskb_trim_rcsum(skb2, len); if (err) goto err_out; @@ -1405,14 +1415,20 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br, if (!pskb_may_pull(skb2, sizeof(*ih))) goto out; +printk("+++ br_multicast_ipv4_rcv() 2) skb2->len: %i len: %i skb->len: %i\n", skb2->len, len, skb->len); switch (skb2->ip_summed) { case CHECKSUM_COMPLETE: +printk("+++ br_multicast_ipv4_rcv() here 1.6\n"); if (!csum_fold(skb2->csum)) break; /* fall through */ case CHECKSUM_NONE: +printk("+++ br_multicast_ipv4_rcv() here 1.7, skb2->csum is %x\n", skb2->csum); + __sum16 foobar; skb2->csum = 0; - if (skb_checksum_complete(skb2)) + foobar = skb_checksum_complete(skb2); +printk("+++ br_multicast_ipv4_rcv() here 1.8, skb_checksum_complete: %x\n", foobar); + if (foobar) goto out; } @@ -1459,6 +1475,7 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br, int offset; int err; +printk("+++ br_multicast_ipv6_rcv()\n"); if (!pskb_may_pull(skb, sizeof(*ip6h))) return -EINVAL; @@ -1476,6 +1493,7 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br, return 0; len = ntohs(ip6h->payload_len); +// len = ntohs(ip6h->payload_len) + sizeof(*ip6h); <- should probably be this? if (skb->len < len) return -EINVAL; @@ -1485,6 +1503,7 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br, if (offset < 0 || nexthdr != IPPROTO_ICMPV6) return 0; +printk("+++ br_multicast_ipv6_rcv() here 0.5\n"); /* Okay, we found ICMPv6 header */ skb2 = skb_clone(skb, GFP_ATOMIC); if (!skb2) @@ -1494,7 +1513,9 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br, if (!pskb_may_pull(skb2, offset + sizeof(struct icmp6hdr))) goto out; +printk("+++ br_multicast_ipv6_rcv() len: %i, offset: %i, skb_network_offset(skb2): %i\n", len, offset, skb_network_offset(skb2)); len -= offset - skb_network_offset(skb2); +printk("+++ br_multicast_ipv6_rcv() new len: %i\n", len); __skb_pull(skb2, offset); skb_reset_transport_header(skb2); @@ -1513,27 +1534,37 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br, } /* Okay, we found MLD message. Check further. */ +printk("+++ br_multicast_ipv6_rcv() skb2->len: %i len: %i skb->len: %i\n", skb2->len, len, skb->len); if (skb2->len > len) { +printk("+++ br_multicast_ipv6_rcv() doing pskb_trim_rcsum\n"); err = pskb_trim_rcsum(skb2, len); if (err) goto out; } +printk("+++ br_multicast_ipv6_rcv() here 1.5\n"); switch (skb2->ip_summed) { case CHECKSUM_COMPLETE: +printk("+++ br_multicast_ipv6_rcv() here 1.6\n"); if (!csum_fold(skb2->csum)) break; /*FALLTHROUGH*/ case CHECKSUM_NONE: +printk("+++ br_multicast_ipv6_rcv() here 1.7, skb2->csum is %x\n", skb2->csum); + __sum16 foobar; skb2->csum = 0; - if (skb_checksum_complete(skb2)) + foobar = skb_checksum_complete(skb2); + if (foobar) { +printk("+++ br_multicast_ipv6_rcv() here 1.8, skb_checksum_complete(skb2): %x (skb): %x\n", foobar, skb_checksum_complete(skb)); goto out; + } } err = 0; BR_INPUT_SKB_CB(skb)->igmp = 1; +printk("+++ br_multicast_ipv6_rcv() here 2\n"); switch (icmp6h->icmp6_type) { case ICMPV6_MGM_REPORT: {