summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/ipoe/arp.c
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2013-06-26 16:18:58 +0400
committerKozlov Dmitry <xeb@mail.ru>2013-06-26 16:18:58 +0400
commita7ab20b5ff328aadcc20e84d740958c5a1127dc8 (patch)
treeefd2f5401965f2fc707198e2e2211e242b393d95 /accel-pppd/ctrl/ipoe/arp.c
parentc9fd1cb12b850540af53bbe906f49e4cf28ed391 (diff)
downloadaccel-ppp-a7ab20b5ff328aadcc20e84d740958c5a1127dc8.tar.gz
accel-ppp-a7ab20b5ff328aadcc20e84d740958c5a1127dc8.zip
ipoe: send arp reply only for authorized sessions
Diffstat (limited to 'accel-pppd/ctrl/ipoe/arp.c')
-rw-r--r--accel-pppd/ctrl/ipoe/arp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/accel-pppd/ctrl/ipoe/arp.c b/accel-pppd/ctrl/ipoe/arp.c
index 3bde87b..4ea6688 100644
--- a/accel-pppd/ctrl/ipoe/arp.c
+++ b/accel-pppd/ctrl/ipoe/arp.c
@@ -82,7 +82,7 @@ static int arp_read(struct triton_md_handler_t *h)
if (memcmp(ah->ar_sha, src.sll_addr, ETH_ALEN))
continue;
-
+
ses1 = ses2 = NULL;
pthread_mutex_lock(&s->ipoe->lock);
list_for_each_entry(ses, &s->ipoe->sessions, entry) {
@@ -100,15 +100,13 @@ static int arp_read(struct triton_md_handler_t *h)
break;
}
- if ((ses1 && ses1->ses.state != AP_STATE_ACTIVE) ||
+ if (!ses1 || (ses1->ses.state != AP_STATE_ACTIVE) ||
(ses2 && ses2->ses.state != AP_STATE_ACTIVE)) {
pthread_mutex_unlock(&s->ipoe->lock);
continue;
}
-
- if (!ses1)
- memcpy(ah2.ar_sha, s->ipoe->hwaddr, ETH_ALEN);
- else if (ses2) {
+
+ if (ses2) {
if (s->ipoe->opt_arp == 1 || ses1 == ses2) {
pthread_mutex_unlock(&s->ipoe->lock);
continue;