History

ip/ipconfig: treat /32 mask as /0

some dhcp servers send a mask of 255.255.255.255 to indicate the gateway is directly routeable. thanks to david du colombier for this patch.

mischief committed 11 years ago

Commit ce61dcdNo parent (first commit)20941 files · +4911796 −-5654Browse files

Showing the changes to sys/src/cmd/python/Demo/sockets/rpython.py (1 of 20941 files). Show all

Unified · Split

sys/src/cmd/python/Demo/sockets/rpython.py+35−0
@@ -0,0 +1,35 @@
1+#! /usr/bin/env python
2+
3+# Remote python client.
4+# Execute Python commands remotely and send output back.
5+
6+import sys
7+import string
8+from socket import *
9+
10+PORT = 4127
11+BUFSIZE = 1024
12+
13+def main():
14+ if len(sys.argv) < 3:
15+ print "usage: rpython host command"
16+ sys.exit(2)
17+ host = sys.argv[1]
18+ port = PORT
19+ i = string.find(host, ':')
20+ if i >= 0:
21+ port = string.atoi(port[i+1:])
22+ host = host[:i]
23+ command = string.join(sys.argv[2:])
24+ s = socket(AF_INET, SOCK_STREAM)
25+ s.connect((host, port))
26+ s.send(command)
27+ s.shutdown(1)
28+ reply = ''
29+ while 1:
30+ data = s.recv(BUFSIZE)
31+ if not data: break
32+ reply = reply + data
33+ print reply,
34+
35+main()

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t