Commit e1ba18d
committed
BSD: Fix netmask sockaddr family and length for incoming route msgs
Netmask family and length are ignored by traditional
userland tools such as route and netstat and are assumed
to match the destination sockaddr.
On the wire, sa_family is 0 (AF_UNSPEC)
for default routes or 255 for subnet/prefix routes.
Default routes also have zero length netmask.
In both cases we can just sub in the values from
the destination address.
This is important, because if we feed the same values
back we receive back into RTM_DELETE or RTM_ADD then
the kernel doesn't react very well.
This is currently true for all BSD kernels.1 parent ab2d7cd commit e1ba18d
2 files changed
+19
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
887 | 887 | | |
888 | 888 | | |
889 | 889 | | |
| 890 | + | |
890 | 891 | | |
891 | 892 | | |
892 | | - | |
893 | | - | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
894 | 911 | | |
895 | 912 | | |
896 | 913 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | 422 | | |
428 | 423 | | |
429 | 424 | | |
| |||
0 commit comments