mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
devip: allow (NAT) hole punching for ICMP and UDP
When establishing an translation for ICMP or UDP, allow the reply to be matched from ANY source ip/port.
This commit is contained in:
parent
7ee606d027
commit
a916137c97
1 changed files with 2 additions and 1 deletions
|
@ -520,7 +520,8 @@ transforward(Proto *p, Ipht *ht, uchar *sa, int sp, uchar *da, int dp, Route *r)
|
|||
q->backward.trans = 2;
|
||||
q->backward.lport = lport;
|
||||
ipmove(q->backward.laddr, ia);
|
||||
if(p->ipproto == 1 || ipismulticast(da)){
|
||||
if(p->ipproto == 1 || p->ipproto == 17){
|
||||
/* ICMP and UDP allow reply from anyone (for hole punching) */
|
||||
q->backward.rport = 0;
|
||||
ipmove(q->backward.raddr, IPnoaddr);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue