Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions source/HotspotApi/HotspotApi.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,10 @@ void firewall_restart() {

static int hotspot_sysevent_disable_param(){

sysevent_get(gSyseventfd, gSysevent_token, "hotspot_1-status",
NULL, 0);
if(0 != sysevent_get(gSyseventfd, gSysevent_token, "hotspot_1-status", NULL, 0))
{
return 1;
}
return 0;
}

Expand Down Expand Up @@ -1214,7 +1216,10 @@ pErr setHotspot(void* const network){
else{
CcspTraceInfo(("HOTSPOT_LIB : Gre is not enabled. Deleting tunnel info \n"));
deleteVaps();
hotspot_sysevent_disable_param();
if(hotspot_sysevent_disable_param())
{
CcspTraceInfo(("HOTSPOT_LIB : sysevent_get failed for hotspot_1-status \n"));
}
memset(vlanIdList, '\0', sizeof(vlanIdList));
memset(gPriEndptIP, '\0', sizeof(gPriEndptIP));
memset(gSecEndptIP, '\0', sizeof(gSecEndptIP));
Expand Down
28 changes: 16 additions & 12 deletions source/arp_solicitation/hotspot_arpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,18 +351,22 @@ static int get_interface_by_ifname(if_t *target)

if(sysevent_fd_gs >= 0)
{
sysevent_get(sysevent_fd_gs, sysevent_token_gs, SYSEVENT_MAPT_CONFIG_FLAG, buf, sizeof(buf));

if (strncmp(buf,"set", 3) == 0)
{
sysevent_get(sysevent_fd_gs, sysevent_token_gs, SYSEVENT_MAPT_IP_ADDRESS, buf, sizeof(buf));

if(inet_aton(buf,&(target->ip)))
{
mapt_ipv4 = 1;
}
}
sysevent_close(sysevent_fd_gs, sysevent_token_gs);
if(0 == sysevent_get(sysevent_fd_gs, sysevent_token_gs, SYSEVENT_MAPT_CONFIG_FLAG, buf, sizeof(buf)))
{
if (strncmp(buf,"set", 3) == 0)
{
if(0 == sysevent_get(sysevent_fd_gs, sysevent_token_gs, SYSEVENT_MAPT_IP_ADDRESS, buf, sizeof(buf)))
{
if(inet_aton(buf,&(target->ip)))
{
mapt_ipv4 = 1;
}
}
}
}
sysevent_close(sysevent_fd_gs, sysevent_token_gs);
sysevent_fd_gs = -1;
sysevent_token_gs = 0;
}
#endif
if(0 == mapt_ipv4)
Expand Down
36 changes: 23 additions & 13 deletions source/hotspotfd/hotspotfd.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* If not stated otherwise in this file or this component's Licenses.txt file the

Check failure on line 2 in source/hotspotfd/hotspotfd.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID Detected License Issue

Snippet with 'Apache-2.0' file license found (1409 lines) Location: source/hotspotfd/hotspotfd.c (link unavailable) Component: rdkb/components/opensource/ccsp/hotspot/rdkb/components/opensource/ccsp/hotspot@RDKB-TEST-RELEASE-1 Download: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/hotspot/+archive/RDKB-TEST-RELEASE-1.tar.gz

Check failure on line 2 in source/hotspotfd/hotspotfd.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID Detected License Issue

Snippet with 'Apache-2.0' file license found (1406 lines) Location: source/hotspotfd/hotspotfd.c (link unavailable) Component: rdkb/components/opensource/ccsp/hotspot/rdkb/components/opensource/ccsp/hotspot@RDKB-RELEASE-TEST-DUNFELL-1 Download: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/hotspot/+archive/RDKB-RELEASE-TEST-DUNFELL-1.tar.gz

Check failure on line 2 in source/hotspotfd/hotspotfd.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID Detected License Issue

Snippet with 'Apache-2.0' file license found (1418 lines) Location: source/hotspotfd/hotspotfd.c (link unavailable) Component: rdkb/components/opensource/ccsp/hotspot/rdkb/components/opensource/ccsp/hotspot@rdk-dev-2102 Download: https://code.rdkcentral.com/r/plugins/gitiles/rdkb/components/opensource/ccsp/hotspot/+archive/rdk-dev-2102.tar.gz
* following copyright and licenses apply:
*
* Copyright 2015 RDK Management
Expand Down Expand Up @@ -722,7 +722,7 @@

sum = (sum >> 16) + (sum & 0xFFFF);
sum += (sum >> 16);
result = ~sum;
result = (unsigned short)((~sum) & 0xFFFFU);

return result;
}
Expand Down Expand Up @@ -1261,10 +1261,9 @@

msg_debug("gpPrimaryEP: %s\n", gpPrimaryEP);

CcspTraceInfo((" GRE flag set to %d in sysevent handler \n", gbFirstPrimarySignal));

pthread_mutex_lock(&keep_alive_mutex);
gbFirstPrimarySignal = true;
CcspTraceInfo((" GRE flag set to %d in sysevent handler \n", gbFirstPrimarySignal));
pthread_mutex_unlock(&keep_alive_mutex);
} else if (ret_value == HOTSPOTFD_SECONDARY) {
rc = strcpy_s(gpSecondaryEP, sizeof(gpSecondaryEP), val);
Expand Down Expand Up @@ -2172,7 +2171,17 @@
hotspotfd_log();
}

bool processFirstPrimarySignal = false;

pthread_mutex_lock(&keep_alive_mutex);
if (gbFirstPrimarySignal) {
gbFirstPrimarySignal = false;
processFirstPrimarySignal = true;
CcspTraceInfo(("Primary GRE flag set to %d\n", gbFirstPrimarySignal));
}
pthread_mutex_unlock(&keep_alive_mutex);

if (processFirstPrimarySignal) {

if(ssid_reset_mask != 0)
{
Expand Down Expand Up @@ -2212,10 +2221,6 @@
#endif
gTunnelIsUp=true;

pthread_mutex_lock(&keep_alive_mutex);
gbFirstPrimarySignal = false;
pthread_mutex_unlock(&keep_alive_mutex);
CcspTraceInfo(("Primary GRE flag set to %d\n", gbFirstPrimarySignal));
if(switchedFromSecondary)
{
gSwitchedBackToPrimary++;
Expand Down Expand Up @@ -2369,9 +2374,18 @@
else {
CcspTraceInfo(("SSID's are not updated after tunnel deletion. \n"));
}
}
}

bool processFirstSecondarySignal = false;

pthread_mutex_lock(&keep_alive_mutex);
if (gbFirstSecondarySignal) {
gbFirstSecondarySignal = false;
processFirstSecondarySignal = true;
}
pthread_mutex_unlock(&keep_alive_mutex);

if (processFirstSecondarySignal) {
CcspTraceInfo(("Create Secondary GRE tunnel with endpoint:%s\n", gpSecondaryEP));

if (sysevent_set(sysevent_fd_gs, sysevent_token_gs,
Expand All @@ -2389,11 +2403,7 @@
#if (defined (_COSA_BCM_ARM_) && !defined(_XB6_PRODUCT_REQ_))
hotspotfd_syncMultinet();
#endif
gTunnelIsUp=true;

pthread_mutex_lock(&keep_alive_mutex);
gbFirstSecondarySignal = false;
pthread_mutex_unlock(&keep_alive_mutex);
gTunnelIsUp=true;
}

msg_debug("Secondary GRE Tunnel Endpoint is alive\n");
Expand Down
Loading