瀏覽代碼

clean up

tags/v1.0.0
Pascal Gloor 5 年之前
父節點
當前提交
ec9a7a6824
共有 1 個文件被更改,包括 3 次插入7 次删除
  1. 3
    7
      dhcp_protect.c

+ 3
- 7
dhcp_protect.c 查看文件

@@ -193,7 +193,7 @@ int dhcp_check(struct nfq_data *nfa, dp_conf *conf) {
unsigned char *pkt;
int pktlen;
int offset = 0;
unsigned char *remoteid;
unsigned char *remoteid = NULL;
int remoteidlen = 0;
int found = 0;
uint8_t ipver = 0;
@@ -263,8 +263,6 @@ int dhcp_check(struct nfq_data *nfa, dp_conf *conf) {

offset++;

// printf("type : %i\n",type);

// padding of 1 octet
if ( type == 0 ) {
continue;
@@ -281,10 +279,8 @@ int dhcp_check(struct nfq_data *nfa, dp_conf *conf) {
len = pkt[offset];
offset++;

// printf("len : %i\n", len);

// can the value be read
if ( offset+len>=pktlen )
if ( offset+len>pktlen )
break;

// option 82 parser
@@ -348,7 +344,7 @@ int dhcp_check(struct nfq_data *nfa, dp_conf *conf) {
static int dp_callback(struct nfq_q_handle *qh, struct nfgenmsg *nfmsg, struct nfq_data *nfa, void *data) {
struct nfqnl_msg_packet_hdr *ph = nfq_get_msg_packet_hdr(nfa);
dp_conf *conf = (dp_conf*)data;
int id;
int id = -1;
int verdict;

if ( ph ) {

Loading…
取消
儲存