Skip to content

Commit

Permalink
Merge "Trapping router solicitation in TSN Currenty router solicitati…
Browse files Browse the repository at this point in the history
…on packets are not trapped in TSN and are replicated to braodcast domains. For V6 functionality router solicitation needs to be trapped. Along with this fix, router solicitation packet is pulled in inner headers. closes-bug: #1464966"
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jun 20, 2015
2 parents 0cf3a11 + 24d138f commit 9eeaee5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
10 changes: 4 additions & 6 deletions dp-core/vr_nexthop.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,14 +700,12 @@ nh_composite_mcast_l2(struct vr_packet *pkt, struct vr_nexthop *nh,
if ((pkt_src == PKT_SRC_TOR_REPL_TREE) || !pkt_src) {
l4_type = vr_ip6_well_known_packet(pkt);
if (l4_type != L4_TYPE_UNKNOWN) {
if (!pkt_src) {
trap = true;
}

if (l4_type == L4_TYPE_DHCP_REQUEST) {
if (pkt_src)
trap = true;
/* Trap well known V6 packets */
trap = true;

/* If DHCP, and we are not DHCP server, dont Trap */
if (l4_type == L4_TYPE_DHCP_REQUEST) {
rt_flags = vr_bridge_route_flags(fmd->fmd_dvrf,
eth->eth_smac);
if (rt_flags & VR_BE_FLOOD_DHCP_FLAG)
Expand Down
20 changes: 14 additions & 6 deletions linux/vrouter_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,10 @@ lh_pull_inner_headers_fast_udp(struct vr_packet *pkt, int
if (icmph->icmp_type == VR_ICMP6_TYPE_NEIGH_SOL) {
/* ICMP options size for neighbor solicit is 24 bytes */
pull_len += 24;
} else if (icmph->icmp_type == VR_ICMP6_TYPE_ROUTER_SOL) {
pull_len += 8;
}

if (frag_size < pull_len)
goto slow_path;

Expand Down Expand Up @@ -1699,7 +1702,10 @@ lh_pull_inner_headers_fast_gre(struct vr_packet *pkt, int
if (icmph->icmp_type == VR_ICMP6_TYPE_NEIGH_SOL) {
/* ICMP options size for neighbor solicit is 24 bytes */
pull_len += 24;
} else if (icmph->icmp_type == VR_ICMP6_TYPE_ROUTER_SOL) {
pull_len += 8;
}

if (frag_size < pull_len)
goto slow_path;

Expand Down Expand Up @@ -1913,9 +1919,8 @@ lh_pull_inner_headers(struct vr_packet *pkt,
* is what pskb_may_pull() expects.
*/
pull_len += (pkt->vp_data - (skb->data - skb->head));
if (!pskb_may_pull(skb, pull_len)) {
if (!pskb_may_pull(skb, pull_len))
goto error;
}

vrouter_overlay_len = VROUTER_L2_OVERLAY_LEN;
outer_cksum_validate = false;
Expand Down Expand Up @@ -2024,6 +2029,7 @@ lh_pull_inner_headers(struct vr_packet *pkt,
pull_len += sizeof(struct ipv6hdr);
if (!pskb_may_pull(skb, pull_len))
goto error;

ip6h = (struct vr_ip6 *) (skb->head + hoff);
iph = NULL;
} else if (ntohs(eth_proto) == VR_ETH_PROTO_ARP) {
Expand Down Expand Up @@ -2112,9 +2118,8 @@ lh_pull_inner_headers(struct vr_packet *pkt,
if (skb->len < pull_len)
pull_len = skb->len;

if (!pskb_may_pull(skb, pull_len)) {
if (!pskb_may_pull(skb, pull_len))
goto error;
}

pull_len -= sizeof(struct vr_icmp);
if (icmp_pl_ip_proto == VR_IP_PROTO_TCP)
Expand Down Expand Up @@ -2155,10 +2160,13 @@ lh_pull_inner_headers(struct vr_packet *pkt,
if (icmph->icmp_type == VR_ICMP6_TYPE_NEIGH_SOL) {
/* ICMP options size for neighbor solicit is 24 bytes */
pull_len += 24;
} else if (icmph->icmp_type == VR_ICMP6_TYPE_ROUTER_SOL) {
pull_len += 8;
}
if (!pskb_may_pull(skb, pull_len)) {

if (!pskb_may_pull(skb, pull_len))
goto error;
}

ip6h = (struct vr_ip6 *) (skb->head + hoff);
iph = (struct vr_ip*) ip6h;
}
Expand Down

0 comments on commit 9eeaee5

Please sign in to comment.