Commit e873aae
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 addrinfo structure is no longer needed after the
bind(2) call. Free it after the bind(2) to remove
freeaddrinfo(3) in the error label code.
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 the
permission to world wide readable and writable.
Signed-off-by: Yuichiro NAITO <naito.yuichiro@gmail.com>1 parent 17ba6f4 commit e873aae
2 files changed
Lines changed: 59 additions & 45 deletions
| 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 | + | |
243 | 267 | | |
244 | 268 | | |
245 | 269 | | |
| |||
285 | 309 | | |
286 | 310 | | |
287 | 311 | | |
288 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
289 | 319 | | |
290 | 320 | | |
291 | | - | |
| 321 | + | |
292 | 322 | | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | 323 | | |
300 | 324 | | |
301 | 325 | | |
| |||
| 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 | | |
| |||
1258 | 1258 | | |
1259 | 1259 | | |
1260 | 1260 | | |
1261 | | - | |
| 1261 | + | |
1262 | 1262 | | |
1263 | 1263 | | |
1264 | 1264 | | |
1265 | 1265 | | |
1266 | | - | |
1267 | 1266 | | |
1268 | 1267 | | |
1269 | 1268 | | |
| |||
1304 | 1303 | | |
1305 | 1304 | | |
1306 | 1305 | | |
1307 | | - | |
1308 | | - | |
1309 | | - | |
1310 | | - | |
1311 | | - | |
1312 | | - | |
1313 | | - | |
1314 | | - | |
1315 | | - | |
1316 | | - | |
1317 | | - | |
1318 | | - | |
1319 | | - | |
1320 | | - | |
1321 | | - | |
1322 | | - | |
1323 | | - | |
1324 | | - | |
1325 | | - | |
1326 | | - | |
1327 | | - | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
1328 | 1310 | | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
1329 | 1317 | | |
1330 | 1318 | | |
| 1319 | + | |
1331 | 1320 | | |
1332 | 1321 | | |
1333 | 1322 | | |
1334 | | - | |
1335 | | - | |
1336 | | - | |
1337 | | - | |
| 1323 | + | |
1338 | 1324 | | |
1339 | | - | |
1340 | | - | |
1341 | | - | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
1342 | 1331 | | |
| 1332 | + | |
1343 | 1333 | | |
1344 | 1334 | | |
1345 | 1335 | | |
1346 | 1336 | | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
1347 | 1343 | | |
1348 | 1344 | | |
1349 | 1345 | | |
| |||
1375 | 1371 | | |
1376 | 1372 | | |
1377 | 1373 | | |
1378 | | - | |
1379 | | - | |
1380 | 1374 | | |
1381 | 1375 | | |
1382 | 1376 | | |
1383 | 1377 | | |
1384 | 1378 | | |
1385 | | - | |
1386 | | - | |
1387 | | - | |
1388 | | - | |
1389 | 1379 | | |
1390 | 1380 | | |
1391 | 1381 | | |
| |||
0 commit comments