diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2019-05-13 11:51:17 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2019-05-13 11:51:17 +0300 |
commit | 85ace14ed9976e98081068fe2e797fcf09e08148 (patch) | |
tree | 7daecd3615d17ce70c5d6c492b950d4c360c6d83 /accel-pppd/ctrl | |
parent | 6f433706a152ea987899fd830ff399e257b0f2a6 (diff) | |
parent | e909de9c6afd0581c8847b3676b200f4c0b7237b (diff) | |
download | accel-ppp-85ace14ed9976e98081068fe2e797fcf09e08148.tar.gz accel-ppp-85ace14ed9976e98081068fe2e797fcf09e08148.zip |
Merge branch 'master' of github.com:xebd/accel-ppp
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r-- | accel-pppd/ctrl/ipoe/arp.c | 2 | ||||
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 11 | ||||
-rw-r--r-- | accel-pppd/ctrl/pppoe/pppoe.c | 1 |
3 files changed, 11 insertions, 3 deletions
diff --git a/accel-pppd/ctrl/ipoe/arp.c b/accel-pppd/ctrl/ipoe/arp.c index 0698bd1..1979c76 100644 --- a/accel-pppd/ctrl/ipoe/arp.c +++ b/accel-pppd/ctrl/ipoe/arp.c @@ -59,6 +59,7 @@ static void arp_ctx_read(struct _arphdr *ah) memset(&dst, 0, sizeof(dst)); dst.sll_family = AF_PACKET; dst.sll_ifindex = ipoe->ifindex; + dst.sll_halen = ETH_ALEN; dst.sll_protocol = htons(ETH_P_ARP); ah2.ar_hrd = htons(ARPHRD_ETHER); @@ -136,6 +137,7 @@ void arp_send(int ifindex, struct _arphdr *arph, int broadcast) memset(&dst, 0, sizeof(dst)); dst.sll_family = AF_PACKET; dst.sll_ifindex = ifindex; + dst.sll_halen = ETH_ALEN; dst.sll_protocol = htons(ETH_P_ARP); if (broadcast) memcpy(dst.sll_addr, bc_addr, ETH_ALEN); diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 5b44622..556bad7 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -1646,7 +1646,7 @@ static int ipoe_serv_request_check(struct ipoe_serv *serv, uint32_t xid) list_del(&r->entry); mempool_free(r); } else if (r->xid == xid) { - if (++r->cnt == conf_max_request) { + if (++r->cnt >= conf_max_request) { list_del(&r->entry); mempool_free(r); return 1; @@ -1660,7 +1660,7 @@ static int ipoe_serv_request_check(struct ipoe_serv *serv, uint32_t xid) r = mempool_alloc(req_item_pool); r->xid = xid; r->expire = ts.tv_sec + 30; - r->cnt = 0; + r->cnt = 1; list_add_tail(&r->entry, &serv->req_list); return 0; @@ -1825,7 +1825,12 @@ static void __ipoe_recv_dhcpv4(struct dhcpv4_serv *dhcpv4, struct dhcpv4_packet else if (opt82_ses) { dhcpv4_packet_ref(pack); triton_context_call(&opt82_ses->ctx, (triton_event_func)mac_change_detected, pack); - } else if (ipoe_serv_request_check(serv, pack->hdr->xid)) + } + + if (ap_shutdown) + goto out; + + if (ipoe_serv_request_check(serv, pack->hdr->xid)) dhcpv4_send_nak(dhcpv4, pack); } else { if (ses->terminate) { diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c index 7ab20e3..12b5400 100644 --- a/accel-pppd/ctrl/pppoe/pppoe.c +++ b/accel-pppd/ctrl/pppoe/pppoe.c @@ -748,6 +748,7 @@ static void pppoe_send(struct pppoe_serv_t *serv, const uint8_t *pack) .sll_family = AF_PACKET, .sll_protocol = htons(ETH_P_PPP_DISC), .sll_ifindex = serv->ifindex, + .sll_halen = ETH_ALEN, }; struct pppoe_hdr *hdr = (struct pppoe_hdr *)(pack + ETH_HLEN); |