1
0
mirror of https://code.semirocket.science/wrapsix synced 2025-12-15 02:05:13 +02:00

Ethernet stuff moved to separated header file

Reworked IP addresses translation functions
Centralized initializing of random number generator
This commit is contained in:
Michal Zima
2011-11-08 21:15:36 +01:00
parent e0015145e2
commit 214c42728b
5 changed files with 55 additions and 36 deletions

View File

@@ -1,6 +1,6 @@
/*
* WrapSix
* Copyright (C) 2008-2010 Michal Zima <xhire@mujmalysvet.cz>
* Copyright (C) 2008-2011 Michal Zima <xhire@mujmalysvet.cz>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -89,7 +89,6 @@ struct s_nat *nat_out(radixtree_t *nat_proto6, radixtree_t *nat_proto4,
result->last_packet = time(NULL);
/* generate some outgoing port */
srand((unsigned int) time(NULL));
do {
/* return port from range 1024 - 65535 */
connection->ipv4_port_src = (rand() % 64511) + 1024;