Commit fa22a37
committed
Address review comments, fix bugs, add tests
- ioctl(): read vararg as void* to avoid UB when callers pass pointers
- bsd_socket.c: fix errno assignments to use -ret (positive) per POSIX
- bsd_socket.c: use -WOLFIP_EAGAIN instead of -EAGAIN in recvfrom
- wolfip.c: fix packet socket TX filter loop to pop head on reject
instead of advancing via fifo_next() (queue corruption fix)
- wolfip.c: return -WOLFIP_EMSGSIZE on buffer-too-small in recvfrom
for raw, packet, and ICMP socket paths
- wolfip.c: packet setsockopt now rejects unsupported options with
-WOLFIP_EINVAL instead of silently succeeding
- wolfip.c: getsockopt RECVTTL returns enabled state (1/0), not TTL
- wolfip.c: arp_lookup_ex returns -WOLFIP_ENOENT on miss
- wolfip.h: add WOLFIP_EMSGSIZE and WOLFIP_ENOENT error codes
- wolfip.c: fix IS_IP_BCAST -> wolfIP_ip_is_broadcast() after rebase
- Add 7 new unit tests covering EMSGSIZE paths, setsockopt rejection,
raw socket options, getsockopt behavior, packet TX via poll, and
arp_lookup_ex error codes
- Update existing tests to match new error return values1 parent 3b5aa5d commit fa22a37
6 files changed
Lines changed: 331 additions & 25 deletions
File tree
- src
- port/posix
- test/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1237 | 1237 | | |
1238 | 1238 | | |
1239 | 1239 | | |
1240 | | - | |
1241 | 1240 | | |
1242 | 1241 | | |
1243 | 1242 | | |
1244 | 1243 | | |
1245 | 1244 | | |
1246 | | - | |
| 1245 | + | |
1247 | 1246 | | |
1248 | | - | |
1249 | 1247 | | |
1250 | 1248 | | |
1251 | | - | |
| 1249 | + | |
1252 | 1250 | | |
1253 | 1251 | | |
1254 | 1252 | | |
1255 | 1253 | | |
1256 | 1254 | | |
1257 | | - | |
| 1255 | + | |
1258 | 1256 | | |
1259 | 1257 | | |
1260 | 1258 | | |
| |||
1330 | 1328 | | |
1331 | 1329 | | |
1332 | 1330 | | |
1333 | | - | |
| 1331 | + | |
1334 | 1332 | | |
1335 | 1333 | | |
1336 | 1334 | | |
| |||
1402 | 1400 | | |
1403 | 1401 | | |
1404 | 1402 | | |
1405 | | - | |
| 1403 | + | |
1406 | 1404 | | |
1407 | 1405 | | |
1408 | 1406 | | |
| |||
1445 | 1443 | | |
1446 | 1444 | | |
1447 | 1445 | | |
1448 | | - | |
| 1446 | + | |
1449 | 1447 | | |
1450 | 1448 | | |
1451 | 1449 | | |
| |||
1502 | 1500 | | |
1503 | 1501 | | |
1504 | 1502 | | |
1505 | | - | |
| 1503 | + | |
1506 | 1504 | | |
1507 | 1505 | | |
1508 | 1506 | | |
| |||
1556 | 1554 | | |
1557 | 1555 | | |
1558 | 1556 | | |
1559 | | - | |
| 1557 | + | |
1560 | 1558 | | |
1561 | 1559 | | |
1562 | 1560 | | |
| |||
1577 | 1575 | | |
1578 | 1576 | | |
1579 | 1577 | | |
1580 | | - | |
| 1578 | + | |
1581 | 1579 | | |
1582 | 1580 | | |
1583 | 1581 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
708 | 708 | | |
709 | 709 | | |
710 | 710 | | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
711 | 718 | | |
712 | 719 | | |
713 | 720 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1465 | 1465 | | |
1466 | 1466 | | |
1467 | 1467 | | |
1468 | | - | |
| 1468 | + | |
1469 | 1469 | | |
1470 | 1470 | | |
1471 | 1471 | | |
| |||
1690 | 1690 | | |
1691 | 1691 | | |
1692 | 1692 | | |
1693 | | - | |
| 1693 | + | |
1694 | 1694 | | |
1695 | 1695 | | |
1696 | 1696 | | |
| |||
0 commit comments