Browse Source

added a flag field to QUERY_PEER (#835)

pull/836/head
Logan oos Even 3 years ago
committed by GitHub
parent
commit
ebb357245a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      include/n2n_typedefs.h
  2. 2
      src/edge_utils.c
  3. 2
      src/wire.c

1
include/n2n_typedefs.h

@ -421,6 +421,7 @@ typedef struct n2n_PEER_INFO {
typedef struct n2n_QUERY_PEER { typedef struct n2n_QUERY_PEER {
uint16_t aflags;
n2n_mac_t srcMac; n2n_mac_t srcMac;
n2n_sock_t sock; n2n_sock_t sock;
n2n_mac_t targetMac; n2n_mac_t targetMac;

2
src/edge_utils.c

@ -1148,7 +1148,7 @@ void send_query_peer (n2n_edge_t * eee,
uint8_t pktbuf[N2N_PKT_BUF_SIZE]; uint8_t pktbuf[N2N_PKT_BUF_SIZE];
size_t idx; size_t idx;
n2n_common_t cmn = {0}; n2n_common_t cmn = {0};
n2n_QUERY_PEER_t query = {{0}}; n2n_QUERY_PEER_t query = {0};
struct peer_info *peer, *tmp; struct peer_info *peer, *tmp;
int n_o_pings = 0; int n_o_pings = 0;
int n_o_top_sn = 0; int n_o_top_sn = 0;

2
src/wire.c

@ -705,6 +705,7 @@ int encode_QUERY_PEER (uint8_t * base,
retval += encode_common(base, idx, common); retval += encode_common(base, idx, common);
retval += encode_mac(base, idx, pkt->srcMac); retval += encode_mac(base, idx, pkt->srcMac);
retval += encode_mac(base, idx, pkt->targetMac); retval += encode_mac(base, idx, pkt->targetMac);
retval += encode_uint16(base, idx, pkt->aflags);
return retval; return retval;
} }
@ -720,6 +721,7 @@ int decode_QUERY_PEER (n2n_QUERY_PEER_t * pkt,
retval += decode_mac(pkt->srcMac, base, rem, idx); retval += decode_mac(pkt->srcMac, base, rem, idx);
retval += decode_mac(pkt->targetMac, base, rem, idx); retval += decode_mac(pkt->targetMac, base, rem, idx);
retval += decode_uint16(&(pkt->aflags), base, rem, idx);
return retval; return retval;
} }

Loading…
Cancel
Save