Browse Source

clean up

tags/v1.0.0
Pascal Gloor 5 years ago
parent
commit
ec9a7a6824
1 changed files with 3 additions and 7 deletions
  1. 3
    7
      dhcp_protect.c

+ 3
- 7
dhcp_protect.c View File

unsigned char *pkt; unsigned char *pkt;
int pktlen; int pktlen;
int offset = 0; int offset = 0;
unsigned char *remoteid;
unsigned char *remoteid = NULL;
int remoteidlen = 0; int remoteidlen = 0;
int found = 0; int found = 0;
uint8_t ipver = 0; uint8_t ipver = 0;


offset++; offset++;


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

// padding of 1 octet // padding of 1 octet
if ( type == 0 ) { if ( type == 0 ) {
continue; continue;
len = pkt[offset]; len = pkt[offset];
offset++; offset++;


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

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


// option 82 parser // option 82 parser
static int dp_callback(struct nfq_q_handle *qh, struct nfgenmsg *nfmsg, struct nfq_data *nfa, void *data) { 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); struct nfqnl_msg_packet_hdr *ph = nfq_get_msg_packet_hdr(nfa);
dp_conf *conf = (dp_conf*)data; dp_conf *conf = (dp_conf*)data;
int id;
int id = -1;
int verdict; int verdict;


if ( ph ) { if ( ph ) {

Loading…
Cancel
Save