aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2014-05-08 11:56:06 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2014-05-08 11:56:06 +0000
commit3deb3649d5214fd68d9441b84f7c31724de5307c (patch)
tree21c270f49448afc585cf16bd6f30f2249df5152e /gnu
parentf0736f4cec5bd07539272021d9482ea079bbe7ad (diff)
downloadsrc-3deb3649d5214fd68d9441b84f7c31724de5307c.tar.gz
src-3deb3649d5214fd68d9441b84f7c31724de5307c.zip
Fix incorrect netmasks being passed via rtsock.
Since radix has been ignoring sa_family in passed sockaddrs, no one ever has bothered filling valid sa_family in netmasks. Additionally, radix adjusts sa_len field in every netmask not to compare zero bytes at all. This leads us to rt_mask with sa_family of AF_UNSPEC (-1) and arbitrary sa_len field (0 for default route, for example). However, rtsock have been passing that rt_mask intact for ages, requiring all rtsock consumers to make ther own local hacks. We even have unfixed on in base: do `route -n monitor` in one window and issue `route -n get addr` for some directly-connected address. You will probably see the following: got message of size 304 on Thu May 8 15:06:06 2014 RTM_GET: Report Metrics: len 304, pid: 30493, seq 1, errno 0, flags:<UP,DONE,PINNED> locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 10.0.0.0 link#1 (255) ffff ffff ff em0:8.0.27.c5.29.d4 10.0.0.92 _________________^^^^^^^^^^^^^^^^^^ after the change: got message of size 312 on Thu May 8 15:44:07 2014 RTM_GET: Report Metrics: len 312, pid: 2895, seq 1, errno 0, flags:<UP,DONE,PINNED> locks: inits: sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA> 10.0.0.0 link#1 255.255.255.0 em0:8.0.27.c5.29.d4 10.0.0.92 _________________^^^^^^^^^^^^^^^^^^ Sponsored by: Yandex LLC MFC after: 1 month
Notes
Notes: svn path=/head/; revision=265666
Diffstat (limited to 'gnu')
0 files changed, 0 insertions, 0 deletions