diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-08-14 23:07:10 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-08-14 23:07:10 +0200 |
commit | 58a0db935ce609533d121a5158a3a9fc65d03f65 (patch) | |
tree | 25a6015d22d55ab9796f5d0374d261d8c3c2d609 /sys/src/9/ip | |
parent | d41ca0d32cac02ee12733b0710d8eae3f34c6a4c (diff) |
ip/il: dont attept to connect over IPv6, IL only supports IPv4 packets
Diffstat (limited to 'sys/src/9/ip')
-rw-r--r-- | sys/src/9/ip/il.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/src/9/ip/il.c b/sys/src/9/ip/il.c index 2549fa49e..89ec60bd0 100644 --- a/sys/src/9/ip/il.c +++ b/sys/src/9/ip/il.c @@ -251,6 +251,9 @@ ilconnect(Conv *c, char **argv, int argc) e = Fsstdconnect(c, argv, argc); if(e != nil) return e; + if(c->ipversion != V4) + return "only IP version 4 supported"; + return ilstart(c, IL_CONNECT, fast); } @@ -548,6 +551,9 @@ iliput(Proto *il, Ipifc*, Block *bp) ih = (Ilhdr *)bp->rp; plen = blocklen(bp); + if(plen > 0 && (ih->vihl&0xF0)!=IP_VER4) + goto raise; /* ignore non V4 packets */ + if(plen < IL_IPSIZE+IL_HDRSIZE){ netlog(il->f, Logil, "il: hlenerr\n"); ipriv->stats[HlenErrs]++; |