diff options
author | rsc <devnull@localhost> | 2005-05-19 14:39:10 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-05-19 14:39:10 +0000 |
commit | 4c06b8eec1a1d71f67561d4fa9860850795c56aa (patch) | |
tree | a05deac604e8554498945a9f32deb524acfe95ec /src/libsunrpc/net.c | |
parent | f92a2ceba411689890e6f8aab81a03f30b802b10 (diff) | |
download | plan9port-4c06b8eec1a1d71f67561d4fa9860850795c56aa.tar.gz plan9port-4c06b8eec1a1d71f67561d4fa9860850795c56aa.tar.bz2 plan9port-4c06b8eec1a1d71f67561d4fa9860850795c56aa.zip |
fixes for vnfs
Diffstat (limited to 'src/libsunrpc/net.c')
-rw-r--r-- | src/libsunrpc/net.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libsunrpc/net.c b/src/libsunrpc/net.c index 28890d6c..a8b917e0 100644 --- a/src/libsunrpc/net.c +++ b/src/libsunrpc/net.c @@ -1,5 +1,6 @@ #include <u.h> #include <libc.h> +#include <ip.h> #include <thread.h> #include <sunrpc.h> @@ -16,7 +17,10 @@ sunnetlisten(void *v) { int fd, lcfd; char ldir[40]; + uchar ip[IPaddrlen]; + int port; Arg *a = v; + NetConnInfo *nci; for(;;){ lcfd = listen(a->adir, ldir); @@ -26,6 +30,19 @@ sunnetlisten(void *v) close(lcfd); if(fd < 0) continue; + if(a->srv->ipokay){ + if((nci = getnetconninfo(nil, fd)) == nil){ + close(fd); + continue; + } + port = atoi(nci->rserv); + parseip(ip, nci->raddr); + freenetconninfo(nci); + if(!a->srv->ipokay(ip, port)){ + close(fd); + continue; + } + } if(!sunsrvfd(a->srv, fd)) close(fd); } |