mirror of
https://github.com/rtbrick/bngblaster.git
synced 2024-05-06 15:54:57 +00:00
Fix LCP Vendor OUI
This commit is contained in:
+2
-3
@@ -2999,10 +2999,9 @@ decode_ppp_lcp(uint8_t *buf, uint16_t len,
|
||||
return DECODE_ERROR;
|
||||
}
|
||||
lcp->magic = *(uint32_t*)buf;
|
||||
BUMP_BUFFER(buf, lcp_len, 3);
|
||||
lcp->vendor_oui = *(uint32_t*)buf;
|
||||
lcp->vendor_oui &= 0xffffff;
|
||||
BUMP_BUFFER(buf, lcp_len, sizeof(uint32_t));
|
||||
memcpy(lcp->vendor_oui, buf, OUI_LEN);
|
||||
BUMP_BUFFER(buf, lcp_len, OUI_LEN);
|
||||
lcp->vendor_kind = *buf;
|
||||
BUMP_BUFFER(buf, lcp_len, sizeof(uint8_t));
|
||||
lcp->vendor_value = buf;
|
||||
|
||||
+3
-1
@@ -48,6 +48,8 @@
|
||||
#define ETH_VLAN_ID_MAX 4095
|
||||
#define ETH_VLAN_PBIT_MAX 7
|
||||
|
||||
#define OUI_LEN 3
|
||||
|
||||
#define IPV4_RF 0x8000 /* reserved fragment flag */
|
||||
#define IPV4_DF 0x4000 /* dont fragment flag */
|
||||
#define IPV4_MF 0x2000 /* more fragments flag */
|
||||
@@ -534,7 +536,7 @@ typedef struct bbl_lcp_ {
|
||||
uint16_t mru;
|
||||
uint16_t auth;
|
||||
uint32_t magic;
|
||||
uint32_t vendor_oui;
|
||||
uint8_t vendor_oui[OUI_LEN];
|
||||
uint8_t vendor_kind;
|
||||
uint8_t *vendor_value;
|
||||
uint16_t vendor_value_len;
|
||||
|
||||
+1
-1
@@ -1161,8 +1161,8 @@ bbl_rx_lcp(bbl_ethernet_header_t *eth, bbl_interface_s *interface, bbl_session_s
|
||||
memcpy(session->connections_status_message, lcp->vendor_value, lcp->vendor_value_len);
|
||||
session->connections_status_message[lcp->vendor_value_len] = 0;
|
||||
session->lcp_response_code = PPP_CODE_VENDOR_SPECIFIC;
|
||||
*(uint32_t*)(session->lcp_options+3) = lcp->vendor_oui;
|
||||
*(uint32_t*)session->lcp_options = session->magic_number;
|
||||
memcpy(session->lcp_options+sizeof(uint32_t), lcp->vendor_oui, OUI_LEN);
|
||||
session->lcp_options[7] = 2;
|
||||
session->lcp_options_len = 8;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user