Skip to content

Commit

Permalink
commit cb097ef
Browse files Browse the repository at this point in the history
Author: Raja Sivaramakrishnan <raja@juniper.net>
Date:   Mon Oct 6 15:47:48 2014 -0700

    Ensure "scons vrouter" builds uvrouter and utils too (to avoid build breaks)

    Fixes bug 1374188.

commit 9c97927
Author: Divakar <ddivakar@juniper.net>
Date:   Sun Oct 5 02:28:37 2014 -0700

    Bug:#1377581. Formatting Bridge table display

commit ff17558
Author: Divakar <ddivakar@juniper.net>
Date:   Mon Sep 29 09:37:07 2014 -0700

    Fix for https://bugs.launchpad.net/juniperopenstack/+bug/1372262 a separate port list of link local ser

commit e457cab
Author: Wojciech Zmuda <woz@semihalf.com>
Date:   Mon Sep 29 16:30:11 2014 +0200

    Fix "symbol vrouter_dbg undefined" and "symbol vr_inet_vrf_stats undefined" errors.
    Errors occured while loading vrouter.ko module on FreeBSD.

commit 78306f4
Author: Wojciech Zmuda <woz@semihalf.com>
Date:   Wed Sep 24 10:49:11 2014 +0200

    Fix coding-style and formatting of latest commit.
    Author: Wojciech Zmuda

commit f6f8f79
Author: Ganesan Prabhakaran <gprabhak@juniper.net>
Date:   Thu Sep 25 16:21:10 2014 -0700

    Fix build issue in mainline

commit 23a2aac
Author: ashoksingh <ashoksr@juniper.net>
Date:   Thu Sep 25 17:32:56 2014 +0530

    IPv6 changes
    (on behalf of Prabhakaran)

commit c6bab03
Author: anandhk-juniper <anandhk@juniper.net>
Date:   Thu Sep 25 00:49:21 2014 +0530

    Fix compilation failure for ubuntu 3.13.0-36-generic (and above)

    From 3.13.0-36, ubuntu did

    while keeping the kernel version the same as 3.13.0-32. The only option
    that was left then was to check for definition of skb_get_rxhash
    Closes Bug:1373574

Change-Id: I55ed2fa036d4a0a68de9386ff7c9cf5d91bb1ef5
  • Loading branch information
ananth-at-camphor-networks committed Oct 13, 2014
1 parent 01d35c0 commit 06bdd00
Show file tree
Hide file tree
Showing 29 changed files with 1,410 additions and 498 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -61,7 +61,7 @@ ifneq ($(KERNELRELEASE), )
vrouter-y += dp-core/vr_nexthop.o dp-core/vr_vif_bridge.o
vrouter-y += dp-core/vr_datapath.o dp-core/vr_interface.o
vrouter-y += dp-core/vr_packet.o dp-core/vr_proto_ip.o
vrouter-y += dp-core/vr_mpls.o dp-core/vr_ip4_mtrie.o
vrouter-y += dp-core/vr_mpls.o dp-core/vr_ip_mtrie.o
vrouter-y += dp-core/vr_response.o dp-core/vr_flow.o
vrouter-y += dp-core/vr_mirror.o dp-core/vr_vrf_assign.o
vrouter-y += dp-core/vr_index_table.o dp-core/vr_mcast.o
Expand Down
3 changes: 3 additions & 0 deletions SConscript
Expand Up @@ -62,6 +62,9 @@ if sys.platform != 'darwin':
make_cmd += ' SANDESH_HEADER_PATH=' + Dir(env['TOP'] + '/vrouter/').abspath
make_cmd += ' SANDESH_SRC_ROOT=' + '../build/kbuild/'
make_cmd += ' SANDESH_EXTRA_HEADER_PATH=' + Dir('#tools/').abspath
if 'vrouter' in COMMAND_LINE_TARGETS:
BUILD_TARGETS.append('vrouter/uvrouter')
BUILD_TARGETS.append('vrouter/utils')

kern = env.Command('vrouter.ko', makefile, make_cmd, chdir=dp_dir)
env.Default(kern)
Expand Down
49 changes: 37 additions & 12 deletions dp-core/vr_datapath.c
Expand Up @@ -37,6 +37,7 @@ vr_arp_request_treatment(struct vr_interface *vif, struct vr_arp *arp,
{
struct vr_route_req rt;
struct vr_nexthop *nh;
uint32_t rt_prefix;

/*
* Packet from VM :
Expand Down Expand Up @@ -87,10 +88,13 @@ vr_arp_request_treatment(struct vr_interface *vif, struct vr_arp *arp,
}

rt.rtr_req.rtr_vrf_id = vif->vif_vrf;
rt.rtr_req.rtr_prefix = ntohl(arp->arp_dpa);
rt.rtr_req.rtr_prefix = (uint8_t*)&rt_prefix;
*(uint32_t*)rt.rtr_req.rtr_prefix = (arp->arp_dpa);
rt.rtr_req.rtr_prefix_size = 4;
rt.rtr_req.rtr_prefix_len = 32;
rt.rtr_req.rtr_nh_id = 0;
rt.rtr_req.rtr_label_flags = 0;
rt.rtr_req.rtr_src_size = rt.rtr_req.rtr_marker_size = 0;

nh = vr_inet_route_lookup(vif->vif_vrf, &rt, NULL);
if (!nh || nh->nh_type == NH_DISCARD)
Expand Down Expand Up @@ -251,6 +255,8 @@ vr_pkt_type(struct vr_packet *pkt)
pkt_set_network_header(pkt, pkt->vp_data + pull_len);
if (eth_proto == VR_ETH_PROTO_IP)
pkt->vp_type = VP_TYPE_IP;
else if (eth_proto == VR_ETH_PROTO_IP6)
pkt->vp_type = VP_TYPE_IP6;
else if (eth_proto == VR_ETH_PROTO_ARP)
pkt->vp_type = VP_TYPE_ARP;
else
Expand Down Expand Up @@ -408,6 +414,17 @@ vr_l3_input(unsigned short vrf, struct vr_packet *pkt,
}
vr_flow_inet_input(vif->vif_router, vrf, pkt, VR_ETH_PROTO_IP, fmd);
return 1;
} else if (pkt->vp_type == VP_TYPE_IP6) {
pkt_set_inner_network_header(pkt, pkt->vp_data);
if (vr_from_vm_mss_adj && vr_pkt_from_vm_tcp_mss_adj &&
(vif->vif_type == VIF_TYPE_VIRTUAL)) {
if ((reason = vr_pkt_from_vm_tcp_mss_adj(pkt, VROUTER_OVERLAY_LEN))) {
vr_pfree(pkt, reason);
return 1;
}
}
vr_flow_inet6_input(vif->vif_router, vrf, pkt, VR_ETH_PROTO_IP6, fmd);
return 1;
} else if (pkt->vp_type == VP_TYPE_ARP) {
return vr_arp_input(vrf, pkt, fmd);
}
Expand All @@ -418,7 +435,7 @@ unsigned int
vr_l2_input(unsigned short vrf, struct vr_packet *pkt,
struct vr_forwarding_md *fmd)
{
int pull_len;
int pull_len = 0;
int reason;
struct vr_interface *vif = pkt->vp_if;

Expand Down Expand Up @@ -454,13 +471,13 @@ vr_l2_input(unsigned short vrf, struct vr_packet *pkt,
return 1;
}
}
/* Restore back the L2 headers */
if (!pkt_push(pkt, pull_len)) {
vr_pfree(pkt, VP_DROP_PULL);
return 1;
}
}


/* Restore back the L2 headers */
if (!pkt_push(pkt, pull_len)) {
vr_pfree(pkt, VP_DROP_PULL);
return 1;
}

/* Mark the packet as L2 */
pkt->vp_type = VP_TYPE_L2;
Expand All @@ -473,19 +490,27 @@ vr_l3_well_known_packet(unsigned short vrf, struct vr_packet *pkt)
{
unsigned char *data = pkt_data(pkt);
struct vr_ip *iph;
struct vr_ip6 *ip6;
struct vr_udp *udph;
unsigned char *l3_hdr;

l3_hdr = pkt_network_header(pkt);
if (pkt->vp_if->vif_type == VIF_TYPE_VIRTUAL && IS_MAC_BMCAST(data)) {
iph = (struct vr_ip *)l3_hdr;
if ((iph->ip_proto == VR_IP_PROTO_UDP) &&
if (!vr_ip_is_ip6(iph)) {
if ((iph->ip_proto == VR_IP_PROTO_UDP) &&
vr_ip_transport_header_valid(iph)) {
udph = (struct vr_udp *)(l3_hdr + iph->ip_hl * 4);
if (udph->udp_sport == htons(68)) {
udph = (struct vr_udp *)(l3_hdr + iph->ip_hl * 4);
if (udph->udp_sport == htons(68)) {
return true;
}
}
} else { //IPv6
ip6 = (struct vr_ip6 *)l3_hdr;
// 0xFF02 is the multicast address used for NDP, DHCPv6 etc
if (ip6->ip6_dst[0] == 0xFF && ip6->ip6_dst[1] == 0x02) {
return true;
}

}
}

Expand Down

0 comments on commit 06bdd00

Please sign in to comment.