Commit 554971d
committed
bhyve: Use getaddrinfo(3) consistently for AF_UNIX.
The FreeBSD getaddrinfo(3) function also supports the
AF_UNIX address family. Use it the same way as inet and
inet6 so that we can share the same code. However, the
getaddrinfo(3) accepts an absolute path only. The path
string that follows 'unix:' will be resolved by the
realpath(3) function.
The freeaddrinfo(3) function also supports a NULL argument,
as does free(3). No need to check a NULL pointer.
While I'm here, the UNIX domain socket should allow all
users to access it as if it were a TCP port. Changes umask
to 0 before bind(2), and restores the previous value after
the bind(2).
Signed-off-by: Yuichiro NAITO <[email protected]>1 parent 17ba6f4 commit 554971d
2 files changed
+47
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
240 | 241 | | |
241 | 242 | | |
242 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
243 | 268 | | |
244 | 269 | | |
245 | 270 | | |
| |||
295 | 320 | | |
296 | 321 | | |
297 | 322 | | |
298 | | - | |
| 323 | + | |
299 | 324 | | |
300 | 325 | | |
301 | 326 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | | - | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
1263 | 1263 | | |
1264 | 1264 | | |
1265 | 1265 | | |
1266 | | - | |
1267 | 1266 | | |
1268 | 1267 | | |
| 1268 | + | |
1269 | 1269 | | |
1270 | 1270 | | |
1271 | 1271 | | |
| |||
1304 | 1304 | | |
1305 | 1305 | | |
1306 | 1306 | | |
1307 | | - | |
1308 | | - | |
1309 | | - | |
1310 | | - | |
1311 | | - | |
1312 | | - | |
1313 | | - | |
1314 | | - | |
1315 | | - | |
1316 | | - | |
1317 | | - | |
1318 | | - | |
1319 | | - | |
1320 | | - | |
1321 | | - | |
1322 | | - | |
1323 | | - | |
1324 | | - | |
1325 | | - | |
1326 | | - | |
1327 | | - | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
1328 | 1313 | | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
1329 | 1320 | | |
1330 | 1321 | | |
1331 | 1322 | | |
| |||
1334 | 1325 | | |
1335 | 1326 | | |
1336 | 1327 | | |
1337 | | - | |
| 1328 | + | |
1338 | 1329 | | |
1339 | | - | |
1340 | | - | |
1341 | | - | |
1342 | | - | |
| 1330 | + | |
| 1331 | + | |
1343 | 1332 | | |
| 1333 | + | |
1344 | 1334 | | |
1345 | 1335 | | |
| 1336 | + | |
1346 | 1337 | | |
1347 | 1338 | | |
1348 | 1339 | | |
| |||
1375 | 1366 | | |
1376 | 1367 | | |
1377 | 1368 | | |
1378 | | - | |
1379 | | - | |
| 1369 | + | |
1380 | 1370 | | |
1381 | 1371 | | |
1382 | 1372 | | |
1383 | 1373 | | |
1384 | 1374 | | |
1385 | | - | |
1386 | | - | |
1387 | | - | |
1388 | | - | |
| 1375 | + | |
1389 | 1376 | | |
1390 | 1377 | | |
1391 | 1378 | | |
| |||
0 commit comments