diff --git a/code/bngblaster/src/bbl_dhcpv6.c b/code/bngblaster/src/bbl_dhcpv6.c index b58531ca..db81ceaf 100644 --- a/code/bngblaster/src/bbl_dhcpv6.c +++ b/code/bngblaster/src/bbl_dhcpv6.c @@ -178,7 +178,7 @@ bbl_dhcpv6_rx(bbl_ethernet_header_t *eth, bbl_dhcpv6_t *dhcpv6, bbl_session_s *s session->stats.dhcpv6_rx_reply++; /* Handle DHCPv6 teardown */ if(session->dhcpv6_state == BBL_DHCP_RELEASE) { - session->dhcpv6_state = session->dhcpv6_state == BBL_DHCP_INIT; + session->dhcpv6_state = BBL_DHCP_INIT; if(session->session_state == BBL_TERMINATING) { bbl_session_clear(ctx, session); } diff --git a/code/bngblaster/src/bbl_l2tp_avp.c b/code/bngblaster/src/bbl_l2tp_avp.c index 727067ff..2546b2d6 100644 --- a/code/bngblaster/src/bbl_l2tp_avp.c +++ b/code/bngblaster/src/bbl_l2tp_avp.c @@ -179,7 +179,7 @@ bbl_l2tp_avp_unhide(bbl_l2tp_tunnel_t *l2tp_tunnel, bbl_l2tp_avp_t *avp, uint8_t uint8_t *cursor; uint8_t *value = avp->value; - uint16_t type = avp->type; + uint16_t type = htobe16(avp->type); uint16_t len = 0; uint8_t idx = 0; @@ -187,6 +187,8 @@ bbl_l2tp_avp_unhide(bbl_l2tp_tunnel_t *l2tp_tunnel, bbl_l2tp_avp_t *avp, uint8_t uint16_t secret_len = 0; if(!(random_vector && l2tp_tunnel->server->secret)) { + LOG(DEBUG, "L2TP Error (%s) Missing random-vector or secret\n", + l2tp_tunnel->server->host_name); return false; } @@ -205,6 +207,8 @@ bbl_l2tp_avp_unhide(bbl_l2tp_tunnel_t *l2tp_tunnel, bbl_l2tp_avp_t *avp, uint8_t value++; if (len + 2 > avp->len) { + LOG(DEBUG, "L2TP Error (%s) Decrypted length %u > AVP length %u\n", + l2tp_tunnel->server->host_name, len, avp->len); return false; } diff --git a/code/bngblaster/src/bbl_rx.c b/code/bngblaster/src/bbl_rx.c index eeb77457..a4e03a0a 100644 --- a/code/bngblaster/src/bbl_rx.c +++ b/code/bngblaster/src/bbl_rx.c @@ -553,6 +553,11 @@ bbl_rx_icmpv6(bbl_ethernet_header_t *eth, bbl_ipv6_t *ipv6, bbl_interface_s *int return; } + if(session->access_type == ACCESS_TYPE_PPPOE && + session->ip6cp_state != BBL_PPP_OPENED) { + return; + } + if(icmpv6->type == IPV6_ICMPV6_ROUTER_ADVERTISEMENT) { if(!session->icmpv6_ra_received) { /* The first RA received ... */ @@ -878,11 +883,13 @@ bbl_rx_pap(bbl_ethernet_header_t *eth, bbl_interface_s *interface, bbl_session_s session->ipcp_state = BBL_PPP_INIT; session->ipcp_request_code = PPP_CODE_CONF_REQUEST; session->send_requests |= BBL_SEND_IPCP_REQUEST; + session->send_requests &= ~BBL_SEND_IPCP_RESPONSE; } if(ctx->config.ip6cp_enable) { session->ip6cp_state = BBL_PPP_INIT; session->ip6cp_request_code = PPP_CODE_CONF_REQUEST; session->send_requests |= BBL_SEND_IP6CP_REQUEST; + session->send_requests &= ~BBL_SEND_IP6CP_RESPONSE; } bbl_session_tx_qnode_insert(session); break; @@ -975,11 +982,13 @@ bbl_rx_chap(bbl_ethernet_header_t *eth, bbl_interface_s *interface, bbl_session_ session->ipcp_state = BBL_PPP_INIT; session->ipcp_request_code = PPP_CODE_CONF_REQUEST; session->send_requests |= BBL_SEND_IPCP_REQUEST; + session->send_requests &= ~BBL_SEND_IPCP_RESPONSE; } if(ctx->config.ip6cp_enable) { session->ip6cp_state = BBL_PPP_INIT; session->ip6cp_request_code = PPP_CODE_CONF_REQUEST; session->send_requests |= BBL_SEND_IP6CP_REQUEST; + session->send_requests &= ~BBL_SEND_IP6CP_RESPONSE; } bbl_session_tx_qnode_insert(session); break; diff --git a/code/bngblaster/src/bbl_tx.c b/code/bngblaster/src/bbl_tx.c index 9e8f2a51..d3f00764 100644 --- a/code/bngblaster/src/bbl_tx.c +++ b/code/bngblaster/src/bbl_tx.c @@ -609,7 +609,7 @@ bbl_dhcpv6_timeout(timer_s *timer) bbl_session_tx_qnode_insert(session); } else { if(session->dhcpv6_state == BBL_DHCP_RELEASE) { - session->dhcpv6_state = session->dhcpv6_state == BBL_DHCP_INIT; + session->dhcpv6_state = BBL_DHCP_INIT; if(session->session_state == BBL_TERMINATING) { bbl_session_clear(ctx, session); }