Interpret incoming addresses according to their family

This commit is contained in:
Pierre Pronchery 2018-06-26 02:20:12 +02:00
parent 6bcaf4f3e3
commit 8ecd10b4c0
2 changed files with 6 additions and 6 deletions

View File

@ -635,10 +635,10 @@ typedef struct spa_data
char *version;
short message_type;
char *spa_message;
char spa_message_src_ip[MAX_IPV4_STR_LEN];
char pkt_source_ip[MAX_IPV4_STR_LEN];
char pkt_source_xff_ip[MAX_IPV4_STR_LEN];
char pkt_destination_ip[MAX_IPV4_STR_LEN];
char spa_message_src_ip[MAX_IPV46_STR_LEN];
char pkt_source_ip[MAX_IPV46_STR_LEN];
char pkt_source_xff_ip[MAX_IPV46_STR_LEN];
char pkt_destination_ip[MAX_IPV46_STR_LEN];
char spa_message_remain[1024]; /* --DSS FIXME: arbitrary bounds */
char *nat_access;
char *server_auth;

View File

@ -930,10 +930,10 @@ incoming_spa(fko_srv_options_t *opts)
*/
acc_stanza_t *acc = opts->acc_stanzas;
inet_ntop(AF_INET, &(spa_pkt->packet_src_ip),
inet_ntop(spa_pkt->packet_family, &(spa_pkt->packet_src_ip),
spadat.pkt_source_ip, sizeof(spadat.pkt_source_ip));
inet_ntop(AF_INET, &(spa_pkt->packet_dst_ip),
inet_ntop(spa_pkt->packet_family, &(spa_pkt->packet_dst_ip),
spadat.pkt_destination_ip, sizeof(spadat.pkt_destination_ip));
/* At this point, we want to validate and (if needed) preprocess the