Add support for receiving SPA messages over IPv6

This commit is contained in:
2018-07-18 00:20:01 +02:00
parent 4c92ab116f
commit c49c96b77c
2 changed files with 19 additions and 4 deletions
+18 -2
View File
@@ -600,12 +600,28 @@ typedef struct spa_pkt_info
{
unsigned int packet_data_len;
unsigned int packet_proto;
unsigned int packet_src_ip;
unsigned int packet_dst_ip;
unsigned int packet_family;
union
{
struct
{
unsigned int src_ip;
unsigned int dst_ip;
} inet;
#if HAVE_NETINET_IP6_H
struct
{
struct in6_addr src_ip;
struct in6_addr dst_ip;
} inet6;
#endif
} packet_addr;
unsigned short packet_src_port;
unsigned short packet_dst_port;
unsigned char packet_data[MAX_SPA_PACKET_LEN+1];
} spa_pkt_info_t;
#define packet_src_ip packet_addr.inet.src_ip
#define packet_dst_ip packet_addr.inet.dst_ip
/* Struct for (processed and verified) SPA data used by the server.
*/
+1 -2
View File
@@ -263,14 +263,13 @@ process_packet_ipv4(fko_srv_options_t * opts, const unsigned char * packet,
strlcpy((char *)opts->spa_pkt.packet_data, (char *)pkt_data, pkt_data_len+1);
opts->spa_pkt.packet_data_len = pkt_data_len;
opts->spa_pkt.packet_proto = proto;
opts->spa_pkt.packet_family = AF_INET;
opts->spa_pkt.packet_src_ip = src_ip;
opts->spa_pkt.packet_dst_ip = dst_ip;
opts->spa_pkt.packet_src_port = src_port;
opts->spa_pkt.packet_dst_port = dst_port;
incoming_spa(opts);
return;
}