Add support for receiving SPA messages over IPv6
This commit is contained in:
+18
-2
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user