Skip to content

Commit f47644d

Browse files
committed
Renamed 'upStreamVif' to 'upStreamIfIdx' for clarity.
Signed-off-by: Victor Toni <[email protected]>
1 parent 1c6959f commit f47644d

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

src/igmp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ void acceptIgmp(int recvlen) {
142142

143143
for(i=0; i<MAX_UPS_VIFS; i++)
144144
{
145-
if(-1 != upStreamVif[i])
145+
if(-1 != upStreamIfIdx[i])
146146
{
147147
// Check if the source address matches a valid address on upstream vif.
148-
checkVIF = getIfByIx( upStreamVif[i] );
148+
checkVIF = getIfByIx( upStreamIfIdx[i] );
149149
if(checkVIF == 0) {
150150
my_log(LOG_ERR, 0, "Upstream VIF was null.");
151151
return;

src/igmpproxy.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ static int sighandled = 0;
6262
#define GOT_SIGUSR1 0x04
6363
#define GOT_SIGUSR2 0x08
6464

65-
// The upstream VIF index
66-
int upStreamVif[MAX_UPS_VIFS];
65+
// Holds the indeces of the upstream IF...
66+
int upStreamIfIdx[MAX_UPS_VIFS];
6767

6868
/**
6969
* Program main method. Is invoked when the program is started
@@ -187,9 +187,10 @@ int igmpProxyInit(void) {
187187
struct IfDesc *Dp;
188188
int vifcount = 0, upsvifcount = 0;
189189

190+
// init array to "not set"
190191
for ( Ix = 0; Ix < MAX_UPS_VIFS; Ix++)
191192
{
192-
upStreamVif[Ix] = -1;
193+
upStreamIfIdx[Ix] = -1;
193194
}
194195

195196
for ( Ix = 0; (Dp = getIfByIx(Ix)); Ix++ ) {
@@ -198,7 +199,9 @@ int igmpProxyInit(void) {
198199
if(Dp->state == IF_STATE_UPSTREAM) {
199200
if (upsvifcount < MAX_UPS_VIFS -1)
200201
{
201-
upStreamVif[upsvifcount++] = Ix;
202+
my_log(LOG_DEBUG, 0, "Found upstrem IF #%d, will assing as upstream Vif %d",
203+
upsvifcount, Ix);
204+
upStreamIfIdx[upsvifcount++] = Ix;
202205
} else {
203206
my_log(LOG_ERR, 0, "Cannot set VIF #%d as upstream as well. Mac upstream Vif count is %d",
204207
Ix, MAX_UPS_VIFS);

src/igmpproxy.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ struct Config {
179179
//~ aimwang added done
180180
};
181181

182-
// Defines the Index of the upstream VIF...
183-
extern int upStreamVif[MAX_UPS_VIFS];
182+
// Holds the indeces of the upstream IF...
183+
extern int upStreamIfIdx[MAX_UPS_VIFS];
184184

185185
/* ifvc.c
186186
*/

src/rttable.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ static void sendJoinLeaveUpstream(struct RouteTable* route, int join) {
122122

123123
for(i=0; i<MAX_UPS_VIFS; i++)
124124
{
125-
if (-1 != upStreamVif[i])
125+
if (-1 != upStreamIfIdx[i])
126126
{
127-
// Get the upstream VIF...
128-
upstrIf = getIfByIx( upStreamVif[i] );
127+
// Get the upstream IF...
128+
upstrIf = getIfByIx( upStreamIfIdx[i] );
129129
if(upstrIf == NULL) {
130130
my_log(LOG_ERR, 0 ,"FATAL: Unable to get Upstream IF.");
131131
}

0 commit comments

Comments
 (0)